:root {
  --navy-950: #071e33;
  --navy-900: #102f4c;
  --navy-700: #1e4b68;
  --teal-700: #146b69;
  --teal-500: #4a9997;
  --sea-glass: #bfe3dc;
  --cream: #f4f3ef;
  --paper: #fffefa;
  --coral: #df6b65;
  --coral-dark: #a94543;
  --gold: #b9a36e;
  --ink: #182634;
  --muted: #5d6975;
  --line: #d7dee2;
  --white: #fff;
  --shadow: 0 28px 80px rgba(4, 25, 39, .24);
  font-family: Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--cream); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 50; left: -999px; top: 10px; padding: 12px 16px; border-radius: 10px; background: var(--white); color: var(--navy-950); }
.skip-link:focus { left: 10px; }

.portal-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 5vw, 76px);
  color: var(--white);
  background: var(--navy-950);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--white); font-size: 23px; font-weight: 900; letter-spacing: -.04em; text-decoration: none; }
.brand img { border-radius: 11px; box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.quiet-link { color: #e8f4f4; font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.quiet-link:hover { color: var(--gold); }

.eyebrow, .card-kicker { margin: 0; color: var(--teal-700); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { text-wrap: pretty; }
h1 { margin: 0; color: var(--navy-900); font-size: clamp(48px, 6.5vw, 86px); line-height: .96; letter-spacing: -.06em; }
h2 { margin: 0; color: var(--navy-900); font-size: clamp(30px, 3vw, 46px); line-height: 1.02; letter-spacing: -.04em; }
.lead { max-width: 720px; margin: 24px 0 0; color: var(--muted); font-size: clamp(17px, 1.7vw, 21px); line-height: 1.65; }
.muted { color: var(--muted); line-height: 1.65; }

.landing {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(540px, 1.1fr);
  gap: clamp(44px, 7vw, 110px);
  align-items: center;
  padding: clamp(60px, 8vw, 120px) clamp(20px, 7vw, 110px);
  background:
    radial-gradient(circle at 90% 12%, rgba(74,153,151,.22), transparent 28%),
    linear-gradient(140deg, #fffefa 0%, var(--cream) 55%, #dce9e8 100%);
}
.landing-copy .eyebrow { margin-bottom: 15px; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 34px; }
.trust-strip span { padding: 9px 13px; border: 1px solid #b4c7c8; border-radius: 999px; color: var(--navy-700); background: rgba(255,255,255,.62); font-size: 13px; font-weight: 800; }
.route-grid { display: grid; gap: 18px; }
.route-card { position: relative; display: grid; min-height: 280px; padding: 32px; overflow: hidden; border: 1px solid rgba(255,255,255,.26); border-radius: 28px; color: var(--white); text-decoration: none; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.route-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -105px; border: 42px solid rgba(255,255,255,.08); border-radius: 50%; }
.route-card:hover { transform: translateY(-4px); box-shadow: 0 34px 90px rgba(4,25,39,.3); }
.route-card-coral { background: linear-gradient(135deg, var(--navy-900), #733e4b); }
.route-card-teal { background: linear-gradient(135deg, var(--navy-900), var(--teal-700)); }
.route-card .card-kicker { align-self: end; color: #d9f6f1; }
.route-card h2 { margin-top: 8px; color: var(--white); }
.route-card p:not(.card-kicker) { max-width: 620px; margin: 13px 0 0; color: #e6eff3; line-height: 1.55; }
.route-number { position: absolute; top: 24px; right: 27px; color: rgba(255,255,255,.6); font-size: 42px; font-weight: 300; }
.card-action { margin-top: 23px; color: var(--white); font-weight: 900; }

.form-stage {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(360px, .86fr) minmax(520px, 1.14fr);
  gap: clamp(38px, 6vw, 92px);
  align-items: start;
  padding: clamp(52px, 7vw, 98px) clamp(20px, 7vw, 110px);
  background:
    radial-gradient(circle at 8% 8%, rgba(127,174,179,.28), transparent 28%),
    linear-gradient(145deg, var(--navy-950), var(--navy-900) 47%, #0a4a49);
}
.form-intro-panel { position: sticky; top: 32px; padding-top: 20px; color: var(--white); }
.form-intro-panel .eyebrow { margin-bottom: 14px; color: #a9e8df; }
.form-intro-panel h1 { color: var(--white); font-size: clamp(48px, 5.5vw, 78px); }
.form-intro-panel .lead { color: #dbe9f3; }
.voyage-steps { display: grid; gap: 16px; margin: 34px 0 0; padding: 0; list-style: none; }
.voyage-steps li { display: grid; grid-template-columns: 36px 1fr; gap: 13px; align-items: start; }
.voyage-steps li > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--navy-950); background: var(--gold); font-weight: 900; }
.voyage-steps strong { font-size: 16px; }
.voyage-steps p { margin: 4px 0 0; color: #dbe9f3; line-height: 1.45; }
.privacy-note { display: grid; gap: 5px; margin-top: 34px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(4,25,39,.38); }
.privacy-note strong { color: var(--white); }
.privacy-note span { color: #dbe9f3; line-height: 1.5; }
.help-card { margin-top: 32px; padding: 22px 24px; border-radius: 20px; color: var(--navy-950); background: rgba(255,255,255,.92); }
.help-card ul { display: grid; gap: 9px; margin: 15px 0 0; padding-left: 20px; }
.help-card .card-kicker { color: var(--coral-dark); }

.form-card { padding: clamp(28px, 4vw, 48px); border: 1px solid rgba(255,255,255,.7); border-radius: 32px; background: var(--paper); box-shadow: var(--shadow); }
.form-card > .card-kicker { color: var(--coral-dark); }
.form-card h2 { margin-top: 8px; }
.form-lead { margin: 14px 0 0; color: var(--muted); line-height: 1.6; }
.portal-form { display: grid; gap: 21px; margin-top: 30px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; color: var(--navy-900); font-weight: 850; }
.field small { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.45; }
.field em { margin-left: 5px; color: var(--muted); font-size: 11px; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; border: 2px solid #bdc8cd; border-radius: 13px; color: var(--ink); background: var(--white); font-weight: 500; transition: border-color .15s ease, box-shadow .15s ease; }
.field input, .field select { min-height: 52px; padding: 0 14px; }
.field textarea { min-height: 142px; padding: 13px 14px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid rgba(223,107,101,.28); outline-offset: 2px; border-color: var(--coral-dark); box-shadow: 0 0 0 5px rgba(223,107,101,.09); }
.field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid { border-color: var(--coral-dark); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: start; color: var(--muted); font-size: 14px; line-height: 1.5; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--teal-700); }
.turnstile-slot { min-height: 65px; }
.button { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; padding: 0 24px; border: 0; border-radius: 14px; font-weight: 900; text-decoration: none; cursor: pointer; }
.button-primary { color: var(--white); background: linear-gradient(135deg, var(--navy-900), var(--teal-700)); box-shadow: 0 12px 28px rgba(7,30,51,.22); }
.button-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--navy-700), #0f7974); }
.button:disabled { cursor: wait; opacity: .62; }
.form-status { min-height: 22px; margin: -6px 0 0; color: var(--teal-700); font-size: 14px; font-weight: 800; line-height: 1.45; }
.form-status[data-state="error"] { color: var(--coral-dark); }

.success-body { background: linear-gradient(145deg, var(--navy-950), var(--teal-700)); }
.success-stage { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 48px 20px; }
.success-card { width: min(680px, 100%); padding: clamp(34px, 6vw, 68px); border-radius: 34px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.success-mark { display: grid; width: 72px; height: 72px; margin: 0 auto 22px; place-items: center; border-radius: 50%; color: var(--white); background: var(--teal-700); font-size: 36px; font-weight: 900; }
.success-card h1 { margin-top: 10px; font-size: clamp(46px, 7vw, 76px); }
.success-card .lead { margin-inline: auto; }
.reference { margin: 28px auto; padding: 16px 20px; border: 2px dashed var(--gold); border-radius: 14px; color: var(--navy-900); background: #f7f1df; font-family: ui-monospace, "Cascadia Mono", monospace; font-size: clamp(18px, 3vw, 25px); font-weight: 900; letter-spacing: .05em; overflow-wrap: anywhere; }
.success-card .button { margin-top: 18px; }
.portal-footer { min-height: 74px; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 18px 20px; color: #dbe9f3; background: var(--navy-950); font-size: 14px; }
.portal-footer a { color: var(--white); text-underline-offset: 4px; }

.admin-body { background: #e9eeef; }
.admin-header { position: sticky; z-index: 20; top: 0; }
.admin-account { display: flex; align-items: center; gap: 22px; color: #c9dadd; font-size: 14px; }
.admin-stage { width: min(1500px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.admin-hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.admin-hero h1 { max-width: 900px; font-size: clamp(48px, 6vw, 78px); }
.admin-hero .lead { margin-top: 15px; }
.admin-notice { min-height: 47px; margin: 0 0 22px; padding: 13px 17px; border: 1px solid #b7c8c9; border-radius: 12px; color: var(--teal-700); background: #f5fbfa; font-weight: 800; }
.admin-notice[data-state="error"] { border-color: #d7a3a0; color: var(--coral-dark); background: #fff5f4; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.summary-card { min-height: 170px; padding: 25px 28px; border-radius: 22px; color: var(--white); background: linear-gradient(140deg, var(--navy-900), var(--teal-700)); box-shadow: 0 18px 44px rgba(7,30,51,.14); }
.summary-card .card-kicker { color: #c8eee9; }
.summary-card strong { display: block; margin: 8px 0; font-size: 54px; line-height: 1; }
.summary-card span { color: #dbe9f3; line-height: 1.55; }
.queue-card { margin-top: 24px; padding: 28px; border: 1px solid #cfd9dc; border-radius: 24px; background: var(--paper); box-shadow: 0 15px 45px rgba(7,30,51,.09); }
.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.queue-heading h2 { margin-top: 6px; font-size: 35px; }
.queue-tools { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin: 24px 0 18px; }
.queue-tools label { display: grid; gap: 7px; color: var(--navy-900); font-size: 13px; font-weight: 900; }
.queue-tools input, .queue-tools select { min-height: 44px; padding: 0 12px; border: 1px solid #aabac0; border-radius: 10px; background: var(--white); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; min-width: 1080px; border-collapse: collapse; }
th { padding: 12px 14px; color: #dcebed; background: var(--navy-900); font-size: 12px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { max-width: 310px; padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td span, td small { display: block; overflow-wrap: anywhere; }
td strong { color: var(--navy-900); }
td small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.table-label { margin-top: 5px; color: var(--teal-700); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 12px; font-weight: 800; }
td select, td textarea { width: 100%; padding: 8px; border: 1px solid #aabac0; border-radius: 8px; background: var(--white); }
td textarea { min-height: 64px; resize: vertical; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--white); background: var(--teal-700); font-weight: 850; cursor: pointer; }
.mini-button-danger { background: var(--coral-dark); }
.button-secondary { border: 1px solid var(--navy-700); color: var(--navy-900); background: var(--white); }
.button-danger { color: var(--white); background: var(--coral-dark); }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }
dialog { width: min(580px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 24px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(7,30,51,.72); }
.dialog-card { padding: 32px; }
.dialog-card h2 { margin-top: 8px; }
.dialog-card .field { margin-top: 24px; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin-top: 24px; }

@media (max-width: 980px) {
  .landing, .form-stage { grid-template-columns: 1fr; }
  .landing { padding-top: 64px; }
  .form-intro-panel { position: static; }
  .route-grid { grid-template-columns: 1fr 1fr; }
  .admin-hero { align-items: start; flex-direction: column; }
}

@media (max-width: 680px) {
  .portal-header { min-height: 68px; }
  .brand { font-size: 20px; }
  .brand img { width: 39px; height: 39px; }
  .quiet-link { max-width: 145px; font-size: 13px; text-align: right; }
  .landing, .form-stage { padding: 42px 16px; }
  .route-grid, .field-row { grid-template-columns: 1fr; }
  .route-card { min-height: 250px; padding: 26px; }
  .form-card { padding: 28px 20px; border-radius: 24px; }
  .form-intro-panel h1 { font-size: 49px; }
  .portal-footer { flex-wrap: wrap; }
  .admin-stage { width: min(100% - 24px, 1500px); padding-top: 28px; }
  .admin-account [data-account] { display: none; }
  .summary-grid, .queue-tools { grid-template-columns: 1fr; }
  .queue-card { padding: 20px 14px; }
  .queue-heading { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-card, .field input, .field select, .field textarea { transition: none; }
}
