/* =========================================================================
   eVisa — shared stylesheet
   Mobile-first, fluid (clamp()) layout. Scales cleanly from a phone through a
   tablet to a wide desktop monitor without a horizontal scrollbar.
   ========================================================================= */

:root {
  /* Light "official government" canvas (the wizard lives here). */
  --canvas: #f4f6fb;
  --surface: #ffffff;
  --ink: #1f2430;
  --ink-soft: #444c5c;
  --muted: #6b7280;
  --line: #e3e6ee;
  --line-strong: #d7dbe1;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-weak: #eef1ff;
  --accent-line: #d6dcff;
  --ok: #16a34a;
  --ok-weak: #e7f6ec;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);

    /* Fluid type scale: small on phones, larger on big monitors. The caps are
       kept deliberately modest so the form reads compact — not "zoomed in" — on
       large desktops: the previous larger caps made the card body loom. */
    --fs-body: clamp(0.9rem, 0.88rem + 0.12vw, 0.95rem);
    --fs-small: clamp(0.72rem, 0.7rem + 0.08vw, 0.8rem);
    --fs-h1: clamp(1.25rem, 1.12rem + 0.6vw, 1.6rem);
    --fs-h2: clamp(1.02rem, 0.98rem + 0.35vw, 1.25rem);

    /* Fluid horizontal gutters (the main mechanism for fitting any screen). The
       caps are trimmed so the card does not spread too wide on big monitors. */
    --gutter: clamp(0.85rem, 2.2vw, 1.75rem);
    --gap: clamp(0.85rem, 1.6vw, 1.15rem);
    --max-w: 1040px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

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

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

/* Base page: a flex column that at least fills the viewport. The light wizard
   overrides this into a DEFINITE-height shell (body.theme-light, height:100svh),
   which is what decouples the card from its content (see that rule + .wizard).
   The dark entry pages keep `min-height` so their short card still sits on a
   full-height canvas. */
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  /* fluid line spacing that tightens slightly on large screens */
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Theme chrome --------------------------------------------------------- */
/* The light "official" wizard canvas is a DEFINITE-height app shell: pinned to
   the viewport (height + an overflow gate) so header/content/footer are laid out
   by flexbox. A definite body height is exactly what lets the card's height:100%
   (below) resolve — and therefore decouple the card's size from the form's
   content. We gate with `overflow:auto` (not `hidden`) so a genuinely tiny
   viewport degrades gracefully: the whole card scrolls instead of being clipped.
   Entry pages keep a centred card on a dark canvas. */
body.theme-light {
  background: var(--canvas);
  color: var(--ink);
    height: 100vh;          /* fallback for browsers without dynamic vh units */
   height: 100svh;          /* small viewport height: excludes a tall address bar */
  overflow: auto;
}

body.theme-dark {
  background: #0f1115;
  color: #e6e8ee;
}
body.theme-dark .site-footer {
  color: #9aa4b2;
}

/* --- Header --------------------------------------------------------------- */
/* position: relative + z-index lifts the header into its own stacking context
   above the wizard scene (z-index: 0), so the pinned landscape layer
   (.wizard-bg, fixed & covering the whole viewport) never paints over the
   emblem / flag bar. Without this the scene — which owns the fixed background —
   would overlay the static header and wash it out. */
.site-header {
  position: relative;
  z-index: 30;
  padding: clamp(0.75rem, 2vw, 1.1rem) var(--gutter);
  border-bottom: 1px solid #d3d6dd;
      /* Government-standard near-white "concrete granite" slab: a very light
      grayish canvas with a faint cool lean — the white/gray tone that
      maximizes text readability, reduces eye strain, and reads as official
      authority. The subtle gradient still gives the bar a stony, dimensional
      finish; the deeper bottom edge + faint shadow read as a raised stone slab.
      The stone-grain.png overlay is tinted to this same light gray tone so the
      texture matches the slab. */
  background: linear-gradient(180deg, #f4f6f9 0%, #e7ebf1 100%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
body.theme-dark .site-header {
  border-color: #262a33;
  background: transparent;
  box-shadow: none;
}

/* Warm-granite mineral grain. It is a seamless, tileable PNG embedded in the
   binary (no CDN, no data-URI-to-parse) layered ABOVE the slab gradient and
   BELOW the header content — so it reads as stone texture, not noise. The whole
   texture's strength is one knob: `opacity` (try 0.10–0.25); the PNG's own alpha
   keeps the tile soft. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("/static/img/stone-grain.png");
  background-repeat: repeat;
  background-size: 128px 128px;
  opacity: 0.15;
}
/* The dark welcome header stays clean — no stone grain over the dark canvas. */
body.theme-dark .site-header::before {
  display: none;
}

.site-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
body.theme-dark .brand {
  color: #e6e8ee;
}

/* The national emblem anchors the left corner of every screen. */
.brand-emblem {
  flex: 0 0 auto;
  height: clamp(3.5rem, 9vw, 7.5rem);
  width: auto;
}

/* The mark + sub stack vertically beside the emblem. */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-mark {
  font-weight: 800;
  font-size: clamp(1.7rem, 1.4rem + 0.9vw, 2.4rem);
  letter-spacing: -0.015em;
  line-height: 1;
}

.brand-sub {
  font-size: var(--fs-small);
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* The leading I / C / A spell out the "ICA" authority acronym; emphasise them
   so the brand reads as ICA. */
.ica-lead {
  font-weight: 800;
  color: var(--ink);
}
body.theme-dark .ica-lead {
  color: #e6e8ee;
}

/* The centred title is an inlined two-line SVG that sits between the emblem
   (left) and the flag (right). Because it is inlined (not an <img>), its
   <text> lines are real document nodes, so app.css styles them directly and
   the fill can follow the page theme — visible on both the light wizard and
   the dark welcome canvas. Auto margins centre it in the leftover space while
   the emblem/flag stay pegged to the corners. */
.site-title {
  flex: 0 0 auto;
  height: clamp(3rem, 5vw, 5.5rem);
  width: auto;
  margin: 0 auto;
  overflow: visible;
}

/* Main line: "Republic of Somaliland". Navy on the light canvas; lifts to a
   light ink on the dark welcome theme so it never disappears. */
.site-title-main {
  font-family: "Georgia", "Times New Roman", "Noto Serif", serif;
  font-size: 72px;
  font-weight: 400;
  letter-spacing: 2.5px;
  fill: var(--ink);
}
body.theme-dark .site-title-main {
  fill: #fff;
}

/* Sub line: "ICA - Immigration & Checkpoints Authority" — kept small and single,
   but heavy-weighted so it holds contrast against the cool header slab. */
.site-title-sub {
  font-family: "Georgia", "Times New Roman", "Noto Serif", serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 2px;
  fill: var(--ink);
}
body.theme-dark .site-title-sub {
  fill: #e6e8ee;
}

/* The "Welcome to Somaliland" map badge anchors the opposite (right) corner.
   It is a wide landscape asset, so it is sized larger than the square emblem
   and capped on small screens to avoid crowding the brand text. */
.brand-flag {
  flex: 0 0 auto;
  height: clamp(4rem, 10vw, 9rem);
  width: auto;
}

@media (max-width: 560px) {
   .brand-flag {
    display: none; /* decorative badge: drop on phones so the header fits */
    }
   .site-title {
    flex: 1 1 auto;   /* let the SVG title shrink into the leftover space */
    min-width: 0;
    width: 100%;
    height: auto;     /* scale height off the viewBox aspect via width */
    }
}

/* --- Content column ------------------------------------------------------- */
/* The middle region fills the space LEFT by the header and footer (body is a
   flex column, min-height 100svh; this grows via flex:1). We deliberately do
   NOT reserve a fixed viewport height here: the page only scrolls when the
   content genuinely overflows, so a tall monitor shows no scroll. The dark
   entry pages use a narrow centred card. The light wizard owns its own width
   (see .wizard below), so the light theme steps the container out of the way:
   no width cap, no side gutter (the wizard provides a single gutter) —
   otherwise the shell is trapped in the 720px column. */
.container {
  display: flex;
  flex-direction: column;
   flex: 1 1 auto;        /* grow to fill the leftover viewport; shrink allowed… */
  min-height: 0;          /* …so this flex child can shrink below its content */
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem) var(--gutter);
}

body.theme-light .container {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* --- Footer --------------------------------------------------------------- */
/* Same fix as .site-header: keep the footer above the pinned landscape
   layer so the fixed background never overlays it. */
.site-footer {
  position: relative;
  z-index: 30;
  padding: clamp(0.9rem, 2vw, 1.25rem) var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
body.theme-dark .site-footer {
  border-color: #262a33;
  background: transparent;
}

.site-footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-note {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: center;
}

/* --- Entry-page card (dark) ---------------------------------------------- */
.card {
  background: #171a21;
  border: 1px solid #262a33;
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.card h1 {
  margin: 0 0 0.75rem;
  font-size: var(--fs-h1);
}

p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.button,
a.button {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  margin-right: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.button:hover,
a.button:hover {
  filter: brightness(1.08);
}

/* =========================================================================
   Wizard — a frosted card floating over a Somaliland landscape
    ========================================================================= */
/* Every step lives in a scene whose pinned landscape layer (.wizard-bg) sits
    behind the card, so the forms appear to hover over the vista. The scene uses
    a new stacking context so the fixed layer stays behind the header/footer. */
.wizard-scene {
  position: relative;
  z-index: 0;
      /* This is the spine of the height chain. It fills the viewport space left
      by the header/footer (body is a 100svh flex column, .container flexes to
      fill it), and it lays the card out as a COLUMN flex item: `flex:1` on the
      card therefore means "fill this exact height" — a definite, content-
      INDEPENDENT size — which is what decouples the card from the form. */
    flex: 1 1 auto;
    min-height: 0;             /* let this flex child shrink below its content */
   display: flex;
   flex-direction: column;     /* card height is a main-axis (reliable) distribution */
    align-items: center;       /* centre the (max-width-capped) card horizontally */
    justify-content: center;   /* vertical centre: on a tall screen the surplus space
       splits above and below the card instead of all pooling beneath it, so a
       short step no longer reads as a giant empty, "zoomed-in" panel */
    padding: clamp(1rem, 2vw, 1.5rem);
}

/* A fixed landscape revealed through the card's translucent fill. The veil
   keeps the form legible; the solid fallback keeps the card opaque on browsers
   without backdrop-filter. */
.wizard-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
     linear-gradient(
       to bottom,
       rgba(244, 246, 251, 0.40),
       rgba(244, 246, 251, 0.28) 42%,
       rgba(226, 231, 240, 0.44)
         ),
     url("/static/img/forms-background.webp") center 38% / cover no-repeat,
       #f4f6fb;
}

/* The card: a frosted, translucent panel that lets the scene show through. Its
   height DECOUPLES from the form's content: it stretches to fill the scene, and
   the scene fills exactly the viewport space left by the header/footer — so the
   card is the same size on every step and on every device, and a step with many
   fields scrolls *inside* the body region instead of pushing the page taller.
   Three flex regions keep the tracker (head) and Next/Back (footer) pinned. */
   .wizard {
    position: relative;
   z-index: 1;
    max-width: var(--max-w);
     width: 100%;
      /* Fill the scene's height. This is a COLUMN-flex main-axis distribution, so
      `flex:1` reliably stretches the card to the scene's exact (content-
     INDEPENDENT) height — step 1 and a long step 3 present the SAME card size,
     and the extra fields scroll inside .wizard-body below. */
     flex: 1 1 auto;
     min-height: 0;                /* let the card shrink below its content */
      /* Cap the fill so a short step on a TALL monitor (e.g. 32") does not
        balloon into a giant empty panel. min(… , 760px) imposes a hard absolute
        ceiling that a plain svh cap can't guarantee: on a 1440px-tall viewport a
        86svh ceiling (1238px) would still exceed the ~1200px scene and the card
        would fill it anyway. With the scene's justify-content:center the surplus
        splits above AND below the cap, so a short step no longer pools all its
        empty space beneath the form. A long form still scrolls inside
        .wizard-body, and because the cap binds identically to every step the
        "same card height on every step" invariant is preserved. */
      max-height: min(88svh, 760px);
     padding: clamp(0.85rem, 2vw, 1.35rem) var(--gutter);
     display: flex;
     flex-direction: column;
   background: rgba(255, 255, 255, 0.84);
   -webkit-backdrop-filter: blur(10px) saturate(1.25);
   backdrop-filter: blur(10px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow:
   0 1px 2px rgba(16, 24, 40, 0.06),
   0 24px 60px rgba(16, 24, 40, 0.16);
}

/* Fixed head: the step tracker + info banner. It keeps its natural height and
   never scrolls, so you always see which step you are on and the advisory. */
.wizard-head {
  flex: 0 0 auto;
}

/* Scrollable body: the only region that grows/shrinks. It absorbs any overflow
   from a long form so the card's outer height stays fixed. */
.wizard-body {
  flex: 1 1 auto;
  min-height: 0;         /* critical: lets a flex child shrink below its content */
  overflow-y: auto;
  overflow-x: hidden;
  margin: calc(var(--gap) * 0.5) 0;
   /* Subtle inset scroll gutter so long forms read as "scroll inside the panel",
   not "the whole page is scrolling". */
  scrollbar-gutter: stable;
}
/* The fixed footer (.wizard-nav) is styled in the Navigation section below. */

/* No backdrop-filter (older / unsupported): fall back to an opaque card so the
   form stays fully readable without the landscape bleeding through. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
   .wizard-bg {
    background: #f4f6fb;
   }
   .wizard {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow);
   }
}

/* --- Step tracker (top horizontal) ---------------------------------------- */
/* A horizontal progress tracker that sits ABOVE the form panel. Faint connector
   rails run through the row; a numbered circle marks each step and reads as:
   filled blue for the active step, a green tick for completed steps, and a light
   grey ring for the ones still to come, with a short label beneath each circle.
   It is a plain flex row so it needs no sticky sidebar and works at any width. */
.steps {
  border: 0;
  background: transparent;
  border-radius: 0;
}

.steps-list {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-item {
  position: relative;
  flex: 1 1 0;          /* even columns: 6 steps spread across the full width */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* One connector rail from this circle's centre to the next circle's centre,
   sitting BEHIND the circles (z-index 0 vs the circles' 1). */
.step-item::after {
  content: "";
  position: absolute;
  top: 1.1rem;          /* vertical centre of the 2.2rem circle */
  left: 50%;
  width: 100%;          /* reaches the next item's centre (items are equal width) */
  height: 2px;
  background: var(--line-strong);
  z-index: 0;
}
.step-item:last-child::after {
  display: none;        /* no rail past the final circle */
}
/* A connector trailing a FINISHED step reads as "traversed", so it turns blue. */
.step-item.state-complete::after {
  background: var(--accent);
}

.step-link {
  position: relative;
  z-index: 1;           /* the circle sits above its connector rail */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: var(--fs-small);
  font-weight: 600;
  transition: color 0.12s ease;
}

/* The numbered / ticked marker that sits over each connector rail. */
.step-dot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--line-strong);
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.step-num,
.step-check {
  line-height: 1;
}

/* Active step: filled blue circle, blue label. */
.step-item.state-active .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-weak);
}
.step-item.state-active .step-link {
  color: var(--accent);
}

/* Completed step: green tick, traversed (blue) connector, ink label. */
.step-item.state-complete .step-dot {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}
.step-item.state-complete .step-link {
  color: var(--ink);
}

.step-label {
  max-width: 8rem;
}
.step-link-disabled {
  cursor: default;
  opacity: 0.55;
}

/* On a narrow phone the 6 labels crowd, so drop them and keep the clean
   circle + rail row; the active/blue marker still shows where you are. */
@media (max-width: 560px) {
  .step-label {
    display: none;
  }
  .step-dot {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.85rem;
  }
  .step-item::after {
    top: 0.95rem;
  }
}


/* --- Main column --------------------------------------------------------- */
.wizard-main {
  min-width: 0; /* lets the flex child shrink instead of overflowing */
}

.panel-title {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

.panel-lead {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: var(--fs-body);
}

/* --- Resume saved banner --------------------------------------------------- */
.resume-banner {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.85rem 1.1rem;
  background: #f0f4fe;
  border: 1px solid #bacef6;
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: #051a4a;
}
.resume-banner-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 0.05rem;
}
.resume-banner-body { flex: 1; }
.resume-banner-text { margin: 0; color: #051a4a; }
.resume-token {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.5;
  color: #ffffff;
  background: #051a4a;
  border: 1px solid #051a4a;
  border-radius: 4px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.12s ease;
}
.resume-token:hover,
.resume-token:focus-visible {
  background: #0d2b6b;
  border-color: #0d2b6b;
  outline: none;
}
.resume-token.is-copied {
  background: #1d7a44;
  border-color: #1d7a44;
}
.resume-token.is-error {
  background: #b3261e;
  border-color: #b3261e;
}

/* --- Panels & fields ----------------------------------------------------- */
.wizard-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: clamp(0.85rem, 2vw, 1.25rem);
}

.field {
  margin-bottom: 0.85rem;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink);
}

.req {
  color: var(--danger);
  margin-left: 0.15rem;
}

.control {
  width: 100%;
  min-width: 0; /* prevents form controls from forcing an overflow */
  padding: 0.55rem 0.7rem;
  font-size: var(--fs-body);
  font-family: inherit;
  color: var(--ink);
  background: #f7f8fa;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.control:hover {
  border-color: #c2c8d4;
}

.control:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.16);
  background: #ffffff;
}

/* Two-up field grid. Stacks on phones, side-by-side on tablets/monitors. */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
  }
}

/* Field hint / helper text under a control. */
.field-hint {
  margin: 0.4rem 0 0;
  font-size: var(--fs-small);
  color: var(--muted);
}

/* Date input: Safari's native calendar icon is invisible by default. We add a
   visible SVG icon via the ::-webkit-calendar-picker-indicator pseudo-element.
   Firefox ignores this pseudo-element and shows its own native icon — no double
   icons. */
input[type="date"].control {
  appearance: auto;
  -webkit-appearance: auto;
  padding-right: 2.25rem;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  opacity: 0.7;
  cursor: pointer;
}

/* Validation error state */
.control-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
  background: #fef2f2 !important;
}
.field-error {
  margin: 0.4rem 0 0;
  font-size: var(--fs-small);
  color: var(--danger);
  font-weight: 600;
}

/* Select affordance (native <select>) */
.field-select {
  position: relative;
}
.field-select .control {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

/* Section sub-heading used to group fields within a screen. */
.section-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  margin: 1.75rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.section-title-center {
  text-align: center;
}

/* Radio + checkbox groups */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.35rem;
}
.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  background: #ffffff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}
.radio:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}
.radio:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.16);
}
.radio:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-weak);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.radio input {
  margin: 0;
  accent-color: var(--accent);
}

