
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');


/* ============================================================
   [SECTION: CSS VARIABLES]
   v3.4 light theme — palette derived from loidscollisioncenter.com
   (brand blue #0071bc family, white surfaces, dark neutral text).
   Variable NAMES are unchanged from the dark theme so app.js and
   inline styles in index.html keep working. Some names are now
   historical (--gold = warm amber accent, not gold).
   All text tokens meet WCAG AA (4.5:1) on their backgrounds.
   ============================================================ */
:root {
  --bg:          #f4f6f8;
  --surface:     #ffffff;
  --surface2:    #f2f5f7;
  --surface3:    #e8edf1;
  --border:      #dde3e8;
  --border-mid:  #c2ccd4;
  --input-bg:    #ffffff;
  --input-border:#a9b7c1;

  --gold:        #7a5a17;
  --gold-dim:    #a98a45;
  --gold-pale:   #fdf6e4;

  --blue:        #0071bc;
  --blue-bright: #005a96;
  --blue-pale:   rgba(0,113,188,0.07);

  --text:        #14191e;
  --text-mid:    #4a555f;
  --text-dim:    #5d6973;

  --green:       #1a7a4a;
  --green-pale:  #e9f6ef;
  --rust:        #b03a1e;
  --rust-pale:   #faeae4;

  --amber:       #95620f;
  --amber-pale:  #fdf3dd;

  --font:         'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Barlow Condensed', 'Oswald', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', Courier, monospace;

  --radius:    5px;
  --radius-sm: 4px;
  --radius-lg: 8px;

  --shadow-card:  0 1px 4px rgba(16,40,60,0.06);
  --shadow-modal: 0 16px 48px rgba(16,40,60,0.22);

  color-scheme: light;
}

/* ============================================================
   [SECTION: LAYOUT]
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 64px;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(0,113,188,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(0,113,188,0.03) 0%, transparent 60%);
}

/* Keyboard focus ring — visible on light surfaces */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.header {
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border-bottom: 3px solid var(--blue);
  height: 58px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.header-inner {
  width: 100%;
  max-width: 680px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.logo em { color: var(--blue); font-style: normal; }

.container { width: 100%; max-width: 680px; padding: 0 16px; }
.screen { display: none; }
.screen.active { display: block; }


/* ============================================================
   [SECTION: TEST MODE BANNER]
   ============================================================ */
.test-mode-banner {
  display: none;
  width: 100%;
  background: var(--amber-pale);
  border-bottom: 1px solid var(--amber);
  padding: 6px 16px;
  text-align: center;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.test-mode-banner.visible { display: block; }


/* ============================================================
   [SECTION: FORMS]
   ============================================================ */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-card);
}

.form-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text);
}

.form-card p.sub {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 22px;
  line-height: 1.55;
}

/* Section divider inside form */
.form-section-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 22px 0 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: #2c3640;
}

.field-optional {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 4px;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  /* 16px minimum — anything smaller makes iOS Safari zoom on focus */
  font-size: 16px;
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"] {
  color-scheme: light;
}

/* appearance:none strips the native arrow — restore it so selects
   don't read as dead text fields */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%230071bc' stroke-width='2.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,188,0.14);
}

input::placeholder, textarea::placeholder { color: #8a96a0; }
select option { background: var(--input-bg); }

/* Larger phone entry on the first screen — one field, make it easy */
#authPhone {
  font-size: 18px;
  letter-spacing: 0.02em;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

/* Multi-select checklist (endorsements) */
.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

.checklist-item:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-pale);
  color: var(--blue-bright);
}

/* Insurance card photo capture */
.card-capture-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--blue-pale);
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.card-capture-row:hover { border-color: var(--blue); }
.card-capture-row .capture-icon { font-size: 22px; flex-shrink: 0; }
.card-capture-row .capture-text { font-size: 13px; color: var(--text-mid); line-height: 1.45; }
.card-capture-row .capture-text strong { color: var(--text); display: block; margin-bottom: 1px; }
.card-capture-row input[type="file"] { display: none; }

