/* ============================================================
   CONVOCATORIA IA 2026 — ESTILOS MEJORADOS
   Tipografía: DM Sans (cuerpo) + DM Serif Display (títulos)
   Paleta: azul institucional + verde acento + blancos cálidos
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Serif+Display:ital@0;1&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:            #f4f7fb;
  --surface:       #ffffff;
  --surface-alt:   #f8fafd;
  --surface-muted: #eef3f9;

  --border:        rgba(47, 110, 163, 0.14);
  --border-mid:    rgba(47, 110, 163, 0.24);
  --border-strong: rgba(47, 110, 163, 0.40);

  --primary:       #2563a8;
  --primary-light: #3b7dc4;
  --primary-deep:  #1a4576;
  --primary-ghost: rgba(37, 99, 168, 0.08);
  --primary-glow:  rgba(37, 99, 168, 0.18);

  --accent:        #0ea271;        /* verde esmeralda */
  --accent-soft:   rgba(14, 162, 113, 0.10);
  --accent-deep:   #0c8a60;

  --text:          #111d2e;
  --text-body:     #344054;
  --muted:         #6b7a8c;
  --muted-light:   #9aa4b2;

  --success:       #0ea271;
  --success-soft:  rgba(14, 162, 113, 0.08);
  --error:         #c0394b;
  --error-soft:    rgba(192, 57, 75, 0.08);
  --warning:       #b45309;
  --warning-soft:  rgba(180, 83, 9, 0.08);

  --shadow-xs:  0 1px 3px rgba(17, 29, 46, 0.06);
  --shadow-sm:  0 4px 12px rgba(17, 29, 46, 0.08);
  --shadow-md:  0 8px 24px rgba(17, 29, 46, 0.10);
  --shadow-lg:  0 16px 48px rgba(17, 29, 46, 0.12);
  --shadow-xl:  0 32px 80px rgba(17, 29, 46, 0.14);

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;

  --font-sans:    'DM Sans', system-ui, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;

  --step-w: 280px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img  { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background-color: #eef4fb;
  background-image:
    radial-gradient(ellipse 900px 600px at 5% 0%, rgba(37,99,168,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 620px 420px at 98% 8%, rgba(14,162,113,0.10) 0%, transparent 55%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 48%, #e8f0f8 100%);
  min-height: 100vh;
}

/* ── Shell ─────────────────────────────────────────────────── */
.page-shell {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 520px;
  padding: 32px;
  border-radius: var(--r-2xl);
  background: #0d2236;
  border: 1px solid rgba(255,255,255,0.42);
  box-shadow: 0 34px 90px rgba(17, 29, 46, 0.18);
}

.hero__background-video {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.06) contrast(1.02);
  transform: scale(1.01);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(6, 17, 33, 0.54) 0%, rgba(9, 30, 54, 0.34) 52%, rgba(255,255,255,0.18) 100%),
    radial-gradient(circle at 16% 20%, rgba(37, 99, 168, 0.24), transparent 38%),
    radial-gradient(circle at 90% 12%, rgba(14, 162, 113, 0.13), transparent 34%);
}

.hero::after {
  inset: 1px;
  z-index: -1;
  border-radius: calc(var(--r-2xl) - 1px);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    radial-gradient(ellipse 620px 260px at 54% 104%, rgba(255,255,255,0.13), transparent 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.48);
}

/* top bar */
.hero__topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.30);
}

.hero__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero__logos img {
  height: 40px;
  width: auto;
  object-fit: contain;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.70);
  box-shadow: 0 12px 30px rgba(8, 24, 43, 0.16);
  transition: box-shadow 200ms ease;
}
.hero__logos img:hover { box-shadow: var(--shadow-sm); }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #eef7ff;
  background: rgba(12, 34, 58, 0.48);
  border: 1px solid rgba(255,255,255,0.34);
  backdrop-filter: blur(14px);
}
.hero__badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #64d6a8;
  animation: pulse 2.2s ease infinite;
}

/* hero body */
.hero__body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: start;
}

.hero__copy {
  padding: 28px;
  border-radius: var(--r-xl);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: 0 20px 54px rgba(8, 24, 43, 0.14);
  backdrop-filter: blur(12px) saturate(1.04);
}

.eyebrow, .section-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 4.35rem);
  line-height: 1.03;
  color: var(--text);
  max-width: 12ch;
  margin-bottom: 14px;
}

