/* SESSI Careers Portal — follows the main sessi.gov.pk design tokens. */

:root {
  --forest-950: #061f1b;
  --forest-900: #0a3029;
  --forest-800: #10483c;
  --green-700: #16724f;
  --green-600: #1d8a5f;
  --green-100: #e8f5ef;
  --blue-700: #1f5f8b;
  --blue-100: #e8f2f9;
  --section-head: #dbe9f5;
  --amber-600: #b7791f;
  --amber-100: #fff3cf;
  --rose-600: #b93a48;
  --rose-100: #ffecef;
  --paper: #f3f7f9;
  --white: #ffffff;
  --ink-950: #10201c;
  --ink-700: #405650;
  --ink-500: #5f716c;
  --line: #d6e1dc;
  --line-strong: #b9c9c2;
  --focus: #1f5f8b;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(8, 43, 35, 0.06), 0 4px 14px rgba(8, 43, 35, 0.05);
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink-950);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-700); }
a:hover { color: var(--forest-800); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; color: var(--forest-900); margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code { background: var(--blue-100); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.container--narrow { width: min(900px, calc(100% - 32px)); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-500); }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; }
.req { color: var(--rose-600); font-weight: 700; }
[hidden] { display: none !important; }
.js-only { display: none !important; }
.js .js-only { display: inline-flex !important; }
.js label.js-only { display: flex !important; }

.skip-link {
  position: fixed; left: 16px; top: 16px; z-index: 300;
  transform: translateY(-160%);
  background: var(--white); color: var(--forest-800);
  border: 2px solid var(--green-600); border-radius: var(--radius);
  padding: 8px 14px; font-weight: 700;
}
.skip-link:focus { transform: none; }

/* ---------- Header ---------- */

