/* /check page CSS (W5). Shared components (.btn, .seg, .nstep, .fstat,
   .progress, .actbar, .trav, .toast, .sheet, .picker, .cchip, .field, .input,
   .resume) live in app.css; this file only lays out the wizard and styles the
   few pieces that exist on this page alone. Tokens come from app.css; each
   carries a fallback so the page still reads before they load. */

.check-page { background: var(--bg, #fbf9f5); }

/* ---- header: Back · wordmark · Help · Account ---- */
.check-head__row { display: flex; align-items: center; gap: var(--sp-3, .75rem); min-height: var(--header-h, 3.5rem); }
.check-head__back {
  display: none; align-items: center; justify-content: center;
  width: var(--tap, 2.75rem); height: var(--tap, 2.75rem); margin-left: -.5rem;
  color: var(--ink, #1d1b18); border-radius: var(--r-sm, .5rem);
}
.check-head__back .ic { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.check-head__nav { margin-left: auto; display: flex; gap: var(--sp-2, .5rem); }
.check-head__nav a {
  display: inline-flex; align-items: center; min-height: var(--tap, 2.75rem); padding: 0 var(--sp-3, .75rem);
  color: var(--c-primary-text, #0b6f60); font-weight: var(--fw-semibold, 600); text-decoration: none;
}
.check-head__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- page frame: form column 680 + side panel 360, 80 apart ---- */
.wiz-page { padding-top: var(--sp-4, 1rem); padding-bottom: var(--sp-10, 2.5rem); }
.wiz-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-8, 2rem); max-width: 1120px; margin: 0 auto; }
.wiz-col { min-width: 0; }

/* ---- progress: sticky under the header ---- */
.wiz-prog {
  position: sticky; top: var(--header-h, 3.5rem); z-index: 2;
  background: var(--bg, #fbf9f5); padding: var(--sp-2, .5rem) 0 var(--sp-3, .75rem);
}
.wiz-prog .progress__label { margin: 0 0 var(--sp-2, .5rem); font-size: var(--fs-sm, .875rem); color: var(--ink-3, #5c574f); }
.wiz-prog .progress { height: 4px; border-radius: 2px; background: var(--line, #e4ded3); overflow: hidden; }
.wiz-prog .progress__bar {
  width: var(--p, 0%); height: 100%; background: var(--c-primary, #0b6f60);
  transition: width var(--dur-3, 240ms) var(--ease-out, ease-out);
}

/* ---- the form ---- */
.wiz { margin-top: var(--sp-3, .75rem); }
.wiz__q { font-family: var(--font-display, inherit); font-size: var(--fs-h2, 1.5rem); line-height: var(--lh-heading, 1.2); margin: 0 0 var(--sp-2, .5rem); }
h1.wiz__q { font-size: var(--fs-h1, 1.75rem); }
.wiz__q:focus { outline: none; }
.wiz__q:focus-visible { outline: var(--focus-w, 2px) solid var(--focus-color, #0b6f60); outline-offset: var(--focus-offset, 2px); }
.wiz__hint { margin: 0 0 var(--sp-5, 1.25rem); }
.wiz__lede { margin: 0 0 var(--sp-3, .75rem); font-size: var(--fs-body-lg, 1.0625rem); }
.wiz__dup { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wiz__trav {
  margin: 0 0 var(--sp-2, .5rem); font-size: var(--fs-xs, .8125rem); font-weight: var(--fw-semibold, 600);
  letter-spacing: var(--ls-caps, .04em); text-transform: uppercase; color: var(--ink-3, #5c574f);
}
.wiz__screens fieldset { border: 0; padding: 0; min-width: 0; }
.wiz__hint + .field, .wiz__hint + fieldset { margin-top: var(--sp-2, .5rem); }
.wiz__block { padding-top: var(--sp-5, 1.25rem); }
.wiz__block + .wiz__block { margin-top: var(--sp-5, 1.25rem); border-top: 1px solid var(--line-2, #eee9e0); }
.wiz__block > :first-child { margin-top: 0; }
.wiz__last { margin: var(--sp-4, 1rem) 0 0; }
.wiz .two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-4, 1rem); }

/* The number inside a stepper keeps its compact look next to the global
   input[type=number] rule, which otherwise wins on specificity. */
.wiz .nstep .nstep__val, .wiz .picked .nstep__val {
  width: 3rem; min-height: var(--tap, 2.75rem); padding: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; text-align: center;
}
.wiz .nstep .nstep__val:focus { outline: var(--focus-w, 2px) solid var(--focus-color, #0b6f60); outline-offset: -2px; }
.wiz .nstep { max-width: 100%; }
.wiz .field > .nstep { justify-self: start; }
/* Keep country, stepper and remove on one row at 375 px. */
.wiz .picked__row { flex-wrap: nowrap; gap: var(--sp-2, .5rem); }
.wiz .picked__country { min-width: 0; flex: 1 1 5rem; }
.wiz__screens > .fstat, .wiz__block > .fstat { margin-bottom: var(--sp-4, 1rem); }

/* Apply-between line under the dates */
.wiz__window {
  margin-top: var(--sp-5, 1.25rem); padding: var(--sp-3, .75rem) var(--sp-4, 1rem);
  background: var(--bg-mint, #eef6f3); border-radius: var(--r-sm, .5rem);
}
.wiz__window p { margin: var(--sp-1, .25rem) 0 0; }

/* Text-style buttons (.linkbtn, app.css): "Pick a month", "I'll check the dates later", "Skip" */
.wiz .linkbtn { text-align: left; }
.wiz__links { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin: var(--sp-3, .75rem) 0 0; }

/* Year of an earlier refusal: a compact grid of radio options */
.seg.seg--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)); }

/* Multi-select chips: refusal reasons and ties to India (native checkboxes) */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2, .5rem); margin-top: var(--sp-2, .5rem); }
.chk { position: relative; display: inline-flex; }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chk span {
  display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap, 2.75rem); padding: .5rem .9rem;
  border: 1px solid var(--line-input, #8d867b); border-radius: var(--r-pill, 999px);
  background: var(--bg-raised, #fff); color: var(--ink, #1d1b18); cursor: pointer; line-height: 1.3;
}
.chk span:hover { border-color: var(--c-primary, #0b6f60); }
.chk input:checked + span { background: var(--c-primary-soft, #dff0ea); border: 2px solid var(--c-primary, #0b6f60); padding: calc(.5rem - 1px) calc(.9rem - 1px); font-weight: var(--fw-semibold, 600); }
.chk input:checked + span::before { content: "\2713"; font-weight: 700; color: var(--c-primary-text, #0b6f60); }
.chk input:focus-visible + span { outline: var(--focus-w, 2px) solid var(--focus-color, #0b6f60); outline-offset: var(--focus-offset, 2px); }

/* "Same as traveller 1" summary for travellers 2+ */
.wiz__shared { padding: var(--sp-4, 1rem); background: var(--bg-sunken, #f3efe8); border-radius: var(--r-md, .75rem); }
.wiz__shared p { margin: 0; }

/* Errors: one message on a phone, a linked list on desktop */
.wiz-error {
  margin: 0 0 var(--sp-4, 1rem); padding: var(--sp-3, .75rem) var(--sp-4, 1rem);
  border-left: 4px solid var(--c-fix, #b3261e); background: var(--c-fix-soft, #fbe9e7);
  color: var(--c-fix-deep, #7a1a14); border-radius: var(--r-sm, .5rem);
}
.wiz-error[hidden] { display: none; }
.wiz-error p { margin: 0; }
.wiz-error ul { margin: var(--sp-2, .5rem) 0 0; padding-left: 1.2rem; }
.wiz-error a { color: inherit; }
.wiz__errbtns { display: flex; flex-wrap: wrap; gap: var(--sp-2, .5rem); margin-top: var(--sp-3, .75rem); }

/* Back / Continue at the foot of the card */
.wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3, .75rem); margin-top: var(--sp-6, 1.5rem); }
.wiz-nav > :only-child { margin-left: auto; }
.wiz[data-bar="1"] .wiz-nav { display: none; }

/* ---- loading and failure ---- */
.wiz-load { padding: var(--sp-8, 2rem) 0; }
.wiz-load__bar { height: 6px; border-radius: 3px; background: var(--line, #e4ded3); overflow: hidden; margin: var(--sp-4, 1rem) 0; }
.wiz-load__bar span { display: block; height: 100%; width: 90%; background: var(--c-primary, #0b6f60); transform-origin: left; animation: wiz-fill 3.5s var(--ease-out, ease-out) both; }
@keyframes wiz-fill { from { transform: scaleX(.05); } to { transform: scaleX(1); } }
.wiz-load__msg { color: var(--ink-3, #5c574f); min-height: 1.5em; }
.wiz-fail { padding: var(--sp-6, 1.5rem) 0; }
.wiz-fail p { margin: 0 0 var(--sp-4, 1rem); }

/* ---- side panel (desktop) ---- */
.wiz-aside { display: none; }
.wiz-aside__card {
  background: var(--bg-raised, #fff); border-radius: var(--r-md, .75rem);
  box-shadow: var(--ring-card, 0 0 0 1px #e4ded3); padding: var(--sp-4, 1rem) var(--sp-5, 1.25rem);
}
.wiz-aside__card + .wiz-aside__card { margin-top: var(--sp-4, 1rem); }
.wiz-aside__h { font-size: var(--fs-sm, .875rem); font-weight: var(--fw-semibold, 600); color: var(--ink-3, #5c574f); margin: 0 0 var(--sp-2, .5rem); }
.wiz-aside__dest { font-family: var(--font-display, inherit); font-size: var(--fs-h4, 1.125rem); font-weight: var(--fw-bold, 700); margin: 0; }
.wiz-kv { margin: 0; }
.wiz-kv > div { display: flex; justify-content: space-between; gap: var(--sp-3, .75rem); padding: var(--sp-2, .5rem) 0; border-top: 1px solid var(--line-2, #eee9e0); }
.wiz-kv > div:first-child { border-top: 0; }
.wiz-kv dt { color: var(--ink-3, #5c574f); }
.wiz-kv dd { margin: 0; text-align: right; font-weight: var(--fw-semibold, 600); color: var(--ink-4, #77716a); }
.wiz-kv dd[data-state] { color: var(--ink, #1d1b18); }
.wiz-kv dd[data-state="pass"] { color: var(--c-done, #1b6e3a); }
.wiz-kv dd[data-state="todo"] { color: var(--c-todo, #8a5300); }
.wiz-kv dd[data-state="fix"] { color: var(--c-fix, #b3261e); }
.wiz-privacy ul { margin: 0; padding-left: 1.1rem; font-size: var(--fs-sm, .875rem); color: var(--ink-3, #5c574f); }
.wiz-privacy li + li { margin-top: var(--sp-1, .25rem); }

/* ---- sticky bar on /check: Back · live answer · primary ---- */
.check-page .actbar { gap: var(--sp-3, .75rem); }
.check-page .actbar__back[hidden], .check-page .actbar__btn[hidden], .check-page .actbar__text[hidden] { display: none; }
.check-page .actbar__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-sm, .875rem); line-height: 1.3; }
.check-page .actbar__text span { font-size: var(--fs-xs, .8125rem); color: var(--ink-3, #5c574f); }
.check-page .actbar__btn { margin-left: auto; }

/* ---- sheets on this page (.sheet, .sheet__head, .sheet__body, .sheet__list in app.css) ---- */
.check-page .sheet__body--search { flex: none; padding-bottom: 0; }
.check-page .sheet__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2, .5rem); margin-top: var(--sp-4, 1rem); }
.check-page #sheet-restart .sheet__title { font-size: var(--fs-h4, 1.125rem); }

/* ---- phone: one question per screen ---- */
@media (max-width: 767px) {
  .check-head__back { display: inline-flex; }
  .check-head__brand { display: none; }
  .wiz-prog .progress__label { font-size: var(--fs-xs, .8125rem); }
  .wiz { margin-top: var(--sp-2, .5rem); }
  .wiz .seg--stack, .wiz .seg.seg--stack { grid-auto-flow: row; }
}

/* ---- tablet and up: card form, two-column dates ---- */
@media (min-width: 768px) {
  .wiz { background: var(--bg-raised, #fff); border-radius: var(--r-md, .75rem); box-shadow: var(--ring-card, 0 0 0 1px #e4ded3), var(--shadow-1, none); padding: var(--sp-6, 1.5rem) var(--sp-8, 2rem); }
  .wiz .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiz-aside { display: block; }
}

/* ---- desktop: side panel beside the form ---- */
@media (min-width: 1024px) {
  .wiz-layout { grid-template-columns: minmax(0, 680px) 360px; gap: 80px; justify-content: center; }
  .wiz-aside { position: sticky; top: calc(var(--header-h, 3.5rem) + var(--sp-4, 1rem)); align-self: start; margin-top: 3.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wiz-prog .progress__bar { transition: none; }
  .wiz-load__bar span { animation: none; transform: scaleX(.9); }
}

@media print {
  .check-head__nav, .actbar, .toast-region, .wiz-nav, .wiz-aside { display: none !important; }
}