.hero__lead {
  font-size: 1.04rem;
  line-height: 1.65;
  color: #3e4d61;
  max-width: 58ch;
  margin-bottom: 20px;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero__chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #183a60;
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(37, 99, 168, 0.18);
}
.hero__chips span::before {
  content: '✓';
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
}

.hero__panel {
  padding: 24px;
  border-radius: var(--r-xl);
  background: rgba(8, 24, 43, 0.50);
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: 0 18px 44px rgba(8, 24, 43, 0.18);
  backdrop-filter: blur(12px) saturate(1.04);
}

.hero__panel h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 16px;
}

.hero__checklist {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.hero__checklist li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.88);
  line-height: 1.55;
}
.hero__checklist li::before {
  content: '→';
  color: var(--accent);
  font-weight: 700;
  margin-top: 1px;
}

.hero__note {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.74);
  padding: 10px 14px;
  border-left: 3px solid rgba(100, 214, 168, 0.78);
  background: rgba(255,255,255,0.08);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.extension-banner {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(226, 241, 253, 0.96)),
    var(--surface);
  border: 1px solid rgba(47, 110, 163, 0.2);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-align: center;
}

.extension-banner strong {
  color: var(--primary-strong);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.extension-banner span {
  color: var(--text-body);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   LAYOUT — SIDEBAR + FORM
   ════════════════════════════════════════════════════════════ */
.layout {
  display: grid;
  grid-template-columns: var(--step-w) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.sidebar { min-width: 0; }
.form-column { min-width: 0; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card--soft {
  background: var(--surface-alt);
  border-color: var(--border);
}

.card__header {
  margin-bottom: 16px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
}

.sticky-card {
  position: sticky;
  top: 20px;
}

/* ── Step pills (sidebar progress) ────────────────────────── */
.step-pills {
  display: grid;
  gap: 6px;
}

.step-pill {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  cursor: default;
}

.step-pill__index {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 180ms ease, color 180ms ease;
}

.step-pill strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  transition: color 180ms ease;
}

.step-pill small {
  display: block;
  font-size: 0.74rem;
  color: var(--muted-light);
  line-height: 1.3;
  margin-top: 1px;
}

.step-pill.is-active {
  background: var(--primary-ghost);
  border-color: var(--border-mid);
  box-shadow: var(--shadow-xs);
}
.step-pill.is-active .step-pill__index {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.step-pill.is-active strong { color: var(--primary-deep); }

.step-pill.is-complete .step-pill__index {
  background: var(--accent-soft);
  border-color: rgba(14,162,113,0.3);
  color: var(--accent-deep);
}
.step-pill.is-complete strong { color: var(--text-body); }

/* ── Summary panel ─────────────────────────────────────────── */
.summary-panel {
  display: grid;
  gap: 12px;
}

.summary-panel div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.summary-panel div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.summary-panel dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}

.summary-panel dd {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.45;
}

/* ════════════════════════════════════════════════════════════
   FORM STEPS
   ════════════════════════════════════════════════════════════ */
.form-step {
  display: none;
  gap: 20px;
  animation: fadeUp 260ms ease;
}

.form-step.is-visible { display: grid; }

.step-header { display: grid; gap: 6px; }

.step-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  color: var(--text);
  line-height: 1.2;
  font-weight: 400;
}

.step-description {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Grids ─────────────────────────────────────────────────── */
.step-grid,
.question-grid,
.binary-grid,
.confirmation-grid,
.result-grid,
.info-grid {
  display: grid;
  gap: 16px;
}

.step-grid.two-columns,
.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.question-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Field shell ───────────────────────────────────────────── */
.field-shell {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.field-shell:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-sm);
  transform: translateY(-1px);
}

.field-shell label,
.group-label,
.question-card legend {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.field-hint,
.group-help {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.field-shell input,
.field-shell select,
.field-shell textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.93rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field-shell textarea {
  min-height: 112px;
  resize: vertical;
}

.field-shell input:focus,
.field-shell select:focus,
.field-shell textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-shell input:disabled,
.field-shell select:disabled,
.field-shell textarea:disabled {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.75;
}

.field-shell input[readonly] {
  background: var(--primary-ghost);
  color: var(--primary-deep);
  font-weight: 500;
}

.field-error {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Pill / radio group ────────────────────────────────────── */
.pill-group,
.binary-group,
.option-grid {
  display: grid;
  gap: 10px;
}

.pill-group,
.binary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.pill-option,
.binary-option {
  position: relative;
}

.pill-option input,
.binary-option input,
.question-card input[type="radio"],
.checkbox-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-option span,
.binary-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 150ms ease, color 180ms ease;
}

.pill-option span:hover,
.binary-option span:hover {
  background: var(--primary-ghost);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pill-option input:checked + span,
.binary-option input:checked + span,
.pill-option.is-selected span,
.binary-option.is-selected span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,168,0.25);
  transform: translateY(-1px);
}

.binary-option span {
  min-height: 64px;
  font-size: 0.95rem;
  flex-direction: column;
  gap: 4px;
}

/* ── Checkbox card ─────────────────────────────────────────── */
.checkbox-card {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.checkbox-card:hover {
  border-color: var(--border-mid);
  background: var(--surface-alt);
}

.checkbox-card::before {
  content: '';
  display: block;
  width: 20px; height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  border: 2px solid var(--border-mid);
  background: var(--surface-alt);
  flex-shrink: 0;
  transition: background 180ms ease, border-color 180ms ease;
}

.checkbox-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-ghost);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.checkbox-card:has(input:checked)::before {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4L4.5 7.5L11 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.checkbox-card strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.checkbox-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Question card (diagnóstico) ───────────────────────────── */
.question-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.question-card.is-error {
  border-color: rgba(192,57,75,0.3);
  box-shadow: 0 0 0 3px rgba(192,57,75,0.07);
}

.question-card legend {
  font-size: 0.88rem;
  line-height: 1.5;
}

.question-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.option-grid { grid-template-columns: 1fr; }

.question-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.86rem;
  line-height: 1.45;
  transition: background 180ms ease, border-color 180ms ease;
}

.question-option::before {
  content: '';
  width: 16px; height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--border-mid);
  background: var(--surface-alt);
  flex-shrink: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.question-option:hover {
  background: var(--surface-alt);
  border-color: var(--border-mid);
}

.question-option.is-selected {
  background: var(--primary-ghost);
  border-color: var(--primary);
}

.question-option.is-selected::before {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 4px var(--primary);
}

/* ── Helper / score / muted boxes ──────────────────────────── */
.helper-box,
.score-box {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.helper-box strong,
.score-box strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.helper-box p,
.score-box p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.muted-block,
.manual-note {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.quota-notice {
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--warning-soft);
  border: 1px solid rgba(180, 83, 9, 0.22);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.quota-notice strong {
  display: block;
  color: var(--warning);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.quota-notice p {
  margin: 0;
  color: var(--text-body);
  font-size: 0.84rem;
  line-height: 1.55;
}

.virtual-extension-message,
.virtual-only-card {
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--r-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(235, 247, 255, 0.96)),
    var(--surface);
  border: 1px solid rgba(47, 110, 163, 0.18);
  box-shadow: var(--shadow-md);
}

.virtual-extension-message {
  margin-bottom: 18px;
}

.virtual-extension-message p {
  margin: 0;
  color: var(--primary-strong);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.1vw, 1.75rem);
  line-height: 1.35;
}

.virtual-only-card h3 {
  margin: 6px 0 10px;
  color: var(--text);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.virtual-only-card p:last-child {
  margin: 0;
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Upload card ───────────────────────────────────────────── */
.upload-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 2px dashed var(--border-mid);
  transition: border-color 180ms ease, background 180ms ease;
}

.upload-card:hover {
  border-color: var(--primary-light);
  background: var(--primary-ghost);
}

.upload-card input[type="file"] {
  min-height: auto;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-size: 0.86rem;
  color: var(--text-body);
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.upload-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-deep);
  background: var(--primary-ghost);
  border: 1px solid var(--border-mid);
}

/* ── Institution guide ─────────────────────────────────────── */
.institution-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.institution-guide__item {
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.institution-guide__item strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-deep);
  margin-bottom: 6px;
}

.institution-guide__item p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Diagnostic section ────────────────────────────────────── */
.diagnostic-sections { display: grid; gap: 20px; }

.diagnostic-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.diagnostic-pill {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.diagnostic-pill strong { display: block; font-size: 0.83rem; font-weight: 600; }
.diagnostic-pill small  { font-size: 0.75rem; color: var(--muted); }

.diagnostic-pill__index {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-deep);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.diagnostic-pill.is-active { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.diagnostic-pill.is-active .diagnostic-pill__index { background: var(--primary); border-color: var(--primary); color: #fff; }
.diagnostic-pill.is-complete .diagnostic-pill__index { background: var(--accent-soft); border-color: rgba(14,162,113,0.3); color: var(--accent-deep); }

.diagnostic-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.diagnostic-section__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-deep);
}

.diagnostic-section__description {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Score / result boxes ──────────────────────────────────── */
.score-box__row, .result-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.score-box strong, .result-number {
  font-size: 1.5rem;
  color: var(--primary-deep);
  font-family: var(--font-display);
}

.result-card {
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--primary-deep);
  background: var(--primary-ghost);
  border: 1px solid var(--border-mid);
}

.field-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

/* ── Institution summary ───────────────────────────────────── */
.institution-summary__items { display: grid; gap: 8px; }
.institution-summary__items p {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-body);
}
.institution-summary__items p:last-child { padding-bottom: 0; border-bottom: none; }
.institution-summary__items span { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   MESSAGES
   ════════════════════════════════════════════════════════════ */
.message-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  line-height: 1.55;
  border: 1px solid transparent;
}

.message--error {
  color: var(--error);
  background: var(--error-soft);
  border-color: rgba(192,57,75,0.2);
}

.message--success {
  color: var(--accent-deep);
  background: var(--success-soft);
  border-color: rgba(14,162,113,0.2);
}

/* ════════════════════════════════════════════════════════════
   NAVIGATION
   ════════════════════════════════════════════════════════════ */
.form-navigation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms ease, box-shadow 180ms ease, transform 150ms ease, opacity 180ms ease, border-color 180ms ease;
}

.button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.button:active { transform: translateY(1px); }

.button--primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary-deep);
  box-shadow: 0 2px 8px rgba(37,99,168,0.20), inset 0 1px 0 rgba(255,255,255,0.15);
}
.button--primary:hover:not(:disabled) {
  background: var(--primary-light);
  box-shadow: 0 6px 20px rgba(37,99,168,0.30);
  transform: translateY(-1px);
}

