/* ---------------------------------------------------------------
   Tokens: ink navy, cool paper, runway amber, teal for success
---------------------------------------------------------------- */
:root {
  --ink: #14233C;
  --ink-soft: #4A5A73;
  --paper: #F3F6F9;
  --surface: #FFFFFF;
  --line: #D6DEE8;
  --amber: #E8A33D;
  --amber-ink: #6B4508;
  --teal: #0E7C74;
  --error: #B93A2B;
  --error-bg: #FBEDEA;
  --focus: #2F6FDB;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E6ECF5;
    --ink-soft: #9DAAC0;
    --paper: #0D1626;
    --surface: #15213A;
    --line: #2A3A57;
    --amber: #F0B357;
    --amber-ink: #2A1B03;
    --teal: #3FBFB2;
    --error: #F08A7B;
    --error-bg: #3A1D1A;
    --focus: #7AA7F5;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: .5rem 1rem; border-radius: var(--r-sm); z-index: 20;
}
.skip:focus { top: 1rem; }

.visually-hidden, .hp {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- top */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1180px; margin: 0 auto; padding: 1.25rem 1.5rem;
}
.brand {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; font: 700 1.125rem/1.2 var(--font-display);
}
.topbar-help { font-size: .9375rem; color: var(--ink-soft); text-decoration: none; }
.topbar-help:hover { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 3.5rem;
  max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem;
  align-items: start;
}

.intro { position: sticky; top: calc(1.5rem + env(safe-area-inset-top, 0px)); }
.crumbs { font-size: .875rem; color: var(--ink-soft); margin-bottom: 1.25rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

h1 {
  font: 700 clamp(2.25rem, 4vw, 3.25rem)/1.02 var(--font-display);
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}
.lede { color: var(--ink-soft); font-size: 1.0625rem; margin: 0 0 2.25rem; max-width: 34ch; }

/* The route: a vertical flight path that tracks the steps */
.route {
  list-style: none; margin: 0 0 2rem; padding: 0;
  position: relative;
}
.route::before {
  content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px;
  border-left: 2px dashed var(--line);
}
.route li {
  position: relative; display: flex; gap: 1rem; align-items: flex-start;
  padding: .55rem 0; color: var(--ink-soft);
  cursor: default;
}
.route li.is-done { cursor: pointer; }
.route strong { display: block; font-weight: 600; color: inherit; }
.route small { display: block; font-size: .8125rem; }
.route .dot {
  flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line);
  position: relative; z-index: 1;
  transition: background .25s, border-color .25s, transform .25s;
}
.route li.is-done { color: var(--ink); }
.route li.is-done .dot { background: var(--ink); border-color: var(--ink); }
.route li.is-current { color: var(--ink); }
.route li.is-current .dot {
  background: var(--amber); border-color: var(--amber); transform: scale(1.15);
}
.route li.is-current strong { font-weight: 700; }

.intro-note { font-size: .875rem; color: var(--ink-soft); max-width: 32ch; }

/* ---------------------------------------------------------------- panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.step { display: none; border: 0; margin: 0; padding: 0; min-width: 0; }
.step.is-active {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem;
  animation: stepIn .3s ease-out;
}
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

legend {
  grid-column: 1 / -1; padding: 0;
  font: 700 1.625rem/1.2 var(--font-display); letter-spacing: -0.015em;
}
.step-hint { grid-column: 1 / -1; margin: -.6rem 0 .5rem; color: var(--ink-soft); }

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.span-2 { grid-column: 1 / -1; }

label, .label { font-weight: 600; font-size: .9375rem; }
.req { color: var(--error); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: .7rem .85rem;
  transition: border-color .15s, background .15s;
}
textarea { resize: vertical; min-height: 4.5rem; }
input:hover, textarea:hover { border-color: var(--ink-soft); }
input:focus, textarea:focus { outline: none; border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }

.field.has-error input, .field.has-error textarea, .field.has-error .drop { border-color: var(--error); }
.field.is-valid input { border-color: var(--teal); }

.help { margin: 0; font-size: .8125rem; color: var(--ink-soft); }
.error { margin: 0; font-size: .8125rem; color: var(--error); font-weight: 500; min-height: 0; }
.error:empty { display: none; }

/* Drop zones */
.drop {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 7rem; padding: 1rem;
  border: 1.5px dashed var(--line); border-radius: var(--r-md);
  background: var(--paper); cursor: pointer; text-align: center;
  font-weight: 400; color: var(--ink-soft);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, var(--paper)); }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-empty strong { color: var(--ink); }
.drop-preview { display: flex; align-items: center; gap: 1rem; text-align: left; width: 100%; }
.drop-preview img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.drop-preview .file-meta { flex: 1; min-width: 0; color: var(--ink); }
.drop-preview .file-meta span { display: block; font-size: .8125rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.drop-preview .file-pdf { width: 64px; height: 64px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--ink); color: var(--paper); font-weight: 700; font-size: .875rem; }
.drop-remove {
  position: relative; z-index: 2;
  font: 600 .875rem var(--font-body); color: var(--error);
  background: none; border: 0; padding: .4rem .6rem; cursor: pointer; border-radius: var(--r-sm);
}
.drop-remove:hover { background: var(--error-bg); }

/* Checkbox */
.check { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: .7rem; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--ink); }
.check label { flex: 1; font-weight: 400; }
.check .error { flex-basis: 100%; }