/* Info "i" tooltip */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  vertical-align: middle;
  cursor: help;
}
.info-tip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.15);
  transition: transform 0.12s ease, background 0.12s ease;
}
.info-tip:hover .info-tip-mark,
.info-tip:focus-visible .info-tip-mark {
  background: #163aa5;
  transform: scale(1.08);
}
.info-tip-bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 0.6rem;
  bottom: calc(100% + 0.6rem);
  z-index: 60;
  width: 15rem;
  max-width: 60vw;
  padding: 0.7rem 0.85rem;
  background: #101828;
  color: #ffffff;
  font-size: var(--fs-small);
  font-weight: 500;
  font-style: normal;
  line-height: 1.5;
  text-align: left;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.28);
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
.info-tip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0.9rem;
  border-width: 0.4rem;
  border-style: solid;
  border-color: #101828 transparent transparent transparent;
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus-visible .info-tip-bubble {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 1.5rem;
  font-size: var(--fs-body);
  color: var(--ink-soft);
}
.checkbox input {
  margin-top: 0.15rem;
}
.field-link {
  color: var(--accent);
  text-underline-offset: 2px;
}

/* Fee callout (step 1). */
.fee-callout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--ok-weak);
  border: 1px solid #cde8d6;
  border-radius: var(--radius-sm);
}
.fee-callout-label {
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2e7d32;
}
.fee-callout-amount {
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 800;
  color: #2e7d32;
}

