/* ── Verify flow — scoped design system. Applied via class="verify-theme". ── */
.verify-theme {
  --bg-primary:       #1a2336;
  --bg-secondary:     #111b2d;
  --border:           #2a3650;
  --border-accent:    #2a4a7f;
  --blue:             #3b82f6;
  --blue-dark:        #1e3a5f;
  --text-primary:     #e2e8f0;
  --text-secondary:   #94a3b8;
  --text-muted:       #475569;
  --text-placeholder: #64748b;
  --green:            #34d399;
  --green-bg:         #0f2d1f;
  --green-border:     #1a5c38;
  --amber:            #fbbf24;
  --amber-bg:         #1f1a0f;
  --amber-border:     #4a3800;
  --amber-text:       #92714a;
  --radius-card:      12px;
  --radius-btn:       10px;
  --radius-badge:     20px;
  --radius-icon:      8px;
}

/* Full-screen mobile shell + centered card */
.verify-theme {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  justify-content: center;
}

.verify-card {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.verify-logo { display: flex; align-items: center; }

.verify-dots { display: flex; justify-content: center; gap: 5px; padding: 2px 0 4px; }
.verify-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); transition: all .2s; }
.verify-dot.active { background: var(--blue); width: 14px; border-radius: 3px; }
.verify-dot.done { background: var(--blue); }

.verify-badge {
  font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--blue);
}

.verify-title { font-size: 19px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.verify-title.center { text-align: center; }
.verify-sub { font-size: 14px; color: var(--text-placeholder); line-height: 1.5; }
.verify-sub.center { text-align: center; }

.verify-btn-primary {
  margin-top: auto; width: 100%; padding: 11px 0; border: none; cursor: pointer;
  border-radius: var(--radius-btn); background: var(--blue); color: #fff;
  font-size: 16px; font-weight: 500; text-align: center; font-family: inherit; transition: opacity .15s;
}
.verify-btn-primary:hover { opacity: .88; }
.verify-btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.verify-btn-secondary {
  width: 100%; padding: 10px 0; cursor: pointer; border-radius: var(--radius-btn);
  background: transparent; color: var(--text-muted); border: .5px solid var(--border);
  font-size: 14px; text-align: center; font-family: inherit;
}

.verify-secure-footer {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 12px; color: var(--text-muted);
}

.verify-instr-list { display: flex; flex-direction: column; gap: 8px; }
.verify-instr-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.verify-instr-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--blue-dark);
  border: .5px solid var(--border-accent); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500;
  flex-shrink: 0; margin-top: 1px;
}

.verify-checklist { display: flex; flex-direction: column; gap: 8px; }
.verify-checklist-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary); border: .5px solid var(--border);
  border-radius: var(--radius-card); padding: 12px 14px;
}
.verify-checklist-icon {
  width: 34px; height: 34px; border-radius: var(--radius-icon); background: var(--blue-dark);
  display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 16px; flex-shrink: 0;
}
.verify-checklist-text { display: flex; flex-direction: column; gap: 2px; }
.verify-checklist-title { font-size: 15px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.verify-checklist-sub { font-size: 13px; color: var(--text-secondary); line-height: 1.3; }

.verify-why-panel {
  background: var(--bg-secondary); border: .5px solid var(--border);
  border-radius: var(--radius-card); padding: 10px 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}
.verify-strong { color: var(--text-primary); font-weight: 500; }

/* ── Phase 04 — Setting things up spinner ── */
.verify-spinner-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; flex: 1; }
.verify-spinner {
  width: 36px; height: 36px; border: 2.5px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: verify-spin .9s linear infinite;
}
@keyframes verify-spin { to { transform: rotate(360deg); } }

/* ── Phase 05 — License scanner overlay ── */
/* A contained ~90% camera "stage" so the live view never spans edge-to-edge and the
   hint/controls sit on the dark area below it rather than over the video. The captured
   image resolution is unaffected (capture reads source/native pixels, not the preview). */