/* Review */
.review { display: grid; gap: 1rem; }
.review-block { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.15rem; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.review-head h3 { margin: 0; font: 700 1.0625rem var(--font-display); }
.review-edit { font: 600 .875rem var(--font-body); color: var(--focus); background: none; border: 0; cursor: pointer; padding: .25rem .5rem; border-radius: var(--r-sm); }
.review-edit:hover { text-decoration: underline; }
.review dl { margin: 0; display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: .3rem 1rem; font-size: .9375rem; }
.review dt { color: var(--ink-soft); }
.review dd { margin: 0; overflow-wrap: anywhere; }
.review .empty { color: var(--ink-soft); font-style: italic; }

/* Alerts */
.form-alert {
  margin-bottom: 1.5rem; padding: .9rem 1.1rem;
  border-radius: var(--r-md); background: var(--error-bg); color: var(--error);
  font-weight: 500; border-left: 4px solid var(--error);
}

/* Actions */
.actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font: 600 1rem var(--font-body); text-decoration: none;
  padding: .8rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: background .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--amber)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn[disabled] { opacity: .7; cursor: progress; }

.spinner {
  display: none; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- success pass */
.success { outline: none; }
.pass {
  display: grid; grid-template-columns: 1fr auto;
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-lg); overflow: hidden;
  animation: passIn .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes passIn { from { opacity: 0; transform: translateY(16px) rotate(-1deg); } to { opacity: 1; transform: none; } }
.pass-main { padding: 1.75rem 2rem; }
.pass-kicker { margin: 0 0 1rem; color: var(--amber); font-weight: 600; }
.pass-name { margin: 0; font: 700 1.75rem/1.15 var(--font-display); overflow-wrap: anywhere; }
.pass-company { margin: .25rem 0 1.5rem; opacity: .8; overflow-wrap: anywhere; }
.pass-meta { display: flex; gap: 2rem; margin: 0; flex-wrap: wrap; }
.pass-meta dt { font-size: .8125rem; opacity: .7; }
.pass-meta dd { margin: 0; font-weight: 600; }
.pass-stub {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .35rem;
  padding: 1.75rem 2rem; background: var(--amber); color: var(--amber-ink); text-align: center;
  border-left: 2px dashed color-mix(in srgb, var(--amber-ink) 40%, transparent);
}
.pass-stub::before, .pass-stub::after {
  content: ""; position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface);
}
.pass-stub::before { top: -11px; }
.pass-stub::after { bottom: -11px; }
.pass-stub span { font-size: .8125rem; font-weight: 600; }
.pass-stub strong { font: 700 1.75rem/1 var(--font-display); letter-spacing: .02em; }
.btn-copy {
  margin-top: .4rem; font: 600 .8125rem var(--font-body); color: var(--amber-ink);
  background: color-mix(in srgb, var(--amber-ink) 12%, transparent);
  border: 0; border-radius: 999px; padding: .35rem .85rem; cursor: pointer;
}
.success-text { margin: 1.5rem 0; color: var(--ink-soft); max-width: 60ch; }
.success-text strong { color: var(--ink); }

/* ---------------------------------------------------------------- lower sections */
.next, .faq { max-width: 1180px; margin: 0 auto; padding: 3rem 1.5rem; }
.next h2, .faq h2 { font: 700 1.75rem/1.2 var(--font-display); letter-spacing: -0.015em; margin: 0 0 1.5rem; }
.next-list { list-style: none; counter-reset: n; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.next-list li { counter-increment: n; border-top: 2px solid var(--ink); padding-top: 1rem; }
.next-list li::before { content: counter(n); font: 700 2.5rem/1 var(--font-display); color: var(--amber); display: block; margin-bottom: .75rem; }
.next-list strong { display: block; font-size: 1.0625rem; margin-bottom: .25rem; }
.next-list span { color: var(--ink-soft); }

.faq { max-width: 820px; margin-left: max(1.5rem, calc((100vw - 1180px) / 2)); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2rem 1.1rem 0; position: relative;
  font-weight: 600; font-size: 1.0625rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .9rem; font-size: 1.5rem; line-height: 1; color: var(--ink-soft); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.25rem; color: var(--ink-soft); max-width: 65ch; }

.footer {
  max-width: 1180px; margin: 2rem auto 0; padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem;
  font-size: .9375rem; color: var(--ink-soft);
}
.footer strong { color: var(--ink); }
.footer address { font-style: normal; max-width: 40ch; }
.footer-contact { display: flex; flex-direction: column; gap: .25rem; }
.footer-copy { flex-basis: 100%; margin: 0; font-size: .8125rem; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 150%);
  background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem; border-radius: 999px; font-weight: 500;
  transition: transform .3s ease; z-index: 30; max-width: calc(100vw - 2rem);
}
.toast.is-visible { transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .intro { position: static; }
  .lede { margin-bottom: 1.5rem; max-width: none; }
  .route { display: flex; justify-content: space-between; margin-bottom: 0; }
  .route::before { left: 10px; right: 10px; top: 19px; bottom: auto; border-left: 0; border-top: 2px dashed var(--line); }
  .route li { flex-direction: column; align-items: center; text-align: center; gap: .4rem; flex: 1; padding: .55rem .25rem; }
  .route small { display: none; }
  .route strong { font-size: .8125rem; }
  .intro-note { display: none; }
  .next-list { grid-template-columns: 1fr; gap: 1.5rem; }
  .faq { margin-left: auto; }
}

@media (max-width: 600px) {
  .topbar-help { display: none; }
  .step.is-active { grid-template-columns: 1fr; }
  .review dl { grid-template-columns: 1fr; }
  .review dt { margin-top: .4rem; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .pass { grid-template-columns: 1fr; }
  .pass-stub { border-left: 0; border-top: 2px dashed color-mix(in srgb, var(--amber-ink) 40%, transparent); }
  .pass-stub::before, .pass-stub::after { top: -12px; left: auto; bottom: auto; }
  .pass-stub::before { left: -11px; }
  .pass-stub::after { right: -11px; }
}