/* --- Visa-saved confirmation (step 1) ------------------------------------ */
/* A compact success banner shown above the form once a guest's visa choice is
   persisted. It echoes the fee-callout's success tone so the two read as one
   panel, and is announced to assistive tech via the role="status" on the
   element. */
.visa-saved {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  background: var(--ok-weak);
  border: 1px solid #cde8d6;
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  line-height: 1.4;
  color: #1b5e20;
}
.visa-saved-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #cde8d6;
  color: #2e7d32;
  font-weight: 700;
}
.visa-saved strong {
  font-weight: 700;
}

/* --- File upload (step 5) ------------------------------------------------ */
.file-upload {
  margin-bottom: 1.5rem;
}
.file-label {
  display: block;
  padding: 0.55rem 0.9rem;
  font-size: var(--fs-body);
  font-weight: 700;
  color: #ffffff;
  background: #051a4a;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}
.file-label .req {
  color: #ffb3a8;
}
.file-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f7f8fa;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.file-control:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}
/* Hide the native control; the styled <label> activates its click. */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-trigger {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--accent);
}
.file-name {
  font-size: var(--fs-small);
  color: var(--muted);
}
.file-hint {
  margin: 0.45rem 0 0;
  font-size: var(--fs-small);
  color: var(--muted);
}
.file-preview-wrap {
  display: none;
  position: relative;
  margin: 0.75rem 0 0;
  max-width: 240px;
}
.file-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.7rem;
  height: 1.7rem;
  border: none;
  border-radius: 50%;
  background: rgba(15, 17, 26, 0.72);
  color: #ffffff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease;
}
.file-remove:hover {
  background: #b3261e;
}
.file-preview {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}
.file-preview:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-weak);
}
.file-current {
  position: relative;
  margin-bottom: 1rem;
  max-width: 240px;
}
.file-current-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.file-current .file-hint {
  margin: 0.45rem 0 0;
}
.attachments-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 820px) {
  .attachments-grid {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}
.doc-specs {
  background: #f3f2f1;
  border-left: 4px solid var(--accent);
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
}
.doc-specs-title {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.7rem;
  font-size: var(--fs-body);
  font-weight: 700;
  color: #ffffff;
  background: #051a4a;
  border-radius: var(--radius-sm);
}
.doc-specs-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}
.doc-specs-list li {
  margin-bottom: 0.4rem;
}
.file-form {
  margin-top: 0.5rem;
}
.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.upload-error {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fdecec;
  border: 1px solid #f5c8c8;
  border-radius: var(--radius-sm);
  color: #b3261e;
  font-size: var(--fs-small);
  line-height: 1.5;
}

