:root {
  --navy: #173a5b;
  --navy-deep: #143552;
  --cyan: #2f82c4;
  --cyan-dark: #236da8;
  --cyan-soft: #eaf3fa;
  --ink: #102f4d;
  --muted: #5d6e7d;
  --line: #d7d9d7;
  --surface: #f3f3ed;
  --white: #fff;
  --danger: #b42332;
  --shadow: 0 14px 38px rgba(20, 53, 82, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--surface); font-family: Montserrat, Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.topbar { position: relative; color: var(--navy); background: white; border-top: 8px solid var(--navy); border-bottom: 2px solid var(--navy); }
.topbar__inner { min-height: 102px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; min-width: 0; }
.brand img { width: 72px; height: 72px; border-radius: 2px; object-fit: cover; }
.brand__copy { display: grid; gap: 6px; min-width: 0; margin-left: 18px; padding-left: 18px; border-left: 1px solid #cfd5d7; }
.brand__copy span { color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.brand__copy strong { overflow: hidden; color: var(--navy); font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.secure-pill { display: flex; align-items: center; gap: 8px; padding: 10px 13px; color: var(--navy); background: #f0f0ec; border: 1px solid #d9d9d4; border-radius: 3px; font-size: 11px; font-weight: 600; }
.secure-pill svg { width: 15px; color: var(--cyan); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.admin-button { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; padding: 0 15px; color: white; background: var(--cyan); border: 1px solid var(--cyan); border-radius: 3px; font-size: 11px; font-weight: 700; }
.admin-button:hover { background: #236fa9; }
.admin-button svg { width: 17px; }

.hero { position: relative; min-height: 288px; overflow: hidden; color: var(--navy); background: #f3f3ed; border-bottom: 1px solid #deded8; }
.hero__grid { display: none; }
.hero__glow { position: absolute; top: 0; right: 0; width: 34%; height: 100%; background: linear-gradient(135deg, transparent 35%, rgba(47,130,196,.08)); }
.hero__inner { position: relative; padding-top: 46px; padding-bottom: 98px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; color: var(--cyan-dark); background: white; border: 1px solid #cddce8; border-radius: 3px; font-size: 11px; font-weight: 700; }
.eyebrow svg { width: 16px; }
.hero h1 { max-width: 790px; margin: 20px 0 0; font-size: clamp(32px, 4.2vw, 46px); font-weight: 800; line-height: 1.12; letter-spacing: -.035em; }
.hero p { max-width: 720px; margin: 17px 0 0; color: #334f67; font-size: 14px; font-weight: 500; line-height: 1.65; }

.main-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: -58px; padding-bottom: 60px; }
.form-card { overflow: hidden; background: white; border: 1px solid #d0d4d5; border-radius: 6px; box-shadow: var(--shadow); }
.form-card__header { padding: 26px 32px 22px; border-bottom: 1px solid #edf2f4; }
.step-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.step-heading span { display: block; color: #07849a; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.step-heading h2 { margin: 7px 0 0; font-size: 21px; letter-spacing: -.025em; }
.step-heading > strong { color: #6b7e8b; font-size: 13px; font-weight: 500; }
.progress { height: 6px; margin-top: 21px; overflow: hidden; background: #edf2f4; border-radius: 999px; }
.progress span { display: block; width: 33.333%; height: 100%; background: var(--cyan); border-radius: inherit; transition: width .3s ease; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 9px; min-width: 0; color: #738591; font-size: 11px; font-weight: 600; }
.steps b { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; color: #687b88; background: #eff4f6; border-radius: 50%; font-size: 10px; }
.steps li.is-active { color: var(--ink); }
.steps li.is-active b { color: white; background: var(--navy); }
.steps li.is-complete b { color: white; background: var(--cyan); font-size: 0; }
.steps li.is-complete b::after { content: "✓"; font-size: 12px; }

.form-card__body { min-height: 445px; padding: 30px 32px; }
.form-step { display: none; gap: 22px; }
.form-step.is-active { display: grid; animation: reveal .22s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.info-note { padding: 14px 16px; color: #3c5968; background: #eefbfd; border: 1px solid #d1f1f4; border-radius: 15px; font-size: 13px; line-height: 1.55; }
.academic-grid { grid-template-columns: repeat(2, 1fr); }
.field--wide { grid-column: 1 / -1; }
.field { display: grid; gap: 9px; align-content: start; }
.field label { color: #253b49; font-size: 13px; font-weight: 650; }
.field label em { color: #07849a; font-style: normal; }
.field input { width: 100%; height: 48px; padding: 0 15px; color: var(--ink); background: white; border: 1px solid #cbd2d5; border-radius: 3px; outline: none; transition: border .18s, box-shadow .18s; }
.field input::placeholder { color: #98a8b2; }
.field input:focus { border-color: var(--cyan-dark); box-shadow: 0 0 0 4px rgba(4,172,193,.1); }
.field input.is-invalid { border-color: #d85865; box-shadow: 0 0 0 4px rgba(216,88,101,.08); }
.field-help { display: flex; align-items: flex-start; gap: 8px; margin: -6px 0 0; color: #6f818d; font-size: 12px; line-height: 1.55; }
.field-help svg { flex: 0 0 16px; width: 16px; margin-top: 1px; color: #07849a; }
.review-box { padding: 20px; background: #f7fafb; border: 1px solid var(--line); border-radius: 18px; }
.review-box__title { display: flex; align-items: center; gap: 12px; }
.review-box__title > div { display: grid; gap: 4px; }
.review-box__title strong { font-size: 14px; }
.review-box__title small { color: var(--muted); font-size: 11px; }
.review-icon { display: grid; width: 40px; height: 40px; place-items: center; color: white; background: var(--navy); border-radius: 12px; }
.review-icon svg { width: 20px; }
.review-box dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px 24px; margin: 19px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.review-box dl div { min-width: 0; }
.review-box dt { color: #72848f; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.review-box dd { overflow-wrap: anywhere; margin: 5px 0 0; font-size: 13px; font-weight: 600; }
.check-row { display: grid; grid-template-columns: 20px 1fr; gap: 0 12px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; transition: border .18s, background .18s; }
.check-row:hover { background: #f4fcfd; border-color: #9edfe6; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-row > span { position: relative; display: block; width: 20px; height: 20px; margin-top: 1px; background: white; border: 1.5px solid #b7c6ce; border-radius: 5px; }
.check-row input:checked + span { background: var(--cyan-dark); border-color: var(--cyan-dark); }
.check-row input:checked + span::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check-row input:focus-visible + span { box-shadow: 0 0 0 4px rgba(4,172,193,.15); }
.check-row p { margin: 0; color: #405664; font-size: 13px; line-height: 1.55; }
.form-error { margin: 20px 0 0; padding: 12px 14px; color: var(--danger); background: #fff0f2; border-radius: 12px; font-size: 13px; font-weight: 600; }

.form-actions { display: flex; justify-content: space-between; gap: 14px; padding: 20px 32px; border-top: 1px solid #edf2f4; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 0; border-radius: 3px; font-size: 12px; font-weight: 700; transition: transform .16s, background .16s, opacity .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(4,172,193,.25); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button svg { width: 17px; }
.button--primary { color: white; background: var(--navy); }
.button--primary:hover:not(:disabled) { background: #06496f; }
.button--accent { margin-left: auto; color: white; background: var(--cyan-dark); }
.button--accent:hover:not(:disabled) { background: #066f82; }
.button--ghost { color: #566b78; background: transparent; }
.button--ghost:hover:not(:disabled) { background: #f0f5f7; }

.sidebar { display: grid; align-content: start; gap: 16px; }
.security-card, .help-card { border-radius: 5px; }
.security-card { padding: 25px; color: white; background: var(--navy-deep); border: 1px solid rgba(255,255,255,.07); }
.side-icon { display: grid; width: 44px; height: 44px; place-items: center; color: #55dae5; background: rgba(42,204,217,.13); border-radius: 14px; }
.side-icon svg { width: 23px; }
.security-card h3, .help-card h3 { margin: 18px 0 0; font-size: 15px; }
.security-card p { margin: 9px 0 21px; color: #cbdce4; font-size: 13px; line-height: 1.65; }
.security-card > div { display: flex; align-items: center; gap: 8px; padding-top: 16px; color: #cbdce4; border-top: 1px solid rgba(255,255,255,.09); font-size: 11px; }
.security-card > div svg { width: 15px; color: #55dae5; }
.help-card { display: flex; gap: 13px; padding: 20px; background: white; border: 1px solid var(--line); }
.side-icon--light { flex: 0 0 38px; width: 38px; height: 38px; color: #07849a; background: #eaf9fb; border-radius: 12px; }
.side-icon--light svg { width: 19px; }
.help-card h3 { margin: 2px 0 0; color: var(--ink); font-size: 13px; }
.help-card p { margin: 6px 0 0; color: #71838f; font-size: 12px; line-height: 1.55; }

.success-panel { padding: 62px 28px 70px; text-align: center; }
.success-panel__icon { display: grid; width: 72px; height: 72px; margin: 0 auto 22px; place-items: center; color: white; background: var(--cyan-dark); border-radius: 24px; box-shadow: 0 16px 35px rgba(7,132,154,.22); }
.success-panel__icon svg { width: 36px; }
.success-panel > span { color: var(--cyan-dark); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.success-panel h2 { margin: 9px auto 0; font-size: 26px; letter-spacing: -.03em; }
.success-panel p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.folio { display: inline-block; margin: 25px 0; padding: 14px 20px; color: var(--navy); background: #edf8fa; border: 1px dashed #75cbd4; border-radius: 13px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 18px; font-weight: 700; letter-spacing: .07em; }

footer { background: var(--navy-deep); border-top: 6px solid var(--cyan); }
.footer__inner { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 18px; color: white; font-size: 11px; }
.footer__inner p { margin: 0; }
.footer__inner nav { display: flex; gap: 20px; }
.footer__inner button { padding: 0; color: white; background: none; border: 0; font-size: inherit; text-decoration: underline; }
.footer__inner button:hover { color: #8ec4ed; }

dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 6px; box-shadow: 0 30px 90px rgba(2,35,54,.28); }
dialog::backdrop { background: rgba(2,31,49,.62); backdrop-filter: blur(5px); }
.dialog-card { position: relative; padding: 32px; }
.dialog-close { position: absolute; top: 15px; right: 17px; width: 34px; height: 34px; color: #6b7d88; background: #edf3f5; border: 0; border-radius: 50%; font-size: 22px; }
.dialog-kicker { color: var(--cyan-dark); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.dialog-card h2 { margin: 8px 0 17px; font-size: 24px; }
.dialog-card p { color: #526875; font-size: 13px; line-height: 1.7; }
.dialog-card .button { margin-top: 10px; }

.admin-dialog { width: min(1120px, calc(100% - 30px)); max-height: calc(100vh - 30px); overflow: hidden; border-radius: 6px; }
.admin-panel { max-height: calc(100vh - 30px); overflow: auto; background: #f4f8fa; }
.admin-panel__header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 26px 30px 22px; color: white; background: var(--navy); }
.admin-panel__header h2 { margin: 6px 0 0; font-size: 25px; }
.admin-panel__header p { margin: 7px 0 0; color: #cfe0e7; font-size: 13px; }
.admin-panel__header .dialog-close { position: static; flex: 0 0 34px; color: white; background: rgba(255,255,255,.12); }
.test-access { margin: 20px 30px 0; padding: 12px 14px; color: #395564; background: #e6f7f9; border: 1px solid #c7edf1; border-radius: 12px; font-size: 12px; }
.admin-state { padding: 70px 30px; color: var(--muted); text-align: center; }
.admin-panel > .form-error { margin: 20px 30px; }
.admin-key-form { display: grid; gap: 8px; margin: 20px 30px 0; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.admin-key-form label { font-size: 12px; font-weight: 700; }
.admin-key-form > div { display: flex; gap: 10px; }
.admin-key-form input, .admin-toolbar input { min-width: 0; height: 44px; padding: 0 13px; background: white; border: 1px solid #ccdae0; border-radius: 11px; outline: none; }
#admin-content { padding: 22px 30px 34px; }
.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.summary-card { padding: 18px; background: white; border: 1px solid var(--line); border-radius: 17px; }
.summary-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.summary-card strong { display: block; margin-top: 7px; color: var(--navy); font-size: 27px; }
.admin-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 20px 0; }
.admin-toolbar label { display: grid; flex: 1; gap: 7px; }
.admin-toolbar label span { color: #526875; font-size: 11px; font-weight: 700; }
.university-groups { display: grid; gap: 16px; }
.university-block { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 18px; }
.university-block > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; background: #eaf7f9; border-bottom: 1px solid #d3eaed; }
.university-block h3 { margin: 0; color: var(--navy); font-size: 15px; }
.university-block header span { flex: 0 0 auto; padding: 6px 10px; color: white; background: var(--cyan-dark); border-radius: 999px; font-size: 11px; font-weight: 700; }
.date-block { padding: 16px 19px; }
.date-block + .date-block { border-top: 1px solid var(--line); }
.date-block h4 { margin: 0 0 10px; color: #617681; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.admin-table th { padding: 8px 10px; color: #71848f; background: #f7fafb; text-align: left; white-space: nowrap; }
.admin-table td { padding: 10px; border-top: 1px solid #edf2f4; vertical-align: top; }
.admin-table td strong { display: block; color: var(--ink); font-size: 12px; }
.admin-table td small { display: block; margin-top: 3px; color: var(--muted); }
.empty-admin { padding: 46px 20px; color: var(--muted); background: white; border: 1px dashed #bed0d8; border-radius: 16px; text-align: center; }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1120px); }
  .topbar__inner { min-height: 76px; }
  .brand img { width: 50px; height: 50px; border-radius: 11px; }
  .brand__copy { gap: 4px; margin-left: 12px; padding-left: 12px; }
  .brand__copy span { font-size: 8px; }
  .brand__copy strong { font-size: 13px; }
  .secure-pill { display: none; }
  .admin-button { width: 44px; padding: 0; justify-content: center; font-size: 0; }
  .admin-button svg { width: 19px; }
  .hero { min-height: 320px; }
  .hero__inner { padding-top: 38px; padding-bottom: 110px; }
  .hero h1 { margin-top: 18px; font-size: 34px; }
  .hero p { font-size: 14px; }
  .main-grid { margin-top: -70px; }
  .form-card { border-radius: 22px; }
  .form-card__header, .form-card__body { padding-left: 20px; padding-right: 20px; }
  .step-heading > strong, .steps span { display: none; }
  .steps { justify-items: start; }
  .form-card__body { min-height: 470px; }
  .academic-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .review-box dl { grid-template-columns: 1fr; }
  .form-actions { padding: 18px 20px; }
  .button { flex: 1; padding-inline: 12px; }
  .button--accent { margin-left: 0; }
  .sidebar { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; justify-content: center; padding-block: 20px; }
  .admin-panel__header { padding: 22px 20px; }
  .test-access, .admin-panel > .form-error, .admin-key-form { margin-left: 18px; margin-right: 18px; }
  #admin-content { padding: 18px; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar .button { flex: none; }
}