.field-error {
  font-size: 13px;
  color: var(--rust);
  display: none;
  margin-top: 2px;
}

.disclaimer {
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
  margin-top: 14px;
}


/* ============================================================
   [SECTION: BUTTONS]
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 20px;
  min-height: 48px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,113,188,0.25);
}
.btn-primary:hover { background: var(--blue-bright); }

.btn-secondary { background: var(--surface3); color: var(--text); border: 1px solid var(--border-mid); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue-bright); }

.btn-ghost { background: transparent; color: var(--text-mid); border: 1px solid var(--border-mid); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-bright); }

.btn-amber { background: var(--amber); color: #fff; width: 100%; font-weight: 800; }
.btn-amber:hover { opacity: 0.88; }

.btn-send {
  background: var(--blue);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-send:hover { background: var(--blue-bright); }
.btn-send:disabled { opacity: 0.35; cursor: not-allowed; }

.link {
  color: var(--blue-bright);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  font-size: inherit;
  font-family: inherit;
  /* invisible padding to widen the tap target without moving layout */
  padding: 6px 2px;
  margin: -6px -2px;
}
.link:hover { color: var(--blue); }


/* ============================================================
   [SECTION: MODAL/POPUP]
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,25,35,0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: modalIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text);
}

.modal p.modal-sub {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 20px;
  line-height: 1.55;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  /* 44px tap target */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--text); background: var(--surface2); }

/* Auth modal inputs */
#authCodeInput {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  font-family: var(--font-mono);
  padding: 14px;
  margin-bottom: 14px;
}

.auth-hint {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 12px;
}

/* Test mode code hint inside auth modal */
.test-code-hint {
  display: none;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--amber);
  background: var(--amber-pale);
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
  margin-bottom: 10px;
}
.test-code-hint.visible { display: block; }

.phone-verified-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--green);
  background: var(--green-pale);
  border: 1px solid rgba(26,122,74,0.35);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: none;
}

/* Upload modal */
.upload-zone {
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 14px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.upload-zone .upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { font-size: 14px; color: var(--text-mid); line-height: 1.5; }
.upload-zone input[type="file"] { display: none; }

.upload-filename {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--blue-bright);
  text-align: center;
  margin-bottom: 12px;
  min-height: 18px;
}

.upload-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 14px;
  overflow: hidden;
  display: none;
}

.upload-progress-bar {
  height: 100%;
  background: var(--blue);
  width: 0%;
  transition: width 0.3s;
}

/* Upgrade modal tier cards */
.upgrade-tier-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.upgrade-tier-card.highlighted {
  border-color: rgba(0,113,188,0.35);
  border-left-color: var(--blue);
  background: var(--blue-pale);
}
.upgrade-tier-card .tier-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 4px;
}
.upgrade-tier-card .tier-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  font-family: var(--font-display);
}
.upgrade-tier-card ul { list-style: none; font-size: 13.5px; color: var(--text-mid); display: flex; flex-direction: column; gap: 5px; }
.upgrade-tier-card li::before { content: '— '; color: var(--blue); }

/* v3.2: Stripe Payment Element container (production) */
.stripe-payment-wrap {
  margin: 14px 0;
}
#payment-element {
  min-height: 40px;
}
.payment-error {
  color: var(--rust);
  font-size: 13px;
  margin-top: 8px;
  min-height: 0;
}
.payment-error:empty { margin-top: 0; }

/* Test mode auto-approve button */
.stripe-test-approve {
  display: none;
  background: var(--amber-pale);
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--amber);
  margin: 14px 0;
  font-family: var(--font-mono);
}
.stripe-test-approve.visible { display: block; }

/* Disclosure modal */
.disclosure-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 18px;
  max-height: 180px;
  overflow-y: auto;
}

.disclosure-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  cursor: pointer;
  /* generous padding = easy tap while holding a phone one-handed */
  padding: 10px;
  margin-left: -10px;
  margin-right: -10px;
  border-radius: var(--radius-sm);
}
.disclosure-checkbox-row:hover { background: var(--surface2); }