/* --- Review attestation (step 6) ---------------------------------------- */
.review-attest {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7f8fa;
}
.review-attest .checkbox {
  margin-top: 0;
}

/* --- Attachments --------------------------------------------------------- */
.note-list {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.25rem;
}
.photo-tips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 560px) {
  .photo-tips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid #cde3f2;
    border-radius: var(--radius-sm);
    background: #eaf5fb;
    padding: 0.5rem;
  }
}
.tip-cell {
  position: relative;
  padding: 0.75rem;
  border: 1px solid #b8d6ea;
  border-radius: 8px;
}
.tip-title {
  font-weight: 700;
  display: block;
}
.tip-mark {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.tip-ok {
  color: var(--ok);
}
.tip-no {
  color: var(--danger);
}
.tip-caption {
  font-size: var(--fs-small);
  color: var(--ink-soft);
}
.uploads {
  max-width: 420px;
  margin: 0 auto;
}
.upload-row {
  margin-bottom: 1rem;
  text-align: center;
}
.upload-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.upload-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.upload-browse {
  background: #e8eaef;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: var(--fs-body);
}
.upload-file {
  font-size: var(--fs-small);
  color: var(--muted);
}

/* --- Review / confirmation ---------------------------------------------- */
.review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 820px) {
  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.review-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.summary-title {
  margin: 0;
  padding: 0.9rem 1.25rem;
  font-size: var(--fs-body);
  font-weight: 700;
  background: #051a4a;
  color: #ffffff;
  border-bottom: 1px solid #051a4a;
}
.summary-body {
  padding: 1.25rem;
  display: grid;
  gap: 0.9rem;
}
.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: var(--fs-body);
}
.summary-label {
  font-weight: 700;
  color: var(--ink);
  flex: 1 1 auto;
}
.summary-value {
  color: var(--ink-soft);
  text-align: right;
}

