/* =============================================================
   OCR-CAPTURE — V25 Component E
   Insurance-card capture overlay. Sits above all other content
   (z-index 9000). Mobile-native, a11y-compliant.
   ============================================================= */

.ocr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.ocr-overlay.is-open {
  display: flex;
  pointer-events: auto;
}

.ocr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 42, 58, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: ocr-fade-in 220ms cubic-bezier(.22,.61,.36,1);
}
@keyframes ocr-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ocr-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--cream, #FFFFFF);
  border: 2px solid var(--ink, #0E2A3A);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink, #0E2A3A);
  padding: 28px 28px 22px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink, #0E2A3A);
  animation: ocr-panel-in 320ms cubic-bezier(.22,.61,.36,1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@keyframes ocr-panel-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.ocr-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--ink, #0E2A3A);
  background: var(--cream, #FFFFFF);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: var(--ink, #0E2A3A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ocr-close:hover {
  background: var(--lemon, #FFC857);
}
.ocr-close:focus-visible {
  outline: 3px solid var(--lemon, #FFC857);
  outline-offset: 2px;
}

.ocr-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.15;
  margin: 0 0 8px;
  padding-right: 36px;
  color: var(--ink, #0E2A3A);
}

.ocr-privacy {
  font-size: 13px;
  line-height: 1.45;
  color: var(--mute, #4A6678);
  margin: 0 0 20px;
}
.ocr-privacy strong {
  color: var(--ink, #0E2A3A);
  font-weight: 600;
}

/* DAV-64 — Three-bullet privacy list. Cyan dot, ink lead-text, mute lede.
   Replaces the prior single prose paragraph as the brand-aligned honesty
   surface. */
.ocr-privacy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ocr-privacy-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--mute, #4A6678);
}
.ocr-privacy-list strong {
  color: var(--ink, #0E2A3A);
  font-weight: 600;
}
.ocr-privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink, #00B5D8);
  flex: none;
  margin-top: 7px;
  box-shadow: 0 0 0 2px rgba(0,181,216,.16);
}

/* ── Intro state: 3 input options ────────────────────────────── */
.ocr-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.ocr-opt {
  background: var(--cream, #FFFFFF);
  border: 2px solid var(--ink, #0E2A3A);
  border-radius: 12px;
  padding: 18px 8px 14px;
  min-height: 92px; /* DAV-63 — comfortably exceeds 44×44 touch-target floor */
  cursor: pointer;
  font-family: inherit;
  color: var(--ink, #0E2A3A);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: transform 180ms cubic-bezier(.22,.61,.36,1),
              background 180ms cubic-bezier(.22,.61,.36,1),
              box-shadow 180ms cubic-bezier(.22,.61,.36,1);
  box-shadow: 3px 3px 0 var(--ink, #0E2A3A);
}
/* DAV-63 — SVG icons inherit currentColor so the hover lemon-wash takes
   the same path as text. */
.ocr-opt .ocr-opt-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink, #0E2A3A);
}
.ocr-opt:hover {
  background: var(--lemon, #FFC857);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink, #0E2A3A);
}
.ocr-opt:active {
  transform: translate(0,0);
  box-shadow: 1px 1px 0 var(--ink, #0E2A3A);
}
.ocr-opt:focus-visible {
  outline: 3px solid var(--lemon, #FFC857);
  outline-offset: 2px;
}
/* (Legacy emoji-icon rule removed — DAV-63 replaced emojis with SVG, see
   .ocr-opt .ocr-opt-icon above.) */
.ocr-opt-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.25;
}

.ocr-or {
  position: relative;
  margin: 14px 0;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute, #4A6678);
}
.ocr-or::before, .ocr-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--rule, #DDE9EE);
}
.ocr-or::before { left: 0; }
.ocr-or::after  { right: 0; }
.ocr-or span { padding: 0 4px; background: var(--cream, #FFFFFF); position: relative; }

/* DAV-51 (2026-05-19) — .ocr-manual-link styles removed with the manual fallback. */

/* ── Scanning state: animated frame + status ───────────────── */
.ocr-scan-frame {
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--ink, #0E2A3A);
  border-radius: 14px;
  margin: 12px 0 16px;
  overflow: hidden;
}
.ocr-scan-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid var(--lemon, #FFC857);
}
.ocr-scan-corner--tl { top: 14px; left: 14px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.ocr-scan-corner--tr { top: 14px; right: 14px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.ocr-scan-corner--bl { bottom: 14px; left: 14px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.ocr-scan-corner--br { bottom: 14px; right: 14px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.ocr-scan-beam {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lemon, #FFC857), transparent);
  box-shadow: 0 0 12px 2px var(--lemon, #FFC857);
  animation: ocr-scan 1.6s cubic-bezier(.45,.0,.55,1) infinite;
  top: 14px;
}
@keyframes ocr-scan {
  0%   { top: 14px; opacity: 0.9; }
  50%  { top: calc(100% - 16px); opacity: 1; }
  100% { top: 14px; opacity: 0.9; }
}

/* DAV-65 — Scan sub-line. Sets honest expectation under the beating
   "Looking for your carrier…" status. */
.ocr-scan-sublabel {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: var(--mute, #4A6678);
  text-align: center;
  margin: 4px 0 0;
}

/* DAV-65 — Reduced-motion guard. The beam is purely decorative; if the
   user has prefers-reduced-motion set, freeze it mid-card instead. */
@media (prefers-reduced-motion: reduce) {
  .ocr-scan-beam {
    animation: none !important;
    top: 50% !important;
    opacity: 1 !important;
  }
  .ocr-backdrop { animation: none !important; }
  .ocr-panel { animation: none !important; }
}

/* DAV-67 — Fail-state eyebrow. Soft-red on cream, JetBrains Mono small caps.
   Sits above the title so the surface reads "Retake → Couldn't quite read
   that." */
.ocr-fail-eyebrow {
  display: inline-block;
  background: #FFE9E3;
  color: #8A2A1A;
  border: 1px solid #C4593E;
  border-radius: 999px;
  padding: 3px 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.ocr-scan-status {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute, #4A6678);
  text-align: center;
  margin: 0;
  min-height: 16px;
}

/* ── Confirm state: card preview ────────────────────────────── */
.ocr-card-preview {
  background: linear-gradient(180deg, #FFF8C8 0%, var(--cream, #FFFFFF) 100%);
  border: 2px solid var(--ink, #0E2A3A);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 6px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 3px 3px 0 var(--ink, #0E2A3A);
}
.ocr-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--rule, #DDE9EE);
  padding-bottom: 6px;
}
.ocr-card-row:last-child { border-bottom: none; padding-bottom: 0; }

/* DAV-66 — Surprise row treatment for the Premium line when Vision found
   it. Soft lemon wash + leading cyan dot. Only applied when we have an
   actual number — null-premium rows stay neutral. */
.ocr-card-row--surprise {
  background: linear-gradient(90deg, rgba(255,200,87,0.18) 0%, rgba(255,200,87,0) 70%);
  margin: 0 -8px;
  padding: 4px 8px 8px;
  border-radius: 6px;
}
.ocr-card-cyan-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink, #00B5D8);
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(0,181,216,.18);
}
.ocr-card-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute, #4A6678);
  flex-shrink: 0;
}
.ocr-card-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink, #0E2A3A);
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.ocr-card-value .ocr-suffix {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--mute, #4A6678);
  margin-left: 2px;
}
.ocr-card-value--placeholder {
  color: var(--mute, #4A6678);
  font-weight: 500;
  opacity: .6;
}

/* 3.A (DAV-82 follow-up) — Premium-fill affordance on the confirm card.
   Inline link sits next to the "—" placeholder when premium is null.
   Click swaps the row into an inline numeric input. */
.ocr-card-fill-link {
  display: inline-block;
  margin-left: 10px;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--pink, #00B5D8);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  letter-spacing: -.005em;
  vertical-align: middle;
}
.ocr-card-fill-link:hover { color: var(--ink, #0E2A3A); }
.ocr-card-fill-link:focus-visible {
  outline: 2px solid var(--lemon, #FFC857);
  outline-offset: 2px;
  border-radius: 3px;
}
.ocr-card-row--needs-fill .ocr-card-value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Inline edit state */
.ocr-card-fill-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  background: rgba(255, 200, 87, 0.18);
  border: 1.5px solid var(--ink, #0E2A3A);
  border-radius: 6px;
  padding: 2px 8px;
}
.ocr-card-fill-prefix {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink, #0E2A3A);
}
.ocr-card-fill-input {
  width: 64px;
  background: transparent;
  border: none;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink, #0E2A3A);
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.ocr-card-fill-input::-webkit-outer-spin-button,
.ocr-card-fill-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ocr-card-fill-suffix {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--mute, #4A6678);
  margin-left: 1px;
}

/* DAV-116 — DOB-fill prompt strip sits between the verified chip and the
   card preview when Vision didn't read a DOB off the card. Cream surface,
   ink-bordered, sits as a clear "we need one more thing" affordance. */
.ocr-card-dob-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: rgba(255, 200, 87, 0.14);
  border: 1px dashed var(--ink, #0E2A3A);
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink, #0E2A3A);
  line-height: 1.4;
}
.ocr-card-dob-input {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #0E2A3A);
  background: var(--cream, #FFFAEA);
  border: 1.5px solid var(--ink, #0E2A3A);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  letter-spacing: -.005em;
}
.ocr-card-dob-input:focus-visible {
  outline: 2px solid var(--lemon, #FFC857);
  outline-offset: 2px;
}

/* DAV-119 — Provider-block fallback note. Shown when our broker NPI
   isn't registered with the carrier (e.g. BCBS Florida today). Honest
   one-liner that acknowledges we're using the card-printed numbers
   instead of carrier-verified ones. Muted slate treatment, no chip. */
.ocr-card-fallback-note {
  align-self: flex-start;
  background: rgba(74, 102, 120, 0.06);
  border: 1px dashed var(--mute, #4A6678);
  color: var(--mute, #4A6678);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.005em;
  margin: -4px 0 10px;
  max-width: 100%;
}
.ocr-card-fallback-note strong {
  color: var(--ink, #0E2A3A);
  font-weight: 600;
}
/* DAV-120 — Inactive-coverage variant. Same shape but lemon-tinted to
   signal "we found something — but you should hear this." Lifts the
   honesty into a soft warning rather than a flat fallback. */
.ocr-card-fallback-note--inactive {
  background: rgba(255, 200, 87, 0.16);
  border-color: var(--lemon, #FFC857);
  color: var(--ink, #0E2A3A);
}
.ocr-card-fallback-note--inactive strong {
  color: var(--ink, #0E2A3A);
}

/* DAV-58 — verified-with-carrier chip shown on the confirm card when Stedi
   hit. Sits between the title and the card preview. */
.ocr-card-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: #E9F8EE;
  border: 1px solid #1F8A45;
  color: #0F5C2C;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  margin: -4px 0 10px;
}

/* ── Action buttons (confirm/edit) ──────────────────────────── */
.ocr-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.ocr-action-edit {
  flex: 0 0 auto;
  background: var(--cream, #FFFFFF);
  border: 2px solid var(--ink, #0E2A3A);
  border-radius: 10px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #0E2A3A);
  cursor: pointer;
}
.ocr-action-edit:hover { background: rgba(255, 200, 87, 0.2); }
.ocr-action-confirm {
  flex: 1;
  background: var(--pink, #00B5D8);
  border: 2px solid var(--ink, #0E2A3A);
  border-radius: 10px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #0E2A3A);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink, #0E2A3A);
  transition: transform 180ms, box-shadow 180ms;
}
.ocr-action-confirm:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink, #0E2A3A);
}
.ocr-action-confirm:active {
  transform: translate(0,0);
  box-shadow: 1px 1px 0 var(--ink, #0E2A3A);
}

/* DAV-51 (2026-05-19) — manual entry form styles removed
   (.ocr-manual-intro, .ocr-form, .ocr-field*, .ocr-field-money*, .ocr-field-prefix/suffix).
   No manual fallback exists in the JS anymore; styles were dead code. */

/* ── Footer (skip link) ─────────────────────────────────────── */
.ocr-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule, #DDE9EE);
  text-align: center;
}
.ocr-skip-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--mute, #4A6678);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ocr-skip-link:hover {
  color: var(--ink, #0E2A3A);
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .ocr-overlay { padding: 12px; align-items: flex-end; }
  .ocr-panel {
    padding: 22px 18px 18px;
    border-radius: 14px;
    max-height: calc(100vh - 24px);
  }
  .ocr-title { font-size: 20px; }
  .ocr-options { grid-template-columns: 1fr; gap: 8px; }
  .ocr-opt { padding: 14px 10px; flex-direction: row; gap: 12px; justify-content: flex-start; }
  .ocr-opt-label { text-align: left; font-size: 12.5px; }
  .ocr-opt-icon { font-size: 22px; }
  .ocr-scan-frame { height: 160px; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ocr-backdrop { animation: none; }
  .ocr-panel    { animation: none; }
  .ocr-scan-beam {
    animation: none;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
  }
  .ocr-opt, .ocr-action-confirm {
    transition: none;
  }
}

/* ── Forced colors ──────────────────────────────────────────── */
@media (forced-colors: active) {
  .ocr-panel {
    background: Canvas !important;
    border: 2px solid CanvasText;
  }
  .ocr-opt {
    background: Canvas !important;
    border: 2px solid CanvasText !important;
  }
  .ocr-card-preview {
    background: Canvas !important;
    border: 2px solid CanvasText;
  }
  .ocr-action-confirm {
    background: Highlight !important;
    color: HighlightText !important;
    border: 2px solid CanvasText !important;
  }
}
