/**
 * Quote funnel v2 — G1 conversion build (2026-06-10).
 * Loaded ONLY by page-quote.php (enqueued there, like the page's other assets).
 * Raw CSS so it never depends on a Tailwind build (same contract as the
 * inline <style> block in page-quote.php).
 */

/* ── Q2: inline validation messages (plain language, under the field) ───── */
.sacraw-field-error {
    font-family: var(--font-body);
    font-size: 0.75rem;
    line-height: 1.45;
    color: #b91c1c;
    margin-top: 0.375rem;
    text-align: left;
}
.sacraw-field-notice {
    font-family: var(--font-body);
    font-size: 0.75rem;
    line-height: 1.5;
    color: #78350f;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 0.5rem;
    text-align: left;
}
.sacraw-field-notice button { color: inherit; }

/* ── Q1: step-4 visitor panel — price card first once eligibility is attested.
   DOM order stays question-first (the gate) for the unanswered state; once
   attested the price renders directly under the step heading, the coverage
   selectors follow, and the attestation cards drop below. ──────────────── */
.sacraw-visitor-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.sacraw-visitor-panel.is-attested .sacraw-vp-price     { order: -3; }
.sacraw-visitor-panel.is-attested .sacraw-vp-selectors { order: -2; }

/* Directive 5: once answered, the insurer-required eligibility wording stays
   VERBATIM but is visually subordinate below the price. */
.sacraw-visitor-panel.is-attested .sacraw-vp-elig,
.sacraw-visitor-panel.is-attested .sacraw-vp-med {
    border-width: 1px;
    background: var(--color-surface-alt, #F7F5F1);
    padding: 0.85rem 1rem;
}
.sacraw-visitor-panel.is-attested .sacraw-vp-elig h3,
.sacraw-visitor-panel.is-attested .sacraw-vp-med h3 {
    font-size: 0.8125rem;
}
.sacraw-visitor-panel.is-attested .sacraw-elig-legal {
    font-size: 0.71875rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

/* ── F2/Q1: sticky-bar mobile Email Quote icon button (44px tap target) ── */
.sacraw-sticky-iconbtn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    background: #fff;
    color: var(--color-text-muted);
}

/* ── Directive 5: the chat launcher never sits beside the raw card fields.
   page-quote.php toggles body.sf-quote-pay-step on step 7. ─────────────── */
body.sf-quote-pay-step .sacraw-chat { display: none !important; }

/* ── Mockup defect (a) fix, 2026-06-10: the new G1 quote markup (sticky bar,
   price sheet, exit-intent modal) uses Tailwind utilities that are ABSENT from
   the compiled assets/css/style.css (no Tailwind rebuild was run). Without
   them the desktop sticky bar duplicated the mobile price + envelope buttons.
   Exact standard definitions, byte-matched to the mockup harness shim
   (_harness/bootstrap.php #sf-harness-missing-utilities-shim) so deploy
   behavior equals the mockups. The header-phone trio (whitespace-nowrap,
   text-[12px], leading-none) lives in sacraw-brand.css (global). ────────── */
.min-w-0{min-width:0}
.mr-1{margin-right:.25rem}
.h-1{height:.25rem}
.leading-snug{line-height:1.375}
.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}
@media (min-width:640px){.sm\:hidden{display:none}}

/* ── Mockup defect (b) fix, 2026-06-10 (MOCKUP-NOTES caveat 7): the chat FAB
   stacked ABOVE the open mobile price-breakdown sheet (sheet overlay is z-50;
   the chat root sits higher) and overlapped the Total row — visible in 01b.
   page-quote.php toggles body.sf-quote-sheet-open while showPriceSheet is
   true, mirroring the sf-quote-pay-step mechanism above. ────────────────── */
body.sf-quote-sheet-open .sacraw-chat { display: none !important; }

/* ── Labelled milestone stepper (quote funnel, 2026-06-30) ────────────────
   Desktop (>=640px, non-gate) replaces the thin fill bar with a 7-node
   labelled stepper reactive to Alpine `step`; mobile + the Step-0 gate keep
   the compact fill bar (.sacraw-stepper-compact). RAW CSS ONLY — no Tailwind
   utilities — so it never depends on a Tailwind rebuild (same contract as the
   defect-(a) shim above; skeptic R5). Labels/order/count are sourced from the
   LIVE 7-step flow (quote-flow.js _stepNames), not any mockup (skeptic R1). ─ */
.sacraw-stepper         { display: none; }   /* mobile: hidden — compact bar shows */
.sacraw-stepper-compact { display: block; }  /* mobile: compact bar shows */