.topbar { background: var(--forest-900); color: #d9efe5; font-size: 13px; }
.topbar__inner { display: flex; justify-content: space-between; gap: 12px; min-height: 36px; align-items: center; flex-wrap: wrap; }
.topbar__group { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar a { color: inherit; text-decoration: none; font-weight: 600; }
.topbar a:hover { color: var(--white); text-decoration: underline; }
.topbar__site { color: #f3c55b !important; }

.site-header { background: var(--white); border-bottom: 3px solid var(--green-700); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 80px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--forest-900); margin-right: auto; }
.brand__logo { width: 56px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-family: var(--font-display); font-size: 1.02rem; font-weight: 800; }
.brand__text span { color: var(--green-700); font-size: .86rem; font-weight: 700; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a, .link-button {
  color: var(--ink-700); text-decoration: none; font-weight: 700; font-size: .93rem;
  padding: 8px 12px; border-radius: var(--radius);
}
.site-nav a:hover, .link-button:hover { background: var(--green-100); color: var(--forest-800); }
.site-nav a[aria-current="page"] { color: var(--green-700); background: var(--green-100); }
.site-nav__admin { border: 1px solid var(--line-strong); margin-left: 6px; }
.site-nav__logout { margin: 0; }
.link-button { background: none; border: 0; cursor: pointer; font-family: inherit; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .site-header__inner { flex-wrap: wrap; min-height: 68px; padding: 8px 0; }
  .brand__logo { width: 46px; }
  .brand__text strong { font-size: .92rem; }
  .brand__text span { font-size: .8rem; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--white); cursor: pointer;
  }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block; width: 20px; height: 2px; background: var(--forest-900); position: relative;
  }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after { top: 6px; }
  .site-nav { width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: flex; }
  .site-nav__admin { margin-left: 0; }
  .topbar__group:first-child { display: none; }
}

/* ---------- Layout blocks ---------- */

.hero {
  background: linear-gradient(120deg, var(--forest-900), var(--forest-800) 60%, #154a63);
  color: var(--white);
  padding: 56px 0;
}
.hero__inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; }
.hero h1 { color: var(--white); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.hero__lead { font-size: 1.1rem; color: #d7ece3; max-width: 620px; }
.hero .eyebrow { color: #f3c55b; }
.hero__panel { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius); padding: 24px; }
.hero__stat strong { display: block; font-family: var(--font-display); font-size: 2.6rem; line-height: 1; }
.hero__stat span { color: #d7ece3; }
.hero__checks { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 14px; }
.hero__checks li { padding-left: 26px; position: relative; margin: 6px 0; }
.hero__checks li::before { content: "✓"; position: absolute; left: 0; color: #f3c55b; font-weight: 800; }

@media (max-width: 800px) {
  .hero { padding: 36px 0; }
  .hero__inner { grid-template-columns: 1fr; gap: 24px; }
}

.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; color: var(--green-700); margin-bottom: 6px; }

.section { padding: 44px 0; }
.section--compact { padding: 28px 0 48px; }
.section--tint { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.6rem; margin: 0; }
.section-head--center { justify-content: center; text-align: center; }

.page-banner { background: var(--white); border-bottom: 1px solid var(--line); padding: 22px 0 20px; }
.page-banner h1 { margin-bottom: 4px; }
.page-banner p { margin: 0; color: var(--ink-700); }
.page-banner__title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-banner__title h1 { margin: 0; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .86rem; color: var(--ink-500); margin-bottom: 10px; }
.breadcrumbs a { color: var(--blue-700); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.panel__head { background: var(--section-head); border-bottom: 1px solid var(--line-strong); padding: 10px 16px; }
.panel__head h2 { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .02em; color: var(--forest-900); }
.panel__head--split { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel__head--split a { font-weight: 700; font-size: .9rem; }
.panel__body { padding: 16px; }
.panel__body > :last-child { margin-bottom: 0; }
.panel--sticky { position: sticky; top: 100px; }

.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: 4px 0; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { order: -1; }
  .panel--sticky { position: static; }
}

.summary-list { margin: 0; }
.summary-list > div { display: grid; grid-template-columns: minmax(130px, 42%) 1fr; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--ink-500); font-weight: 600; font-size: .9rem; }
.summary-list dd { margin: 0; font-weight: 600; word-break: break-word; }
.summary-list--grid { display: grid; grid-template-columns: 1fr 1fr; }
.summary-list--grid > div { border-right: 1px solid var(--line); }
.summary-list--grid > div:nth-child(2n) { border-right: 0; }
.summary-list--boxed { border: 1px solid var(--line); border-radius: var(--radius); margin: 20px 0; text-align: left; }
@media (max-width: 700px) {
  .summary-list > div { grid-template-columns: 1fr; gap: 2px; }
  .summary-list--grid { grid-template-columns: 1fr; }
  .summary-list--grid > div { border-right: 0; }
}

.alert { border: 1px solid; border-left-width: 4px; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; background: var(--white); }
.alert--success { border-color: #9fd3b9; border-left-color: var(--green-600); background: var(--green-100); }
.alert--error { border-color: #f0b7bf; border-left-color: var(--rose-600); background: var(--rose-100); }
.alert--warning { border-color: #ecd28e; border-left-color: var(--amber-600); background: var(--amber-100); }
.alert--info { border-color: #b7d3e8; border-left-color: var(--blue-700); background: var(--blue-100); }
.flash-stack { padding-top: 16px; }
.error-summary h2 { font-size: 1rem; margin-bottom: 6px; color: var(--rose-600); }
.error-summary ul { margin: 0; padding-left: 1.2em; }
.error-summary a { color: var(--rose-600); }

.empty-state { background: var(--white); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 32px 24px; text-align: center; }
.empty-state p { color: var(--ink-700); margin-bottom: 0; }
.empty-state--error .button-row { margin-top: 18px; }

/* ---------- Buttons & badges ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 18px;
  border: 1px solid transparent; border-radius: var(--radius);
  font: 700 .95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--green-700); color: var(--white); }
.btn--primary:hover { background: var(--forest-800); color: var(--white); }
.btn--outline { background: var(--white); color: var(--forest-800); border-color: var(--line-strong); }
.btn--outline:hover { border-color: var(--green-700); background: var(--green-100); color: var(--forest-800); }
.btn--light { background: var(--white); color: var(--forest-900); }
.btn--light:hover { background: var(--green-100); color: var(--forest-900); }
.btn--ghost { background: transparent; color: var(--blue-700); }
.btn--ghost:hover { background: var(--blue-100); color: var(--blue-700); }
.btn--danger { background: var(--rose-600); color: var(--white); }
.btn--danger:hover { background: #962c38; color: var(--white); }
.btn--danger-text { color: var(--rose-600); }
.btn--danger-text:hover { background: var(--rose-100); color: var(--rose-600); }
.btn--lg { min-height: 48px; padding: 10px 24px; font-size: 1rem; }
.btn--sm { min-height: 34px; padding: 5px 12px; font-size: .86rem; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: #c9d3cf; border-color: #c9d3cf; color: #56655f; cursor: not-allowed; }

.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button-row form { margin: 0; }
.button-row--center { justify-content: center; }
.button-row--end { justify-content: flex-end; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; border: 1px solid; }
.badge--open, .badge--published { background: var(--green-100); color: var(--green-700); border-color: #a9d8c1; }
.badge--closing_soon { background: var(--amber-100); color: #8a5a00; border-color: #ecd28e; }
.badge--upcoming { background: var(--blue-100); color: var(--blue-700); border-color: #b7d3e8; }
.badge--closed { background: #eef1f0; color: #56655f; border-color: #d0d8d5; }
.badge--draft { background: #f4f1ff; color: #5b4bb0; border-color: #d6cff6; }

/* ---------- Opportunity cards ---------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
@media (max-width: 420px) { .card-grid { grid-template-columns: 1fr; } }

.opportunity-card { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--green-700); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.opportunity-card__head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.opportunity-card h3 { margin: 2px 0 2px; font-size: 1.12rem; }
.opportunity-card h3 a { color: var(--forest-900); text-decoration: none; }
.opportunity-card h3 a:hover { text-decoration: underline; }
.opportunity-card__meta { font-size: .8rem; color: var(--ink-500); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.opportunity-card__dept { color: var(--green-700); font-weight: 700; font-size: .92rem; margin: 0 0 10px; }
.opportunity-card__summary { color: var(--ink-700); font-size: .94rem; }
.opportunity-card__actions { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.fact-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.fact-list > div { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.fact-list > div:nth-child(odd) { border-right: 1px solid var(--line); }
.fact-list > div:nth-last-child(-n+2) { border-bottom: 0; }
.fact-list dt { font-size: .74rem; color: var(--ink-500); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.fact-list dd { margin: 0; font-weight: 600; font-size: .92rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.filter-bar .field { margin: 0; min-width: 170px; flex: 1 1 170px; }
.filter-bar .field--grow { flex: 2 1 260px; }
.filter-bar__actions { display: flex; gap: 8px; }
.result-count { color: var(--ink-500); font-weight: 600; font-size: .92rem; }

.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: none; }
.process__step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.process__num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-700); color: var(--white); font-weight: 800; margin-bottom: 10px; }
.process__step h3 { margin-bottom: 4px; }
.process__step p { margin: 0; color: var(--ink-700); font-size: .94rem; }
@media (max-width: 900px) { .process { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .process { grid-template-columns: 1fr; } }

.check-list { list-style: none; padding: 0; margin: 0 0 1em; }
.check-list li { position: relative; padding-left: 28px; margin: 8px 0; }
.check-list li::before { content: "✓"; position: absolute; left: 4px; color: var(--green-700); font-weight: 800; }

.apply-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--green-700); border-radius: var(--radius); padding: 16px 18px; }
.apply-bar strong, .apply-bar span { display: block; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.contact-card h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); margin-bottom: 4px; }
.contact-card p { margin: 0; font-weight: 700; font-size: 1.05rem; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field label, .field-label, .choice-group legend { font-weight: 700; font-size: .92rem; color: var(--ink-950); }
.field-hint { font-size: .85rem; color: var(--ink-500); margin: 0; }
.field-error { color: var(--rose-600); font-size: .86rem; font-weight: 600; margin: 2px 0 0; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"],
input[type="search"], input[type="password"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--white); color: var(--ink-950);
  font: 400 1rem/1.4 var(--font-body);
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid rgba(31, 95, 139, .25); outline-offset: 0; }
[aria-invalid="true"], .has-error { border-color: var(--rose-600) !important; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { background: #fffafa; }
input[readonly] { background: var(--paper); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .form-grid--4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .form-grid, .form-grid--4 { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: 0; }

.choice-group { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.choice-group legend { margin-bottom: 8px; padding: 0; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--green-700); }
.choice-row .choice { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px 14px; min-height: 44px; align-items: center; }
.choice-row .choice input { margin: 0; }
.choice--card { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; background: var(--white); }
.choice--card:has(input:checked), .choice-row .choice:has(input:checked) { border-color: var(--green-700); background: var(--green-100); box-shadow: inset 0 0 0 1px var(--green-700); }
.choice--block { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; background: var(--white); }
.choice--block:has(input:checked) { border-color: #a9d8c1; background: var(--green-100); }
.choice--strong { font-weight: 700; }
.choice--small { font-size: .88rem; margin: -6px 0 14px; }
.choice--small input { width: 18px; height: 18px; }

.age-display { min-height: 44px; display: flex; align-items: center; padding: 9px 12px; margin: 0; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper); font-weight: 700; }
.age-display.is-invalid { border-color: var(--rose-600); color: var(--rose-600); background: var(--rose-100); }

/* ---------- Application form ---------- */

.apply-form { max-width: 1000px; margin: 0 auto; }
.form-intro { font-size: .92rem; color: var(--ink-700); }

.stepper { display: none; margin: 0 0 18px; }
.js .stepper { display: block; }
.stepper__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.stepper__item {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 6px; cursor: pointer; font: 600 .78rem/1.25 var(--font-body); color: var(--ink-500); text-align: center;
}
.stepper__item:disabled { cursor: default; opacity: .7; }
.stepper__num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); font-weight: 800; background: var(--white); }
.stepper__item.is-complete { color: var(--forest-800); }
.stepper__item.is-complete .stepper__num { background: var(--green-100); border-color: var(--green-600); color: var(--green-700); }
.stepper__item[aria-current="step"] { border-color: var(--green-700); color: var(--forest-900); box-shadow: inset 0 -3px 0 var(--green-700); }
.stepper__item[aria-current="step"] .stepper__num { background: var(--green-700); border-color: var(--green-700); color: var(--white); }
.stepper__item.has-error .stepper__num { border-color: var(--rose-600); color: var(--rose-600); background: var(--rose-100); }
.stepper__mobile { display: none; margin: 0 0 6px; font-size: .92rem; }
.stepper__bar { display: none; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.stepper__bar span { display: block; height: 100%; background: var(--green-700); width: 0; transition: width .2s ease; }
@media (max-width: 760px) {
  .stepper__list { display: none; }
  .stepper__mobile, .stepper__bar { display: block; }
}

.form-step { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.js .form-step { display: none; }
.js .form-step.is-active { display: block; }
.form-step__title { margin: 0; background: var(--section-head); border-bottom: 1px solid var(--line-strong); padding: 11px 16px; font-size: 1.02rem; text-transform: uppercase; letter-spacing: .02em; border-radius: var(--radius) var(--radius) 0 0; }
.form-step__title:focus { outline: none; }
.form-step__letter { color: var(--green-700); }
.form-step__body { padding: 18px 16px 6px; }
.js .form-step[data-step="review"] { display: none; }
.js .form-step[data-step="review"].is-active { display: block; }
.form-step[data-step="review"] { display: none; }

.form-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0 8px; }
.form-nav__spacer { flex: 1; }
.js .form-nav [data-submit] { display: none; }
.js .form-nav.is-last [data-submit] { display: inline-flex; }
.js .form-nav.is-last [data-next] { display: none !important; }
.js .form-nav.is-first [data-prev] { visibility: hidden; }

/* Academic table: grid on desktop, stacked cards on mobile */
.academic-table { border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.academic-table__head, .academic-row { display: grid; grid-template-columns: 1.1fr 1.3fr 1.5fr .75fr .7fr .8fr 1fr; gap: 0; }
.academic-table__head { background: var(--section-head); font-weight: 800; font-size: .8rem; color: var(--forest-900); }
.academic-table__head span { padding: 8px; border-right: 1px solid var(--line-strong); }
.academic-table__head span:last-child { border-right: 0; }
.academic-row { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 0; min-width: 0; position: relative; }
.academic-row__title { padding: 8px; margin: 0; font-weight: 700; font-size: .86rem; grid-column: 1; display: flex; flex-direction: column; justify-content: center; background: #f6f9fa; border-right: 1px solid var(--line); }
.academic-row__tag { display: none; font-size: .7rem; font-weight: 800; color: var(--green-700); text-transform: uppercase; letter-spacing: .03em; }
.academic-row.is-qualifying { background: #f5fbf8; }
.academic-row.is-qualifying .academic-row__title { background: var(--green-100); }
.academic-row.is-qualifying .academic-row__tag { display: block; }
.academic-cell { padding: 6px; border-right: 1px solid var(--line); min-width: 0; }
.academic-cell:last-child { border-right: 0; }
.academic-cell label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.academic-cell input, .academic-cell select { min-height: 40px; padding: 7px 8px; font-size: .92rem; }
.academic-cell .field-error { font-size: .78rem; }
@media (max-width: 860px) {
  .academic-table { border: 0; overflow: visible; }
  .academic-table__head { display: none; }
  .academic-row { grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
  .academic-row__title { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
  .academic-cell { border-right: 0; padding: 8px 10px; }
  .academic-cell label { position: static; width: auto; height: auto; clip: auto; font-size: .8rem; font-weight: 700; color: var(--ink-700); display: block; margin-bottom: 3px; }
  .academic-cell:nth-child(2), .academic-cell:nth-child(3) { grid-column: 1 / -1; }
}

.eligibility-check { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; background: var(--paper); }
.eligibility-check ul { list-style: none; margin: 0; padding: 0; }
.eligibility-check li { display: flex; gap: 8px; margin: 4px 0; font-size: .93rem; }
.eligibility-check .is-ok { color: var(--green-700); }
.eligibility-check .is-fail { color: var(--rose-600); font-weight: 600; }
.eligibility-check .is-pending { color: var(--ink-500); }

.doc-list { display: grid; gap: 10px; margin-bottom: 14px; }
.doc-upload { display: flex; justify-content: space-between; gap: 14px; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--white); }
.doc-upload:focus { outline: 3px solid var(--focus); }
.doc-upload.is-uploaded { border-color: #a9d8c1; background: #f7fcf9; }
.doc-upload__info { min-width: 0; }
.doc-upload__title { margin: 0; font-weight: 700; }
.doc-upload__file { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: .9rem; word-break: break-all; }
.doc-upload__icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; background: var(--green-700); color: var(--white); font-size: .75rem; font-weight: 800; }
.doc-upload__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.doc-upload__choose { position: relative; overflow: hidden; }
.js .doc-upload__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.doc-upload__input:focus-visible + span, .doc-upload__choose:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.doc-upload__input { max-width: 220px; font-size: .85rem; }
.doc-upload__progress { margin: 6px 0 0; font-size: .86rem; }
@media (max-width: 640px) {
  .doc-upload { flex-direction: column; align-items: stretch; }
  .doc-upload__actions { justify-content: flex-start; }
}

.declaration-text { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 14px 16px; margin-bottom: 14px; }
.declaration-text p:last-child { margin-bottom: 0; }

.review { display: grid; gap: 14px; margin-bottom: 14px; }
.review-section { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.review-section__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 14px; }
.review-section__head h3 { margin: 0; font-size: .95rem; }
.review-section .summary-list > div { padding: 7px 14px; }
.review-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.review-table th, .review-table td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }

.dialog { border: 0; border-radius: var(--radius); padding: 24px; max-width: 480px; width: calc(100% - 32px); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(6, 31, 27, .55); }
.dialog h2 { margin-bottom: 8px; }

/* ---------- Success ---------- */

.success-card { background: var(--white); border: 1px solid var(--line); border-top: 5px solid var(--green-700); border-radius: var(--radius); padding: 32px 28px; text-align: center; }
.success-card__icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--green-100); color: var(--green-700); display: grid; place-items: center; font-size: 2rem; font-weight: 800; border: 2px solid #a9d8c1; }
.application-id { display: inline-flex; flex-direction: column; gap: 2px; padding: 14px 28px; border: 2px dashed var(--green-600); border-radius: var(--radius); background: var(--green-100); margin: 8px 0; }
.application-id span { font-size: .85rem; color: var(--ink-700); font-weight: 600; }
.application-id strong { font-family: var(--font-display); font-size: clamp(1.3rem, 4vw, 1.8rem); color: var(--forest-900); letter-spacing: .02em; }
.success-card .alert { text-align: left; }

/* ---------- Tables ---------- */

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { background: #f6f9fa; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-700); white-space: nowrap; }
.table tbody tr:hover { background: #fafcfb; }
.table tbody th { font-weight: 700; }
.table tr.is-highlight { background: var(--green-100); }
.table__empty { text-align: center !important; color: var(--ink-500); padding: 28px !important; }
.table-wrap .table { min-width: 760px; }

.confirm-list { list-style: none; margin: 0; padding: 0; }
.confirm-list li { display: flex; gap: 10px; margin: 6px 0; }
.confirm-list .is-yes span:first-child { color: var(--green-700); font-weight: 800; }
.confirm-list .is-no { color: var(--rose-600); }

/* ---------- Admin ---------- */

.admin-body { background: var(--paper); }
.site-header--admin { border-bottom-color: var(--blue-700); }
.admin-main { padding: 22px 0 48px; min-height: 70vh; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { margin-bottom: 2px; font-size: 1.6rem; }
.admin-head p { margin: 0; }
.admin-footer { border-top: 1px solid var(--line); padding: 16px 0; font-size: .85rem; color: var(--ink-500); background: var(--white); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-grid--compact { grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); }
.stat-card { display: flex; flex-direction: column; gap: 4px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--green-700); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; }
a.stat-card:hover { border-color: var(--green-700); }
.stat-card__label { font-size: .85rem; color: var(--ink-500); font-weight: 700; }
.stat-card__value { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; color: var(--forest-900); }
@media (max-width: 900px) { .stat-grid { grid-template-columns: 1fr 1fr; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; font-weight: 700; color: var(--ink-700); border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: -1px; }
.tabs a[aria-current="page"] { background: var(--white); border-color: var(--line-strong); color: var(--green-700); }

.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }

.applicant-head { align-items: center; }
.applicant-head__photo { width: 96px; height: 120px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--white); }
.applicant-head__text { flex: 1; min-width: 220px; }
.applicant-head__text h1 { margin: 0; }

.login-card { max-width: 420px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--green-700); border-radius: var(--radius); padding: 28px; }
.login-card__logo { margin: 0 auto 10px; }
.login-card h1 { text-align: center; font-size: 1.5rem; margin-bottom: 2px; }
.login-card > .muted { text-align: center; }

/* ---------- Footer ---------- */

.site-footer { background: var(--forest-950); color: #c6dcd3; margin-top: 12px; }
.site-footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding: 40px 0 28px; }
.site-footer h2 { color: var(--white); font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.site-footer p { font-size: .9rem; margin-top: 14px; }
.site-footer a { color: #e6f3ed; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.brand--footer { color: var(--white); }
.brand--footer .brand__logo { width: 52px; background: var(--white); border-radius: 50%; padding: 3px; }
.brand--footer .brand__text strong { color: var(--white); }
.brand--footer .brand__text span { color: #f3c55b; }
.footer-list { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.footer-list li { margin: 7px 0; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 0; font-size: .84rem; }
.site-footer__bottom .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- Print ---------- */

.print-body { background: var(--white); }
.print-sheet { padding: 20px 0 40px; max-width: 960px; }
.print-toolbar { display: flex; gap: 10px; margin-bottom: 18px; }
.print-header { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid var(--green-700); padding-bottom: 12px; margin-bottom: 18px; }
.print-header div { display: flex; flex-direction: column; }
.print-header strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--forest-900); text-transform: uppercase; }
.print-header span { color: var(--ink-700); font-size: .9rem; }
.print-header__title { font-weight: 800; color: var(--green-700) !important; font-size: 1rem !important; margin-top: 4px; }
.print-note { font-size: .82rem; color: var(--ink-500); margin-top: 14px; }

@media print {
  body { background: #fff; font-size: 11pt; }
  .topbar, .site-header, .site-footer, .admin-footer, .breadcrumbs, .no-print, .skip-link, .flash-stack { display: none !important; }
  .admin-main { padding: 0; }
  .container { width: 100%; }
  .panel { break-inside: avoid; border-color: #999; }
  .panel__head { background: #dbe9f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; }
  .table-wrap .table { min-width: 0; }
  .table th, .table td { padding: 5px 8px; }
  a { color: inherit; text-decoration: none; }
}

/* Without JavaScript the native file input is used directly. */
html:not(.js) .doc-upload__choose { border: 0; padding: 0; min-height: 0; background: none; }
html:not(.js) .doc-upload__choose [data-choose-label] { display: none; }