/* --- Navigation ---------------------------------------------------------- */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: var(--gap);
}
/* The primary (Next / Submit) button always sits in the footer's far-right
   corner. margin-left:auto absorbs the free space, so a lone Next on step 1 or
   lone Submit on the last step stays right even without a "previous" on the left. */
.wizard-nav .btn-primary {
  margin-left: auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.65rem 1.5rem;
  font-size: var(--fs-body);
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.12s ease, background 0.12s ease;
}
.btn-outline {
  background: #ffffff;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-weak);
}
.btn-verify {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 1px 3px rgba(21, 128, 61, 0.35);
}
.btn-verify:hover {
  filter: brightness(1.08);
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  filter: brightness(1.08);
}

/* =========================================================================
   Welcome hero (landing page "/") — rotating Somaliland travel gallery
   Pure CSS crossfade + gentle Ken-Burns zoom: no JS, so no CSP risk, and it
   honours prefers-reduced-motion (see the override below).
   ========================================================================= */
.hero {
  position: relative;
  width: 100%;
  /* Fill the space the container (which fills the viewport left by the
     header/footer) hands down — no fixed 100svh reservation, so the landing
     page never forces a scroll on a tall screen. Grows past content only when
     the content itself overflows. */
  flex: 1 0 auto;
  display: flex;
  overflow: hidden;
  background: #0b1020; /* fallback while the first image loads */
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  z-index: 0;
  /* crossfade each of the 5 slides in sequence */
  animation: heroFade 30s linear infinite;
}
.hero-slide:nth-child(1) {
  animation-delay: 0s;
}
.hero-slide:nth-child(2) {
  animation-delay: 6s;
}
.hero-slide:nth-child(3) {
  animation-delay: 12s;
}
.hero-slide:nth-child(4) {
  animation-delay: 18s;
}
.hero-slide:nth-child(5) {
  animation-delay: 24s;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* slow zoom so each frame feels alive; runs only while the slide is visible */
  animation: heroZoom 30s linear infinite;
}