.disclosure-checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-top: 1px;
  accent-color: var(--blue);
  cursor: pointer;
}

.disclosure-checkbox-label {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
}

/* Advocate info modal */
.advocate-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.advocate-feature-list li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.5;
}
.advocate-feature-list li .feat-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.advocate-feature-list li strong { color: var(--text); display: block; margin-bottom: 1px; }

.advocate-price-callout {
  background: var(--blue-pale);
  border: 1px solid rgba(0,113,188,0.3);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.advocate-price-callout .price-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 2px;
}
.advocate-price-callout .price-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}
.advocate-price-callout .price-period { font-size: 13px; color: var(--text-dim); }


/* ============================================================
   [SECTION: INTAKE SCREEN]
   ============================================================ */
.shop-context-banner {
  background: #e7f2fa;
  border: 1px solid #bcd9ec;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: #0a5287;
  margin-bottom: 16px;
  display: none;
}

/* Multi-step intake (v3.3) — step indicator + step-2 action row */
.step-indicator {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}

.intake-step2-actions {
  display: flex;
  gap: 10px;
}
.intake-step2-actions .btn-secondary { width: auto; flex: 0 0 auto; }
.intake-step2-actions .btn-primary   { flex: 1 1 auto; }

/* Coverage survey question grouping */
.survey-question {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.survey-question .sq-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 6px;
}

.survey-question .sq-text {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-mid);
  cursor: pointer;
  /* full-row tap target */
  padding: 8px 6px;
  border-radius: var(--radius-sm);
}
.radio-item:hover { background: var(--blue-pale); }

.radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

.radio-item:has(input:checked) { color: var(--text); }

/* Deductible amount — shown when collision = yes */
.deductible-row {
  display: none;
  margin-top: 8px;
}
.deductible-row.visible { display: flex; align-items: center; gap: 8px; }
.deductible-row input {
  max-width: 140px;
  padding: 8px 10px;
}


/* ============================================================
   [SECTION: ASSESSMENT SCREEN]
   ============================================================ */
.assessment-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.assessment-vehicle {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.assessment-carrier {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.assessment-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px 20px;
  line-height: 1.75;
  box-shadow: var(--shadow-card);
}

/* Situation-specific CTA block — populated by renderCtaBlock() */
.assessment-cta-specific {
  background: var(--blue-pale);
  border: 1px solid rgba(0,113,188,0.3);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 14px;
  color: #0a5287;
  line-height: 1.6;
  display: none;
}

.assessment-cta-specific .cta-headline {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 6px;
}

.assessment-cta-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.assessment-quick-summary {
  background: var(--blue-pale);
  border: 1px solid rgba(0,113,188,0.25);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  display: none;
}

.assessment-quick-summary .qs-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 5px;
}

.assessment-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-save-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-save-share:hover { border-color: var(--blue); color: var(--blue-bright); }

.return-hint { font-size: 12px; color: var(--text-dim); font-style: italic; }

/* Welcome-back banner for restored sessions */
.welcome-back-banner {
  background: var(--green-pale);
  border: 1px solid rgba(26,122,74,0.35);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--green);
  margin-bottom: 14px;
  display: none;
}