.verify-scanner {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.verify-scanner-stage {
  position: relative; width: 95vw;
  height: 95vh;   /* fallback for browsers without dynamic viewport units */
  height: 95dvh;  /* dvh tracks iOS Safari's collapsing URL bar so the stage stays inside the visible area */
  border-radius: 16px; overflow: hidden; background: #000;
  display: flex; align-items: center; justify-content: center;
}
/* The capture preview shows the whole sensor frame (letterboxed in portrait, pillarboxed in
   landscape) so the ID-1 guide always spans ~92% of the sensor width, whatever way the phone is
   held. See tasks/todo/license_portrait/00-overview.md ADR-1. */
.verify-scanner-video { width: 100%; height: 100%; object-fit: contain; display: block; }
/* The selfie has no guide crop — it captures the full frame, so its object-fit is purely cosmetic
   and never affects the bytes we send. It keeps the full-bleed fill. */
.verify-scanner-video-fill { object-fit: cover; }
/* Placed by licenseScanner._guideSourceRect so the box the user aims at and the box we crop are the
   same numbers and cannot drift. The fallbacks only ever show for the first frame. */
.verify-scanner-guide {
  position: absolute;
  left: var(--verify-guide-left, 4%); top: var(--verify-guide-top, 20%);
  width: var(--verify-guide-width, 92%); height: var(--verify-guide-height, auto);
  aspect-ratio: 1.585 / 1;   /* ID-1 card ratio — only applies while height falls back to auto */
  border: 2px solid rgba(255,255,255,.6); border-radius: 14px; pointer-events: none;
}
.verify-scanner-guide.aligned { border-color: var(--green); box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.verify-scanner-corner { position: absolute; width: 26px; height: 26px; border: 4px solid #fff; }
.verify-scanner-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-top-left-radius: 14px; }
.verify-scanner-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-top-right-radius: 14px; }
.verify-scanner-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-bottom-left-radius: 14px; }
.verify-scanner-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-bottom-right-radius: 14px; }
.verify-scanner-hint {
  position: absolute; top: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 15px;
  padding: 0 84px; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none;
}
/* ── Capture-control placement standard (shared by every capture screen) ──
   Held landscape → right-side vertical control column (X top, shutter bottom).
   Held portrait  → bottom-centred control row (X + shutter).
   Both columns/rows are padded by env(safe-area-inset-*) and anchored to the visual
   viewport so the controls always clear the iOS Safari bottom bar / home indicator and the
   notch. New capture screens must reuse these two classes rather than inventing ad-hoc
   control positioning. */
.verify-scanner-controls-side {
  position: absolute; top: 0; bottom: 0;
  right: calc(18px + env(safe-area-inset-right));
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(24px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom));
}
.verify-scanner-controls-bottom {
  position: absolute; left: 0; right: 0;
  bottom: calc(28px + env(safe-area-inset-bottom));
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  display: flex; align-items: center; justify-content: center; gap: 44px;
}
.verify-scanner-close, .verify-scanner-shutter { color: #fff; background: transparent; border: none; cursor: pointer; }
/* min 44×44px hit area (Apple HIG minimum tap target); flex centres the glyph within it. */
.verify-scanner-close {
  font-size: 28px; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.verify-scanner-shutter { width: 66px; height: 66px; border-radius: 50%; background: #fff; color: #000; font-size: 26px; }
.verify-scanner-preview { max-width: 95vw; max-height: 80vh; border-radius: var(--radius-card); }
.verify-scanner-review { width: 100%; max-width: 420px; padding: 0 16px; display: flex; gap: 12px; }
.verify-scanner-review .verify-btn-primary { margin-top: 0; }

/* Fake-id testing chooser — modal over the scanner (dev without a camera picks how to supply the picture). */
.verify-fake-modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.verify-fake-modal-card {
  width: 100%; max-width: 320px; background: var(--bg-secondary); border: .5px solid var(--border);
  border-radius: var(--radius-card); padding: 20px 18px; display: flex; flex-direction: column; gap: 10px;
}
.verify-fake-modal-card .verify-btn-primary { margin-top: 6px; }
.verify-fake-modal-card .verify-btn-secondary { display: block; }
.verify-scanner-video-mirror { transform: scaleX(-1); }
.verify-scanner-oval {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64%; max-width: 320px; max-height: 78%; aspect-ratio: 3 / 4;
  border: 2px dashed rgba(255,255,255,.6); border-radius: 50%; pointer-events: none;
}
.verify-scanner-oval.aligned { border-style: solid; border-color: var(--green); box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }

/* ── Phase 06 — Verify your ID ── */
.verify-field-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); margin-bottom: 5px; }
.verify-input {
  width: 100%; background: var(--bg-secondary); border: .5px solid var(--border); border-radius: 8px;
  /* 16px minimum — iOS Safari auto-zooms the page when a focused input is any smaller, and that zoom
     persists into the capture overlay */
  padding: 10px 11px; font-size: 16px; color: var(--text-primary); font-family: inherit; outline: none;
}
.verify-input:focus { border-color: var(--blue); }
.verify-name-display {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; color: var(--text-primary);
}
.verify-name-lock { font-size: 12px; color: var(--text-secondary); opacity: .5; }
.verify-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.verify-id-row { display: flex; gap: 8px; }
.verify-id-col { flex: 1; display: flex; flex-direction: column; }
.verify-id-col-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-align: center; margin-bottom: 6px; }
.verify-upload-zone {
  flex: 1; border: 1px dashed var(--border); border-radius: var(--radius-card); padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--bg-secondary);
  cursor: pointer; transition: border-color .15s; color: var(--text-primary);
}
.verify-upload-zone:hover { border-color: var(--blue); }
.verify-upload-zone.captured { border-style: solid; border-color: var(--green); }
.verify-upload-icon { width: 30px; height: 30px; border-radius: var(--radius-icon); background: var(--blue-dark); display: flex; align-items: center; justify-content: center; color: var(--blue); }
.verify-upload-thumb {
  width: 100%; height: 72px; object-fit: contain; border-radius: var(--radius-icon); background: var(--bg-primary);
}
.verify-upload-title { font-size: 13px; font-weight: 500; color: var(--text-primary); text-align: center; }
.verify-upload-sub { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.3; }