.button--secondary {
  color: var(--primary-deep);
  background: var(--surface);
  border-color: var(--border-mid);
  box-shadow: var(--shadow-xs);
}
.button--secondary:hover:not(:disabled) {
  background: var(--primary-ghost);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.button--submit { display: none; margin-left: auto; }
.button--submit.is-visible {
  display: inline-flex;
  background: var(--accent);
  border-color: var(--accent-deep);
  box-shadow: 0 2px 8px rgba(14,162,113,0.20);
}
.button--submit.is-visible:hover:not(:disabled) {
  background: var(--accent-deep);
  box-shadow: 0 6px 20px rgba(14,162,113,0.30);
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════════════
   SUCCESS MODAL
   ════════════════════════════════════════════════════════════ */
.success-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.success-modal.is-visible { display: flex; }

.success-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,29,46,0.40);
  backdrop-filter: blur(6px);
}

.success-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px;
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-xl);
  animation: fadeUp 240ms ease;
}

.success-modal__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  color: var(--text);
  font-weight: 400;
}

.success-modal__content {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.success-modal__content p { margin: 0; }

.success-modal__button {
  width: fit-content;
  background: var(--accent);
  border-color: var(--accent-deep);
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.footer p {
  font-size: 0.8rem;
  color: var(--muted-light);
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════════ */
.is-hidden   { display: none !important; }
.full-span   { grid-column: 1 / -1; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1080px) {
  :root { --step-w: 240px; }

  .hero__body,
  .layout,
  .question-grid {
    grid-template-columns: 1fr;
  }

  .institution-guide,
  .diagnostic-progress {
    grid-template-columns: 1fr;
  }

  .sticky-card { position: static; }
}

@media (max-width: 760px) {
  .page-shell {
    width: calc(100% - 24px);
    padding-top: 16px;
  }

  .hero__topbar,
  .footer,
  .form-navigation {
    flex-direction: column;
    align-items: stretch;
  }

  .hero h1 { max-width: 100%; }

  .step-grid.two-columns,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .button--submit.is-visible {
    width: 100%;
    justify-content: center;
  }
}