@media print {
  .header, .assessment-quick-summary, .assessment-meta-row,
  .assessment-cta-row, .assessment-cta-specific, .disclaimer,
  .modal-overlay, .btn-save-share, .test-mode-banner { display: none !important; }
  body { background: #fff; color: #111; padding: 0; }
  .assessment-header { background: #f0f0f0; border: 1px solid #ccc; }
  .assessment-body { background: #fff; border: 1px solid #ddd; color: #111; box-shadow: none; }
  .assessment-body h2 { color: #111; border-bottom: 1px solid #ccc; }
  .assessment-body h3 { color: #333; }
}


/* ============================================================
   [SECTION: CHAT SCREEN]
   ============================================================ */
.chat-context-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  box-shadow: var(--shadow-card);
}

.chat-context-vehicle {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.chat-context-right { display: flex; align-items: center; gap: 10px; }

.btn-upload-inline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: var(--surface2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-upload-inline:hover { border-color: var(--blue); color: var(--blue-bright); }

.chat-messages {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  min-height: 280px;
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 10px;
  scroll-behavior: smooth;
  box-shadow: var(--shadow-card);
}

.message { display: flex; flex-direction: column; gap: 3px; max-width: 90%; animation: msgIn 0.18s ease; }
.message.assistant { align-self: flex-start; }
.message.user      { align-self: flex-end; }

.msg-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 3px;
  font-family: var(--font-display);
}
.message.user .msg-role { text-align: right; color: var(--blue-bright); }

.msg-bubble {
  padding: 12px 15px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.6;
}

.message.assistant .msg-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-bottom-left-radius: 2px;
}

.message.user .msg-bubble {
  background: rgba(0,113,188,0.08);
  border: 1px solid rgba(0,113,188,0.22);
  border-bottom-right-radius: 2px;
}

.msg-bubble h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  margin: 14px 0 7px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}
.msg-bubble h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 12px 0 5px;
}
.msg-bubble strong { color: var(--text); font-weight: 600; }
.msg-bubble em     { color: var(--text-mid); font-style: italic; }
.msg-bubble hr     { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.msg-bubble ul, .msg-bubble ol { padding-left: 18px; margin: 6px 0; }
.msg-bubble li { margin-bottom: 3px; }

.upgrade-inline-cta {
  margin-top: 12px;
  padding: 13px 15px;
  background: var(--blue-pale);
  border: 1px solid rgba(0,113,188,0.3);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #0a5287;
  line-height: 1.6;
}
.upgrade-inline-cta button {
  display: inline-block;
  margin-top: 9px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-display);
}

.typing-indicator .msg-bubble { display: flex; gap: 5px; align-items: center; padding: 13px 16px; }
.typing-dot {
  width: 7px; height: 7px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: typingPulse 1.1s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  /* 16px minimum — prevents iOS zoom-on-focus */
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  resize: none;
  height: 48px;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.15s;
  line-height: 1.5;
}
.chat-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,188,0.12); }
.chat-input:disabled { opacity: 0.45; cursor: not-allowed; }

.proactive-nudge {
  background: var(--blue-pale);
  border: 1px solid rgba(0,113,188,0.25);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: #0a5287;
  display: none;
  margin-top: 8px;
}

/* View-only re-auth nudge banner */
.reauth-nudge {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-mid);
  box-shadow: 0 -4px 12px rgba(16,40,60,0.08);
  padding: 10px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-mid);
}
.reauth-nudge.visible { display: flex; }


/* ============================================================
   [SECTION: TIER BADGE]
   ============================================================ */
.tier-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: none;
}
.tier-badge.t0 { color: #4a555f; background: var(--surface3);   border: 1px solid var(--border-mid); }
.tier-badge.t1 { color: var(--green); background: var(--green-pale); border: 1px solid rgba(26,122,74,0.35); }
.tier-badge.t2 { color: var(--blue-bright); background: var(--blue-pale); border: 1px solid rgba(0,113,188,0.35); }


/* ============================================================
   [SECTION: ANIMATIONS]
   ============================================================ */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes typingPulse {
  0%, 60%, 100% { transform: scale(1); opacity: 0.4; }
  30%            { transform: scale(1.35); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ============================================================
   [SECTION: RESPONSIVE]
   ============================================================ */
@media (max-width: 480px) {
  .header-inner { padding: 0 12px; }
  body { padding: 0 0 48px; }
  .container { padding: 0 12px; }
  .form-row-3 { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-card { padding: 20px 16px; }
  .chat-messages { max-height: 360px; }
  .modal { max-width: 100%; border-radius: var(--radius); padding: 24px 18px; }
  .checklist { flex-direction: column; }
}