@keyframes heroFade {
   0%   { opacity: 0; }
   4%   { opacity: 1; }
   20%  { opacity: 1; }
   24%  { opacity: 0; }
   100% { opacity: 0; }
}

@keyframes heroZoom {
   0%   { transform: scale(1.02); }
   24%  { transform: scale(1.12); }
   100% { transform: scale(1.02); }
}

/* Legibility scrim + content, sitting above the rotating images. */
.hero-overlay {
  position: relative;
  z-index: 1;
  /* Fill the hero (which fills the leftover viewport) so the copy stays
     centred without its own 100svh reservation causing a scroll. */
  flex: 1 0 auto;
  width: 100%;             /* never let rem-sized children widen it past the viewport */
  min-width: 0;
  display: flex;
  flex-direction: column;   /* stack copy + (optional) resume form vertically */
  justify-content: center;  /* centre the copy vertically */
  align-items: flex-start;  /* keep the copy left-aligned (as before) */
  padding: clamp(6rem, 12vh, 9rem) var(--gutter);
  background:
    linear-gradient(
      to bottom,
      rgba(6, 12, 28, 0.30) 0%,
      rgba(6, 12, 28, 0.45) 45%,
      rgba(6, 12, 28, 0.72) 100%
    );
  color: #ffffff;
}