/* ── Phase 07 — Selfie ── */
.verify-selfie-area {
  width: 100%; height: 150px; border-radius: var(--radius-card); background: var(--bg-secondary);
  border: .5px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-muted); cursor: pointer;
}
.verify-selfie-area .verify-selfie-thumb { max-height: 130px; border-radius: 8px; }
.verify-compare-row { display: flex; gap: 8px; align-items: center; }
.verify-compare-box {
  flex: 1; height: 64px; border-radius: var(--radius-icon); background: var(--bg-secondary); border: .5px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 12px; color: var(--text-muted);
}
.verify-compare-box img { width: 100%; height: 100%; object-fit: cover; }
.verify-compare-arrow { font-size: 16px; color: var(--border); }

/* ── Phase 08 — Processing / Success / Error ── */
.verify-success-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 14px; }
.verify-success-circle {
  width: 64px; height: 64px; border-radius: 50%; background: var(--green-bg); border: .5px solid var(--green-border);
  display: flex; align-items: center; justify-content: center; color: var(--green); font-size: 30px;
}
.verify-error-circle {
  width: 64px; height: 64px; border-radius: 50%; background: #2d0f0f; border: .5px solid #5c1a1a;
  display: flex; align-items: center; justify-content: center; color: #f87171; font-size: 30px;
}
.verify-error-box {
  background: rgba(220,38,38,.08); border: .5px solid rgba(248,113,113,.3); border-radius: var(--radius-card);
  padding: 10px 12px; color: #fecaca; font-size: 13px; white-space: pre-wrap;
}

/* ── Mobile number & verification code entry ── */
.verify-code-row { display: flex; gap: 8px; }
.verify-code-box {
  flex: 1 1 0; min-width: 0; aspect-ratio: 1; padding: 0;
  background: var(--bg-secondary); border: 1.5px solid var(--border); border-radius: var(--radius-card);
  text-align: center; font-size: 22px; font-weight: 600; color: var(--text-primary); font-family: inherit;
}
.verify-code-box:focus { outline: none; border-color: var(--blue); }
.verify-code-box.filled { border-color: var(--border-accent); }
.verify-link-button {
  background: transparent; border: none; color: var(--blue); font-size: 13px; font-weight: 500;
  text-align: center; cursor: pointer; padding: 4px 0; font-family: inherit;
}

/* ── Phase 03 — Sender Identity (S1) ── */
.verify-sender-card {
  background: var(--bg-secondary); border: .5px solid var(--border); border-radius: var(--radius-card);
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.verify-sender-firm { display: flex; align-items: center; gap: 12px; }
.verify-sender-firm-avatar {
  width: 48px; height: 48px; border-radius: 12px; background: var(--blue-dark);
  display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 20px; font-weight: 600; flex-shrink: 0;
}
.verify-sender-firm-name { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.verify-sender-firm-sub { font-size: 14px; color: var(--text-muted); }
.verify-sender-divider { height: .5px; background: var(--border); }
.verify-sender-attorney { display: flex; align-items: center; gap: 10px; }
.verify-sender-attorney-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--blue-dark);
  display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.verify-sender-attorney-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.verify-sender-attorney-title { font-size: 13px; color: var(--text-muted); }
.verify-sender-message-label {
  font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); margin-bottom: 6px;
}
.verify-sender-message-body { font-size: 16px; color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; }
.verify-sender-footnote {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 4px;
}

/* ── Bar association licensure — repeatable state + bar-number entries ── */
.verify-bar-entry {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 16px; margin-bottom: 12px;
}
.verify-bar-entry-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.verify-bar-entry-label {
  font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--blue);
}
.verify-bar-remove {
  background: transparent; border: none; color: var(--text-secondary); cursor: pointer;
  padding: 4px 6px; border-radius: 6px; font-family: inherit;
}
.verify-select {
  width: 100%; background: var(--bg-secondary); border: .5px solid var(--border); border-radius: 8px;
  padding: 10px 11px; font-size: 16px; color: var(--text-primary); font-family: inherit; outline: none;
}
.verify-select:focus { border-color: var(--blue); }
.verify-btn-add {
  width: 100%; background: transparent; border: 1px dashed var(--border); color: var(--blue);
  border-radius: var(--radius-btn); padding: 13px; cursor: pointer; font-size: 14px; font-family: inherit;
}

/* ── SMS consent — the website opt-in Call to Action ── */
.verify-consent-row {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  background: var(--bg-secondary); border: .5px solid var(--border); border-radius: var(--radius-card); padding: 12px;
}
.verify-consent-checkbox { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--blue); }
.verify-consent-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.verify-consent-legal {
  display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px;
}
.verify-consent-legal a { color: var(--blue); text-decoration: none; }
.verify-consent-legal a:hover { text-decoration: underline; }
.verify-consent-legal-separator { color: var(--text-muted); }
