/* ROUTANA ULTRA Portal — Light Theme */
/* Font: Inter (self-hosted, NO Google Fonts CDN) */

@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-bold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── Anti-scraping: prevent text selection on non-interactive elements ── */
.portal-wrap {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Allow selection inside form inputs and textareas */
.portal-wrap input,
.portal-wrap textarea,
.portal-wrap select,
.portal-wrap [contenteditable] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface2: #f5f5f4;
  --surface-hover: #ececeb;
  --border: #e7e5e4;
  --text: #1c1917;
  --text-dark: #1c1917;
  /* UXP contrast law (2026-07-30). --muted WAS #a8a29e, which measures
     2.39:1 on --bg — this one token carried the body copy of the entire
     customer side (step sub-headings, form hints/labels, checkbox labels,
     success subtitles, booking meta, empty states) at roughly HALF the
     4.5:1 WCAG AA floor. Theme is frozen, so this is a lightness-only
     nudge inside the same stone ramp, moved the MINIMUM distance that
     passes: #78716c measures 4.54:1 on --bg and 4.80:1 on --surface.
     Measured, not eyeballed — docs/gate-reports/fable-ux-polish/contrast_check.py. */
  --text-muted: #78716c;
  --muted: #78716c;
  /* #78716c only reaches 4.40:1 once it sits on a TINTED surface
     (--surface2 #f5f5f4), so quiet text on a tint uses one more step down
     the same ramp: 6.99:1. Use --muted-strong on --surface2 / disabled
     fills, --muted on --bg and --surface. */
  --muted-strong: #57534e;
  --white: #fff;
  --primary: #d97706;
  --primary-hover: #b45309;
  --orange: #d97706;
  /* SET-B corrects this note. The brand orange is still the brand: it stays
     exactly as-is for every NON-TEXT use — borders, tints, accent bars, the
     now-line, the logo pin, focus rings, dots. What moved is TYPE. Orange as
     text on a light or cream ground measures 3.09-3.20:1, AND white ON the
     brand fill measures 3.19:1 — both under the 4.5:1 AA floor, so the old
     "stays as-is for FILLS" line was only true for fills nobody had to read.
     Both step to the next shade already in this palette, #b45309 (5.02:1).
     Because button REST is now #b45309, button HOVER steps down once more to
     #92400e (7.09:1) so hover still reads as a state change instead of
     landing on the rest colour. Same ramp, no new hue introduced.
     --orange-hover has no non-button users; verified by grep. */
  --orange-text: #b45309;
  --orange-light: #fffbeb;
  --orange-border: rgba(217,119,6,0.35);
  --orange-hover: #92400e;
  --green: #059669;
  /* Same rule for green type on a green tint: 3.55:1 -> 7.18:1. #065f46
     is already this file's own choice for that pairing (.banner-green,
     .time-slot.best-fit, .sc-badge-best) — this just names it. */
  --green-text: #065f46;
  --green-light: #ecfdf5;
  --green-border: #a7f3d0;
  --green-hover: #047857;
  --yellow: #eab308;
  --yellow-light: #fffbeb;
  --yellow-border: rgba(234,179,8,0.35);
  --red: #dc2626;
  /* and red type on a red tint: 4.40:1 -> 7.47:1 (already used by
     .banner-red). */
  --red-text: #991b1b;
  --red-bg: #fef2f2;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

html {
  background: var(--bg);
  /* Block horizontal pan on iPhone when content briefly overflows */
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Portal wrapper - centered, mobile-first */
.portal-wrap {
  max-width: 480px;
  margin: 0 auto;
  /* dvh accounts for mobile browser chrome that shows/hides */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Bottom nav — sticky on mobile so users never have to scroll to find Continue.
   Uses iOS safe-area-inset so the buttons clear the home-indicator bar on
   notched iPhones (was getting cropped before). */
@media (max-width: 640px) {
  .bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: var(--bg);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
    border-top: 1px solid var(--border);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* TOP BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.logo-pin {
  width: 16px; height: 16px;
  background: var(--orange);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
  flex-shrink: 0;
}
.logo-pin::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 8px; height: 8px;
  background: var(--bg);
  border-radius: 50%;
}
.sign-in {
  /* 44px minimum tappable box (Apple HIG 44pt / Material 48dp). The label
     stays 12px — padding fills the rest of the target, it does not need to
     grow the text. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  background: none;
}
.sign-in:hover { color: var(--text); border-color: #d6d3d1; }

/* STEP INDICATOR */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px 20px;
  gap: 0;
  flex-shrink: 0;
}
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.3s;
}
.step-circle.done { background: var(--green); color: #fff; }
.step-circle.active { background: var(--orange); color: #fff; box-shadow: 0 0 0 4px rgba(217,119,6,0.18); }
/* was #d6d3d1 on #f5f5f4 = 1.37:1 — the step number was effectively invisible */
.step-circle.upcoming { background: #f5f5f4; color: var(--muted-strong); border: 1.5px solid #e7e5e4; }
.step-line {
  display: block;
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: #e7e5e4;
  min-width: 10px;
  margin-bottom: 16px;
}
.step-line.done { background: var(--green); }
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.step-label {
  /* 9px was below Apple's stated 11px iOS minimum. 10px + tighter tracking
     keeps the same footprint in the step rail while becoming legible. */
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.step-item:has(.step-circle.active) .step-label { color: var(--orange-text); }
.step-item:has(.step-circle.done) .step-label { color: var(--green-text); }
.signed-in { color: var(--orange-text) !important; font-weight: 600; }

/* SCREEN CONTENT */
.screen {
  flex: 1;
  overflow-y: auto;
  padding: 6px 20px 20px;
}

/* HEADINGS */
.step-heading { margin-bottom: 20px; }
.step-heading h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.step-heading p { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* FORMS */
.form-group { margin-bottom: 16px; }   /* 8pt grid (was 14) */
.form-label {
  display: block;
  font-size: 11px;                      /* was 10 — Apple's floor is 11 */
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  max-width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  /* 16px prevents iOS Safari from auto-zooming on focus, which used to
     push form fields off-screen and crop the Continue button. */
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--orange); }
/* Placeholder was #d6d3d1 = 1.75:1 on white — unreadable, and placeholder
   text is content the user is expected to read, not chrome. --muted gives
   4.80:1 and still reads as a placeholder because a real value is #1c1917
   at weight 500. */
.form-input::placeholder { color: var(--muted); }
/* Notes input: keep text 16px (iOS no-zoom) but shrink placeholder so it
   matches the surrounding fine-print style on the confirm page. */
.notes-input::placeholder { font-size: 13px; }
.form-input:read-only { background: var(--surface2); color: var(--muted-strong); }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 55px 90px; gap: 10px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 6px; font-weight: 600; }

/* Address autocomplete dropdown */
.addr-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-height: 220px; overflow-y: auto; margin-top: 2px;
}
.addr-item {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--surface2);
}
.addr-item:last-child { border-bottom: none; }
.addr-item:hover, .addr-item.addr-active { background: var(--surface2); }
.addr-main { font-size: 13px; font-weight: 600; color: var(--text); }
.addr-sec { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* BANNERS */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 500;
}
.banner-green {
  background: var(--green-light);
  border: 1px solid var(--green-border);
  color: #065f46;
}
.banner-orange {
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  color: var(--orange-text);      /* 3.09:1 -> 4.89:1 on the cream tint */
}
.banner-red {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.banner-icon { font-size: 14px; flex-shrink: 0; }

/* VEHICLE CARDS (postcard style) */
.vehicle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.v-postcard {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.v-postcard.selected { border-color: var(--orange); }
.v-postcard-img {
  height: 100px;
  background: linear-gradient(135deg, #f5f5f4, #e7e5e4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.v-postcard-img img {
  max-height: 80px;
  max-width: 90%;
  object-fit: contain;
}
.v-postcard-img .v-placeholder {
  width: 80px; height: 50px;
  background: #d6d3d1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #a8a29e;
}
.v-close {
  position: absolute;
  top: 6px; right: 6px;
  width: 32px; height: 32px;
  background: var(--surface);
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.v-close:hover { color: var(--red-text); border-color: var(--red); }
.v-postcard-body { padding: 8px 10px 10px; }
.v-postcard-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.v-postcard-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.v-postcard-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.v-pill {
  font-size: 10px; font-weight: 600;   /* was 9 */
  padding: 2px 7px; border-radius: 3px;
}
.v-pill-service { background: var(--orange-light); color: var(--orange-text); }
.v-pill-type { background: var(--surface2); color: var(--muted-strong); }

.add-card {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  cursor: pointer;
  gap: 6px;
  text-decoration: none;
}
.add-card:hover { border-color: var(--orange); }
.add-card-plus { font-size: 28px; color: var(--muted); font-weight: 300; }
.add-card-text { font-size: 13px; color: var(--muted); font-weight: 500; }
.add-card.placeholder-card {
  cursor: default;
  opacity: 0.35;
}
.add-card.placeholder-card:hover { border-color: var(--border); }

/* VEHICLE PICKER SUB-FLOW */
.picker-section { margin-bottom: 16px; }
.picker-search {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
}
.picker-search:focus { border-color: var(--orange); }

.alpha-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}
.alpha-btn {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alpha-btn:hover { border-color: var(--orange); color: var(--orange-text); }
.alpha-btn.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.alpha-btn.disabled { color: #d6d3d1; cursor: default; border-color: #f5f5f4; }

.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.brand-pill {
  padding: 10px 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.brand-pill:hover { border-color: var(--orange); color: var(--orange-text); }
.brand-pill.selected { border-color: var(--orange); background: var(--orange-light); color: var(--orange-text); }

.make-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--orange-text);
}
.make-chip-x {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.year-grid, .model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.year-btn, .model-btn {
  padding: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.year-btn:hover, .model-btn:hover { border-color: var(--orange); color: var(--orange-text); }
.year-btn.selected, .model-btn.selected { border-color: var(--orange); background: var(--orange-light); color: var(--orange-text); }

/* Vehicle confirmation */
.ride-confirm {
  text-align: center;
  padding: 20px 0;
}
.ride-confirm-img {
  width: 200px; height: 120px;
  background: linear-gradient(135deg, #f5f5f4, #e7e5e4);
  border-radius: var(--radius-lg);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.ride-confirm-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.ride-confirm-q {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}
.spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}
.spec-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface2);
  color: var(--muted-strong);
}

/* Tire size selection */
.tire-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.tire-col-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}
.tire-size-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.tire-size-btn:hover { border-color: var(--orange); }
.tire-size-btn.selected { border-color: var(--orange); background: var(--orange-light); color: var(--orange-text); }
.tire-trim { font-size: 11px; color: var(--muted); font-weight: 400; }

/* Add-on checkboxes */
.addon-check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.addon-checkbox {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--surface);
}
.addon-label { font-size: 12px; color: var(--muted); line-height: 1.45; cursor: pointer; }

/* Service type buttons */
.service-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.service-type-btn {
  padding: 16px 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.service-type-btn:hover { border-color: var(--orange); }
.service-type-btn.selected { border-color: var(--orange); background: var(--orange-light); }
.service-type-btn h3 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.service-type-btn p { font-size: 10px; color: var(--muted); line-height: 1.4; }

/* Skip links */
.skip-link {
  display: block;
  width: 100%;
  min-height: 44px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin: 12px 0;
  background: none;
  border: none;
  font-family: inherit;
}
.skip-link:hover { color: var(--text); }

/* UNKNOWN vehicle type selector */
.unknown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.unknown-btn {
  padding: 20px 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
}
.unknown-btn:hover { border-color: var(--orange); }

/* PIN SETUP */
.pin-setup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}
.pin-setup-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.pin-setup-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.pin-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.pin-digit {
  width: 44px; height: 48px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.pin-digit:focus { border-color: var(--orange); }
.pin-skip {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.pin-skip:hover { color: var(--text); }

/* STEP 4: CALENDAR */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
}
.filter-tab:hover { border-color: #d6d3d1; color: var(--text); }
.filter-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; }

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.week-nav-btn {
  font-size: 12px; font-weight: 600; color: var(--muted);
  cursor: pointer; background: none; border: none; font-family: inherit;
  min-height: 44px; padding: 0 10px;
}
.week-nav-btn:hover { color: var(--text); }
.week-nav-btn.hidden { visibility: hidden; }
.week-range { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cal-day-name { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.cal-day-num { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1.2; }
.cal-day-num.today { color: var(--orange); }
.cal-day-num.past { color: var(--muted); }
.cal-weather { display: flex; flex-direction: column; align-items: center; gap: 1px; margin-top: 2px; }
.cal-weather-icon { line-height: 1; }
.cal-weather-icon svg { width: 16px; height: 16px; }
.cal-weather-temp { font-size: 9px; font-weight: 600; color: var(--muted); }
.cal-weather-precip { font-size: 8px; font-weight: 700; color: var(--muted); }
.cal-weather-precip.precip-med { color: var(--orange-text); }
.cal-weather-precip.precip-high { color: var(--red-text); background: var(--red-bg); padding: 0 3px; border-radius: 3px; }
.cal-weather-precip .precip-mm { font-weight: 400; color: #6b7280; }

.cal-slots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.cal-slot-col { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.time-slot {
  padding: 5px 2px; border-radius: 6px; font-size: 8.5px; font-weight: 600;
  text-align: center; cursor: pointer; border: 1.5px solid transparent;
  background: var(--surface); color: var(--muted); transition: all 0.15s;
  line-height: 1.3; font-family: inherit;
}
.time-slot:hover { background: var(--surface2); }
.time-slot.best-fit { border-color: var(--green-border); color: #065f46; background: var(--green-light); }
.time-slot.best-fit:hover { background: rgba(5,150,105,0.18); }
.time-slot.available { border-color: var(--orange-border); color: var(--orange-text); background: var(--orange-light); }
.time-slot.available:hover { background: rgba(217,119,6,0.18); }
.time-slot.selected {
  border-color: var(--orange) !important;
  background: var(--orange) !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(217,119,6,0.3);
}
.no-slot { font-size: 10px; color: var(--muted); text-align: center; padding: 5px 2px; }

.cal-legend { display: flex; gap: 14px; justify-content: center; margin: 8px 0 14px; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-green { background: var(--green); }
.dot-orange { background: var(--orange); }

.selected-card {
  background: var(--surface);
  border: 1.5px solid var(--orange);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: none;
}
.selected-card.visible { display: block; }
.sc-badge {
  display: inline-block; font-size: 10px; font-weight: 800;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}
.sc-badge-best { background: var(--green-light); color: #065f46; border: 1px solid var(--green-border); }
.sc-badge-avail { background: var(--orange-light); color: var(--orange-text); border: 1px solid var(--orange-border); }
.sc-label { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.sc-time { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; line-height: 1.2; }
.sc-date { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--surface2) 25%, #ececec 50%, var(--surface2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-slot { height: 28px; margin-bottom: 4px; }

/* STEP 5: CONFIRM */
.summary-section { margin-bottom: 14px; }
.summary-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.summary-title { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); }
.summary-edit { font-size: 11px; font-weight: 700; color: var(--orange-text); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; }
.summary-row:not(:last-child) { border-bottom: 1px solid #f5f5f4; }
.sr-label { font-size: 12px; color: var(--muted); }
.sr-value { font-size: 12px; font-weight: 600; color: var(--text); text-align: right; }

.time-confirm-card {
  background: var(--green-light); border: 1px solid var(--green-border);
  border-radius: var(--radius-lg); padding: 14px; text-align: center;
}
.time-confirm-card.yellow { background: var(--yellow-light); border-color: var(--yellow-border); }
.time-confirm-card.red { background: var(--surface2); border-color: var(--border); }
.tc-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #065f46; margin-bottom: 4px; }
.tc-time { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.tc-date { font-size: 11px; color: var(--muted); margin-top: 2px; }

.total-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: var(--surface2);
  border-radius: var(--radius-lg); margin-bottom: 14px;
}
.total-label { font-size: 12px; font-weight: 600; color: var(--muted-strong); }
.total-value { font-size: 18px; font-weight: 800; color: var(--text); }

.otp-section { margin-bottom: 14px; }
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 10px 0 14px; }
.otp-digit {
  width: 44px; height: 48px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 6px;
  text-align: center; font-size: 18px; font-weight: 800;
  color: var(--text); font-family: inherit; outline: none;
}
.otp-digit:focus { border-color: var(--orange); }
.otp-digit.filled { border-color: var(--green); background: var(--green-light); }

.check-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.check-box {
  width: 18px; height: 18px; border: 1.5px solid var(--border);
  border-radius: 4px; flex-shrink: 0; margin-top: 1px; cursor: pointer;
  background: var(--surface); display: flex; align-items: center;
  justify-content: center; transition: all 0.15s;
}
.check-box.checked { background: var(--orange); border-color: var(--orange); }
.check-box.checked::after { content: '\2713'; color: #fff; font-size: 11px; font-weight: 800; }
.check-label { font-size: 13px; color: var(--muted); line-height: 1.5; cursor: pointer; }

/* BOTTOM NAV */
.bottom-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  background: var(--bg);
  gap: 10px;
}
.btn-back {
  padding: 10px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--muted);
  font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
  flex-shrink: 0; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn-back:hover { color: var(--text); border-color: #d6d3d1; }
.btn-back.hidden { visibility: hidden; }

.nav-mid {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-mid-text { font-size: 12px; color: var(--muted); white-space: nowrap; }
.nav-mid-price { font-size: 14px; font-weight: 800; color: var(--orange-text); white-space: nowrap; }

/* SET-B: 13px/700 white needed 4.5:1 and the brand fill gave 3.19:1. */
.btn-next {
  padding: 10px 20px; background: #b45309; border: none;
  border-radius: var(--radius-lg); color: #fff;
  font-size: 13px; font-weight: 700; font-family: inherit;
  cursor: pointer; letter-spacing: -0.2px;
  flex-shrink: 0; white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center;
  transition: background 0.15s;
}
.btn-next:hover { background: var(--orange-hover); }
.btn-next.green { background: var(--green); }
.btn-next.green:hover { background: #047857; }
.btn-next:disabled { opacity: 0.5; cursor: not-allowed; }

/* Loading state for buttons */
.btn-next.loading {
  position: relative;
  color: transparent;
}
.btn-next.loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* SUCCESS PAGE */
.success-wrap {
  text-align: center;
  padding: 40px 20px;
}
.success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.success-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.success-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.success-ref {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.success-ref strong {
  color: var(--text);
  font-weight: 700;
}
.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.btn-ics {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ics:hover { border-color: var(--orange); color: var(--orange-text); }
.btn-book-again {
  font-size: 13px;
  color: var(--orange-text);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
}
.btn-book-again:hover { text-decoration: underline; }

/* Utility classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ════════════════════════════════════════════════════════════════
   WAVE 08 — Mobile polish, touch targets, animations, responsive
   ════════════════════════════════════════════════════════════════ */

/* Prevent horizontal scroll anywhere in the portal */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
img { max-width: 100%; height: auto; }

/* iOS prevents input zoom only if font-size >= 16px. Override on mobile. */
@media (max-width: 640px) {
  .form-input,
  .picker-search,
  select.form-input,
  input[type="text"].form-input,
  input[type="tel"].form-input,
  input[type="email"].form-input,
  .acct-input {
    font-size: 16px;
  }
  /* OTP / PIN digits stay large already but enforce min 16px */
  .otp-digit,
  .pin-digit { font-size: 18px; }
}

/* Touch target minimums on mobile: 44px height for primary tap targets */
@media (max-width: 640px) {
  .btn-next,
  .btn-back,
  .btn-ics,
  .add-vehicle-btn,
  .add-another-btn,
  .asap-btn,
  .acct-btn,
  .not-me-btn,
  .cal-nav-btn {
    min-height: 44px;
  }
  .service-type-btn { min-height: 72px; }
  .block-option { min-height: 56px; }
  /* Buttons full-width on mobile where it makes sense */
  .add-vehicle-btn,
  .asap-btn,
  .acct-btn-block { width: 100%; }
  /* Avoid tiny tap targets: give day-cell enough spacing */
  .day-cell { min-height: 44px; }
}

/* Subtle press feedback on any interactive button */
button:not(:disabled):active,
.btn-next:not(:disabled):active,
.btn-back:active,
.brand-pill:active,
.year-btn:active,
.model-btn:active,
.alpha-btn:not(.disabled):active,
.service-type-btn:active,
.tire-size-btn:active,
.day-cell:not(:disabled):not(.empty):active,
.block-option:not(.unavail):active {
  transform: scale(0.98);
  transition: transform 0.05s ease-out;
}

/* Smooth fade-in for each screen to avoid abrupt reloads */
@keyframes portal-page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen { animation: portal-page-enter 0.2s ease-out; }

/* Generic shake animation (OTP templates reference this class) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.shake { animation: shake 0.3s; }

/* Status badges — rounded RECTANGLE, not pill (Wave 08 spec) */
.acct-badge {
  border-radius: var(--radius-sm);
}

/* Spinner utility (also available as .btn-next.loading pattern) */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(217,119,6,0.25);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Tablet: slightly wider portal container */
@media (min-width: 640px) {
  .portal-wrap { max-width: 520px; }
}

/* Desktop: centered card with subtle surrounding background */
@media (min-width: 1024px) {
  html, body { background: #efebe6; }
  .portal-wrap {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   UXP (2026-07-30) — OTP + INLINE-ERROR STYLES, MOVED HERE FROM A
   TEMPLATE THAT THE LIVE SCREENS NEVER LOAD.
   ════════════════════════════════════════════════════════════════
   Defect D1. These five rules lived ONLY inside otp_verify.html's inline
   <style> — the RETIRED legacy template. The screens a real customer
   actually reaches (book_otp.html, book_welcome.html, book.html) all use
   the same class names and none of them pull that stylesheet in, so on
   the live site:
     · "Wrong code. Try again." rendered as plain 16px BLACK body text —
       an error that did not look like an error (confirmed by eye in
       docs/gate-reports/fable-ux-polish/before/10-book-otp-error.png);
     · a wrong code did not turn the digit boxes red;
     · "We texted a code to" and the phone number were the same size, so
       the screen had no hierarchy at all;
     · "Resend in 60s" rendered as a raw grey browser button;
     · #ik-phone-err / #ik-name-err / #ik-windows-err / #ik-welcome-err —
       i.e. EVERY inline validation message in the booking wizard — were
       unstyled black text.
   They belong in portal.css because that is the one stylesheet every
   screen in the flow loads. otp_verify.html keeps its own copy; these are
   identical values, so the legacy screen is unchanged. */
.otp-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}
.otp-phone-display {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-top: 10px;
  margin-bottom: 4px;
  /* tabular figures so a phone number never wobbles between renders */
  font-variant-numeric: tabular-nums;
}
.otp-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin: 10px 0 0;
  min-height: 18px;
  font-weight: 600;
  line-height: 1.4;
}
.otp-digit.error { border-color: var(--red) !important; background: var(--red-bg) !important; }
@keyframes otp-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.otp-row.shake { animation: otp-shake 0.4s ease; }
.otp-resend {
  display: block; text-align: center; margin-top: 14px;
  font-size: 13px; color: var(--muted);
}
.otp-resend button {
  background: none; border: none; color: var(--orange-text);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: underline;
  /* 44px tap target — it was a bare inline <button> before */
  min-height: 44px; padding: 0 8px;
}
.otp-resend button:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

/* ── Inline errors inside the wizard (not centred like the OTP one) ── */
.wizard-step .otp-error { text-align: left; margin-top: 8px; }

/* ════════════════════════════════════════════════════════════════
   UXP — VISIBLE KEYBOARD FOCUS (defect D5)
   ════════════════════════════════════════════════════════════════
   Every text input in this file carried `outline: none` with nothing put
   back, and no button had a focus style at all — so a keyboard or
   switch-control user had NO way to see where they were. :focus-visible
   (not :focus) means a mouse/touch tap still shows nothing, so the
   look is unchanged for the way most customers use this. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.form-input:focus-visible,
.picker-search:focus-visible,
.otp-digit:focus-visible,
.pin-digit:focus-visible,
.acct-input:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 1px;
  border-color: var(--orange);
}

/* ════════════════════════════════════════════════════════════════
   UXP — TAP-TARGET FLOOR, applied at every width, not just <=640px
   ════════════════════════════════════════════════════════════════
   The existing 44px block below only fires under 640px. A tablet or a
   desktop-with-touch gets the same thumb, so the floor is unconditional
   for the small text-only controls that were the worst offenders. */
.skip-link,
.pin-skip,
.week-nav-btn,
.summary-edit,
.btn-book-again,
.otp-resend button,
.sign-in {
  min-height: 44px;
}
/* Icon-sized controls: keep the drawn size, grow the HIT box underneath
   (Apple HIG — the art may be smaller than the target). */
.v-close::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 44px; height: 44px;
  transform: translate(-50%, -50%);
}