/* The resume form is taller than a phone viewport: let the page grow and
   scroll naturally so the footer flows BELOW the form, instead of leaving the
   height-locked body with its footer painted over the overflowing hero. */
body.theme-light:has(.hero--resume) {
  height: auto;
}
.hero--resume .hero-overlay {
  justify-content: flex-start;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.hero-inner {
  max-width: min(46rem, 100%);
}

.hero-eyebrow {
  margin: 0 0 0.75rem;
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bcd2ff;
}

.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.4rem + 3vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.hero-lead {
  margin: 0 0 2rem;
  max-width: min(34rem, 100%);
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.3rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn-lg {
  min-height: 3rem;
  padding: 0.9rem 1.9rem;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* One dot per slide, advancing with the active frame. */
.hero-dots {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  display: flex;
  gap: 0.5rem;
}
.hero-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  animation: heroDot 30s linear infinite;
}
.hero-dot:nth-child(1) {
  animation-delay: 0s;
}
.hero-dot:nth-child(2) {
  animation-delay: 6s;
}
.hero-dot:nth-child(3) {
  animation-delay: 12s;
}
.hero-dot:nth-child(4) {
  animation-delay: 18s;
}
.hero-dot:nth-child(5) {
  animation-delay: 24s;
}
@keyframes heroDot {
   0%   { background: rgba(255, 255, 255, 0.45); transform: scale(1); }
   4%   { background: #ffffff; transform: scale(1.35); }
   20%  { background: #ffffff; transform: scale(1.35); }
   24%  { background: rgba(255, 255, 255, 0.45); transform: scale(1); }
   100% { background: rgba(255, 255, 255, 0.45); transform: scale(1); }
}

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
   * {
    transition: none !important;
    scroll-behavior: auto !important;
   }
   /* Stop the rotation but keep the gallery visible instead of all-black. */
   .hero-slide,
   .hero-img,
   .hero-dot {
    animation: none !important;
   }
   .hero-slide {
    opacity: 0;
   }
   .hero-slide:first-child {
    opacity: 1;
   }
}

/* Resume form panel (landing page) */
.resume-panel {
  margin: 1.5rem auto 0;
  max-width: min(42rem, 100%);
  width: 100%;
  padding: 1.1rem 1.3rem;
  background: rgba(16, 24, 40, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(6, 12, 28, 0.35);
  color: #ffffff;
}
.resume-panel-close {
  float: right;
  background: transparent;
  border: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  margin: -0.25rem -0.25rem 0 0;
}
.resume-panel-close:hover { color: #ffffff; }
.resume-panel-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.15rem);
  font-weight: 700;
  color: #ffffff;
}
.resume-panel-note {
  margin: 0 0 0.9rem;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}
.resume-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 720px) {
  .resume-fields {
    grid-template-columns: 1fr 1fr auto;
  }
}
.resume-panel .control {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.6);
}
.resume-panel .btn-primary {
  white-space: nowrap;
}
.resume-error {
  margin: 0.6rem 0 0;
}

/* --- Submission complete confirmation ------------------------------------ */
.confirm-scene {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter);
}
.confirm-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
}
.confirm-card h1 {
  margin: 0 0 0.75rem;
  font-size: var(--fs-h1);
  color: var(--ink);
}
.confirm-card p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}
.complete-reference {
  margin: 1.25rem 0;
  text-align: center;
}
.complete-reference-label {
  display: block;
  font-size: var(--fs-small);
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}
.complete-reference-value {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
  background: #051a4a;
  border-radius: 6px;
}
.complete-note {
  margin: 0;
  color: var(--ink-soft);
}
.complete-actions {
  margin-top: 1.25rem;
}