@media (min-width: 640px) {
    .sacraw-stepper {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    .sacraw-stepper.sacraw-stepper--gate { display: none; }              /* gate: hide labels (never label the audience gate) */
    .sacraw-stepper-compact { display: none; }                          /* desktop: hide bar — stepper shows */
    .sacraw-stepper-compact.sacraw-stepper-compact--gate { display: block; }  /* gate: show compact bar instead */
}

.sacraw-stepper__item {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* Connector line at a FIXED vertical offset (= dot centre) so a wrapped label
   can never shift the dot row out of alignment (skeptic R7). The segment
   leading INTO a reached node fills brand; upcoming stays border-grey. */
.sacraw-stepper__item::before {
    content: "";
    position: absolute;
    top: 6px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--color-border, #e2e8f0);
    z-index: 0;
}
.sacraw-stepper__item:first-child::before { display: none; }
.sacraw-stepper__item.is-done::before,
.sacraw-stepper__item.is-current::before { background: var(--color-primary, #003399); }

.sacraw-stepper__marker {
    position: relative;
    z-index: 1;
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    background: #fff;
    border: 2px solid var(--color-border, #e2e8f0);
    box-sizing: border-box;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.sacraw-stepper__item.is-done .sacraw-stepper__marker {
    background: var(--color-primary, #003399);
    border-color: var(--color-primary, #003399);
}
.sacraw-stepper__item.is-done .sacraw-stepper__marker::after {   /* checkmark */
    content: "";
    position: absolute;
    left: 4px;
    top: 1.5px;
    width: 3px;
    height: 6px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.sacraw-stepper__item.is-current .sacraw-stepper__marker {
    background: var(--color-primary, #003399);
    border-color: var(--color-primary, #003399);
    box-shadow: 0 0 0 4px var(--color-primary-light, #e6ecf7);
}
.sacraw-stepper__label {
    margin-top: 6px;
    font-family: var(--font-body, 'Open Sans', system-ui, sans-serif);
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: center;
    color: var(--color-text-muted, #64748b);
    transition: color .3s ease;
    white-space: nowrap;
}
.sacraw-stepper__item.is-done .sacraw-stepper__label,
.sacraw-stepper__item.is-current .sacraw-stepper__label {
    color: var(--color-text, #0f172a);
    font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
    .sacraw-stepper__marker { transition: none; }
}

/* ── CFAR card utility fallbacks (2026-07) ──────────────────────────────────
   The step-5 CFAR card's disabled state uses two utilities not guaranteed in
   the compiled assets/css/style.css (never rebuilt on deploy — the defect-(a)
   contract). Byte-equivalent to Tailwind's own output; harmless duplicates if
   a future rebuild adds them. */
.opacity-60 { opacity: 0.6; }
.cursor-not-allowed { cursor: not-allowed; }

/* ── W1-5 (2026-07-09): focused checkout ────────────────────────────────────
   body.sf-quote-checkout is toggled by page-quote.php's x-effect on steps ≥4
   (pre-purchase-success). Header reduces to logo + trust line, the advisory
   ribbon hides (header top offset reset below), and the footer nav grid
   collapses; compliance badges, underwriter attribution and the legal bottom
   bar remain. This stylesheet is page-scoped to /quote/, so nothing leaks. */
body.sf-quote-checkout .sf-desktop-nav,
body.sf-quote-checkout .sf-mobile-nav,
body.sf-quote-checkout .sacraw-advisory-ribbon,
body.sf-quote-checkout .sf-footer-nav { display: none !important; }
body.sf-quote-checkout .glass-header { top: 0 !important; }
.sf-checkout-trustline { display: none; }
body.sf-quote-checkout .sf-checkout-trustline {
    display: inline-flex !important; /* beats the element's inline display:none default */
    align-items: center;
    gap: .45rem;
    font-family: var(--font-body, 'Open Sans', system-ui, sans-serif);
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-muted, #475569);
    white-space: nowrap;
}
body.sf-quote-checkout .sf-checkout-trustline svg { color: #047857; }
@media (max-width: 480px) {
    body.sf-quote-checkout .sf-checkout-trustline .sf-ctl-optional,
    body.sf-quote-checkout .sf-checkout-trustline .sf-ctl-sep { display: none; }
}

/* ── W3-5 (2026-07-09): deductible-as-discount lever (step 4, inbound) ────── */
.sf-ded-chips {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}
@media (min-width: 640px) {
    .sf-ded-chips { grid-template-columns: repeat(3, 1fr); }
}
.sf-ded-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    border: 2px solid var(--color-border, #e5e7eb);
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.65rem 0.8rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sf-ded-chip:hover { border-color: var(--color-primary, #003399); }
.sf-ded-chip.is-current {
    border-color: var(--color-primary, #003399);
    background: var(--color-primary-light, #eef2ff);
    cursor: default;
}
.sf-ded-chip__ded {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #6b7280);
}
.sf-ded-chip__price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text, #1f2937);
}
.sf-ded-chip__save {
    font-size: 0.72rem;
    font-weight: 700;
    color: #047857;
}
.sf-ded-chip__badge {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary, #003399);
}

/* ── W3-2 (2026-07-09): Japanese assist layer (?lang=ja only — classes are
      injected by assets/js/quote-ja.js and never appear otherwise) ────────── */
.sf-ja-sub {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 500;
    color: var(--color-text-muted, #6b7280);
    margin-left: 0.35em;
}
.sf-ja-sub--block {
    display: block;
    margin-left: 0;
    margin-top: 0.15rem;
    font-size: 0.8rem;
}
.sacraw-stepper__item .sf-ja-sub--block { font-size: 0.62rem; line-height: 1.2; }
button .sf-ja-sub { color: inherit; opacity: 0.85; font-weight: 600; }
.sf-ja-banner {
    max-width: 42rem;
    margin: 0 auto 1.25rem;
    padding: 0.8rem 1.1rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    background: #eff6ff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--color-text, #1f2937);
}
.sf-ja-banner p { margin: 0 0 0.35rem; }
.sf-ja-banner a {
    color: var(--color-primary, #003399);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-style: dotted;
}
/* keep the CURRENT badge clear of the label text */
.sf-ded-chip.is-current .sf-ded-chip__ded { padding-right: 3.6rem; }

/* L20 (2026-10-31): the single-plan card (visitors, students) uses Tailwind utilities that are NOT in the
   compiled sheet — w-3/h-3 on the tick icon, gap-2.5, space-y-2.5, mt-5 — so the ticks rendered as empty
   green dots and "Get Covered" sat on the last line. Scoped to that card. Plus the gate's 5th card. */
.sacraw-vp-price .w-3 { width: .75rem; }
.sacraw-vp-price .h-3 { height: .75rem; }
.sacraw-vp-price .gap-2\.5 { gap: .625rem; }
.sacraw-vp-price .space-y-2\.5 > :not(:last-child) { margin-bottom: .625rem; }
.sacraw-vp-price .mt-5 { margin-top: 1.25rem; }
@media (min-width: 40rem) { .sacraw-aud-gate .sm\:col-span-2 { grid-column: span 2 / span 2; } }
/* L20: the dates field's calendar icon sat UNDER flatpickr's positioned wrapper (white input painted over it),
   leaving an empty indent; pointer-events-none is also missing from the compiled sheet. Every quote lane. */
.relative:has(> .flatpickr-wrapper) > svg.absolute { z-index: 2; pointer-events: none; }
/* L20: the purchase-complete tiles (policy number / total charged) used px-6, which is not in the compiled
   sheet — at 390 px the figures ran edge to edge. Every lane's success screen. */
.text-center.py-20 > .inline-block.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
@media (max-width: 639px) { .text-center.py-20 > .inline-block.px-6 { display: block; max-width: 20rem; margin-left: auto; margin-right: auto; } }
/* L20: the dates step's "already left" box asks nothing of a student (both of its <template x-if> stay
   unrendered), so it showed as an empty bordered box above Continue. Hide it whenever it holds no question. */
#sacraw-left-q:not(:has(> :not(template))) { display: none; }
/* L20: on a phone the chat launcher sat on the student-abroad plan card (beside "Email my quote details"), over the dates
   note on iOS Safari (whose toolbar shortens the viewport) and, on the eligibility, add-on and details steps, over the
   right end of full-width rows and fields (and over the new gate card). Hidden on the gate and through this lane only,
   as it already is on the card step and while the price sheet is open. */
@media (max-width: 639px) { body.sf-quote-sa-steps .sacraw-chat { display: none !important; } }
/* L21: the same treatment, for EVERY quote lane and step (the L20 audit applied it to the gate and the student-abroad lane only, on phones).
   The launcher sat on the inbound-student and visitor single-plan card, over help text and over the right end of fields on the dates, travellers,
   add-ons and details steps; on an iPad (768) it also sat over the eligibility answers and the beneficiary hint. Hidden on phones and tablets
   (up to 1023px) from the gate through the Pay step, until the purchase completes (the success screen keeps it); the Pay step and the price
   sheet already hid it. Desktop keeps it (nothing under it at 1440). */
@media (max-width: 1023px) { body.sf-quote-flow .sacraw-chat { display: none !important; } }
/* L21b: on each step change the quote focuses the new step heading (tabindex -1, for screen readers). Safari then drew the
   2px focus outline round it, so on iPhone a dark box sat round "Choose your coverage" and every other step heading. Headings
   focused by script only; real keyboard targets keep their outline. */
h2[tabindex="-1"]:focus, h2[tabindex="-1"]:focus-visible { outline: none; }
/* Keep every date row reachable above sticky actions and cookie notices on
   phones, including Safari with its expanded browser controls. The static
   wrapper still anchors the field on desktop; the open mobile picker floats. */
@media (max-width: 767px), (max-height: 600px) {
  .flatpickr-calendar.open {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    z-index: 10000 !important;
  }
  .flatpickr-calendar.open::before,
  .flatpickr-calendar.open::after { display: none; }
}