/* --- Zoom / crop modal --------------------------------------------------- */
body.no-scroll {
  overflow: hidden;
}
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.crop-modal.is-open {
  display: flex;
}
.crop-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 26, 0.6);
}
.crop-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 720px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.crop-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.crop-modal-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.crop-modal-body {
  position: relative;
  height: 50vh;
  background: #14161c;
  overflow: hidden;
}
.crop-modal-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}
.crop-modal-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line);
}
.crop-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
  cursor: pointer;
}
.crop-zoom {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.crop-zoom-btn {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--line-strong);
  background: #f7f8fa;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.crop-zoom input[type="range"] {
  width: 8rem;
}
.crop-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}

/* --- Cropper overrides ---------------------------------------------------- */
/* Make the crop boundary line thicker and more opaque than Cropper's faint
   1px 75%-opacity cyan default, using the app accent for contrast. */
.cropper-view-box {
  outline: 3px solid var(--accent);
  outline-color: var(--accent);
}
.cropper-face {
  outline: 1px solid rgba(255, 255, 255, 0.9);
}

/* --- Step 5a passport verification --------------------------------------- */
/* "Verify" control, status line and bio-data summary table. The panel is
   hidden by default and revealed by JS once a fresh image has been cropped. */
.file-verify {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.file-verify-left {
  flex: 0 0 auto;
  max-width: 260px;
}
.file-verify-right {
  flex: 1 1 260px;
  min-width: 0;
  margin-top: 3rem;
}
.passport-verify {
  display: none;
  margin-top: 0;
}
.passport-verify.is-open {
  display: block;
}
.verify-status {
  min-height: 1.2rem;
  margin: 0 0 0.5rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}
.verify-status.busy {
  color: var(--accent);
}
.verify-status .busy-dots {
  display: inline-block;
  letter-spacing: 1px;
}
.verify-status .busy-dots i {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  animation: busy-dot 0.6s ease-in-out infinite;
}
.verify-status .busy-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.verify-status .busy-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes busy-dot {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(-4px); opacity: 1; }
}
.verify-status.success {
  color: #15803d;
  font-weight: 600;
}
.verify-status.warn {
  color: #b45309;
  font-weight: 600;
}
.verify-status.error {
  color: var(--danger);
}
.verify-summary {
  display: none;
  width: 100%;
  max-width: 30rem;
  margin-top: 1.25rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-small);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 17, 26, 0.08);
}
.verify-summary.is-open {
  display: table;
}
.verify-summary thead th {
  padding: 0.5rem 0.7rem;
  text-align: left;
  background: #15803d;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.verify-summary tbody th,
.verify-summary tbody td {
  padding: 0.45rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.verify-summary tbody tr:last-child th,
.verify-summary tbody tr:last-child td {
  border-bottom: 0;
}
.verify-summary tbody th {
  width: 42%;
  font-weight: 600;
  color: #051a4a;
  white-space: nowrap;
  background: #f7f8fa;
}
.verify-summary tbody tr.mismatch td {
  background: #fff7ed;
}
.verify-summary tbody tr.mismatch .mismatch-note {
  display: block;
  margin-top: 0.2rem;
  color: #b45309;
  font-weight: 600;
  font-size: 0.85em;
}
.verify-summary tbody tr.pf-pass td {
  color: #15803d;
}
.verify-summary tbody tr.pf-fail td {
  color: #dc2626;
}
.verify-summary tbody tr.pf-warn td {
  color: #b45309;
  background: #fff7ed;
}
.verify-summary tbody tr.pf-skip td {
  color: #9aa1ad;
}
.verify-debug {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f6f7fb;
  padding: 0.5rem 0.6rem;
  font-size: var(--fs-small);
}
.verify-debug summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
}
.verify-debug pre {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--ink);
}
/* Disabled pinned Next button while 5a awaits verification. */
.next-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
