/* ==================================================================
   CheapCarfaxAutocheck Design System v2.0
   ==================================================================
   Single source of truth for all site styles.
   Clean-slate rewrite — BEM naming, two-tier tokens, Google Fonts.

   Section Structure:
     1. Design Tokens (CSS Custom Properties)
     2. Reset & Base
     3. Typography
     4. Layout
     5. Components       (Plan 02)
     6. Utilities         (Plan 02)
     7. Responsive        (Plan 02)
     8. Animations        (Plan 02)
   ================================================================== */


/* ==================================================================
   SECTION 1: DESIGN TOKENS
   ==================================================================
   Two-tier system:
     - Primitives: raw color/size values (--color-slate-800, --space-4)
     - Semantic aliases: purpose-driven references (--color-primary, --color-cta)
   ================================================================== */

:root {

  /* ----------------------------------------------------------
     1a. Color Primitives
     ---------------------------------------------------------- */

  /* Slate scale */
  --color-slate-50:  #F8FAFC;
  --color-slate-100: #F1F5F9;
  --color-slate-200: #E2E8F0;
  --color-slate-300: #CBD5E1;
  --color-slate-400: #94A3B8;
  --color-slate-500: #64748B;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1E293B;
  --color-slate-900: #0F172A;

  /* Red scale */
  --color-red-50:  #FEF2F2;
  --color-red-100: #FEE2E2;
  --color-red-200: #FECACA;
  --color-red-300: #FCA5A5;
  --color-red-400: #F87171;
  --color-red-500: #EF4444;
  --color-red-600: #DC2626;
  --color-red-700: #B91C1C;

  /* Status greens */
  --color-green-500: #22C55E;
  --color-green-600: #16A34A;

  /* Status amber */
  --color-amber-500: #F59E0B;

  /* Status blue */
  --color-blue-500: #3B82F6;

  /* Gold accent */
  --color-gold:       #d4a017;
  --color-gold-hover:  #c49315;

  /* ----------------------------------------------------------
     1b. Semantic Color Aliases
     ---------------------------------------------------------- */

  --color-primary:       var(--color-slate-800);
  --color-secondary:     var(--color-slate-700);
  --color-cta:           var(--color-red-600);
  --color-cta-hover:     var(--color-red-700);

  --color-bg:            var(--color-slate-50);
  --color-bg-card:       #FFFFFF;

  --color-text:          var(--color-slate-900);
  --color-text-muted:    var(--color-slate-500);
  --color-text-subtle:   var(--color-slate-400);

  --color-border:        var(--color-slate-200);
  --color-border-strong: var(--color-slate-300);

  --color-success:       var(--color-green-600);
  --color-warning:       var(--color-amber-500);
  --color-error:         var(--color-red-600);
  --color-info:          var(--color-blue-500);

  --color-focus:         var(--color-blue-500);
  --focus-ring:          0 0 0 3px rgba(59, 130, 246, 0.4);

  /* ----------------------------------------------------------
     1c. Typography Tokens
     ---------------------------------------------------------- */

  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type scale */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */

  /* Font weights */
  --font-light:    300;
  --font-regular:  400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;

  /* Line heights */
  --leading-none:    1;
  --leading-tight:   1.2;
  --leading-snug:    1.375;
  --leading-normal:  1.5;
  --leading-relaxed: 1.6;
  --leading-loose:   2;

  /* ----------------------------------------------------------
     1d. Spacing Scale (4px base)
     ---------------------------------------------------------- */

  --space-0:   0;
  --space-0-5: 0.125rem;  /* 2px */
  --space-1:   0.25rem;   /* 4px */
  --space-2:   0.5rem;    /* 8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */
  --space-32:  8rem;      /* 128px */

  /* ----------------------------------------------------------
     1e. Border Radius
     ---------------------------------------------------------- */

  --radius-sm:   0.25rem;  /* 4px */
  --radius-md:   0.5rem;   /* 8px */
  --radius-lg:   0.75rem;  /* 12px */
  --radius-xl:   1rem;     /* 16px */
  --radius-full: 9999px;

  /* ----------------------------------------------------------
     1f. Shadow Tokens (multi-layer, soft UI)
     ---------------------------------------------------------- */

  --shadow-xs:  0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:  0 1px 3px rgba(15, 23, 42, 0.06),
                0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:  0 4px 6px -1px rgba(15, 23, 42, 0.06),
                0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg:  0 10px 15px -3px rgba(15, 23, 42, 0.06),
                0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl:  0 20px 25px -5px rgba(15, 23, 42, 0.08),
                0 8px 10px -6px rgba(15, 23, 42, 0.04);

  /* ----------------------------------------------------------
     1g. Transition Tokens
     ---------------------------------------------------------- */

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* ----------------------------------------------------------
     1h. Z-Index Scale
     ---------------------------------------------------------- */

  --z-dropdown: 100;
  --z-sticky:   200;
  --z-modal:    300;
  --z-toast:    400;
  --z-tooltip:  500;
}


/* ==================================================================
   SECTION 2: RESET & BASE
   ==================================================================
   Modern CSS reset with sensible defaults.
   ================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  /* Safety net: prevent any rogue child from forcing page-level horizontal
     scroll. `clip` is preferred over `hidden` because it doesn't create
     a new scroll container (keeps position:sticky working on descendants). */
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100vw;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: inherit;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

::selection {
  background-color: var(--color-primary);
  color: var(--color-bg-card);
}


/* ==================================================================
   SECTION 3: TYPOGRAPHY
   ==================================================================
   Heading styles, body text, inline elements, text utilities.
   Font families: Inter (headings), Source Sans 3 (body).
   ================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a:not([class]) {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:not([class]):hover {
  text-decoration: underline;
  color: var(--color-secondary);
}

strong, b {
  font-weight: var(--font-bold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
  background-color: var(--color-slate-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: var(--text-sm);
  background-color: var(--color-slate-100);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

blockquote {
  border-left: 4px solid var(--color-border-strong);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  font-style: italic;
}

mark {
  background-color: var(--color-amber-500);
  color: var(--color-text);
  padding: var(--space-0) var(--space-1);
  border-radius: var(--radius-sm);
}

/* Icon base style */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Text size utilities */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }
.text-5xl  { font-size: var(--text-5xl); }


/* ==================================================================
   SECTION 4: LAYOUT
   ==================================================================
   Container, grid, flex, and section helpers.
   ================================================================== */

.container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* Grid system */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 767px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Flex helpers */
.flex {
  display: flex;
}

.flex--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex--wrap {
  display: flex;
  flex-wrap: wrap;
}

.flex--col {
  display: flex;
  flex-direction: column;
}

/* Stack: vertical flex with gap — for form layouts, content stacks */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--sm {
  gap: var(--space-2);
}

.stack--lg {
  gap: var(--space-8);
}

/* Section spacing */
.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.section--sm {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ==================================================================
   SECTION 5: COMPONENTS
   ==================================================================
   BEM-based component library. All values use var() token references.
   ================================================================== */


/* ----------------------------------------------------------
   5a. Buttons (.btn)
   ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: var(--font-medium);
  font-size: var(--text-base);
  line-height: 1;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: var(--space-2) var(--space-5);
  transition: background-color var(--transition-base),
              color var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base),
              opacity var(--transition-base);
}

/* Variants */
.btn--primary {
  background-color: var(--color-cta);
  color: var(--color-bg-card);
}

.btn--primary:hover {
  background-color: var(--color-cta-hover);
}

.btn--secondary {
  background-color: var(--color-primary);
  color: var(--color-bg-card);
}

.btn--secondary:hover {
  background-color: var(--color-secondary);
}

.btn--ghost {
  background-color: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn--ghost:hover {
  background-color: var(--color-primary);
  color: var(--color-bg-card);
}

.btn--danger {
  background-color: var(--color-error);
  color: var(--color-bg-card);
}

.btn--danger:hover {
  background-color: var(--color-cta-hover);
}

.btn--gold {
  background-color: var(--color-gold);
  color: var(--color-bg-card);
  font-weight: var(--font-bold);
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.btn--gold:hover {
  background-color: var(--color-gold-hover);
}

/* Sizes */
.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.btn--lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-lg);
}

/* Icon-only button */
.btn--icon {
  padding: var(--space-2);
}

.btn--icon.btn--sm {
  padding: var(--space-1);
}

.btn--icon.btn--lg {
  padding: var(--space-3);
}

/* Loading state */
.btn--loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn__spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

/* Disabled state */
.btn:disabled,
.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Focus state */
.btn:focus-visible {
  box-shadow: var(--shadow-sm), var(--focus-ring);
  outline: none;
}

/* Icon inside button */
.btn__icon {
  flex-shrink: 0;
}

/* Full-width button */
.btn--block {
  width: 100%;
}


/* ----------------------------------------------------------
   5b. Cards (.card)
   ---------------------------------------------------------- */

.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.card--elevated {
  box-shadow: var(--shadow-md);
  border: none;
}

.card--interactive {
  cursor: pointer;
  transition: box-shadow var(--transition-base);
}

.card--interactive:hover {
  box-shadow: var(--shadow-lg);
}

.card__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.card__body {
  padding: var(--space-5);
}

.card__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  background-color: var(--color-slate-50);
}

.card__title {
  font-family: var(--font-heading);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.card__subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}


/* ----------------------------------------------------------
   5c. Forms (.form-group, .form-input, .form-select, etc.)
   ---------------------------------------------------------- */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.form-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg-card);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

.form-input--lg {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-lg);
}

.form-input--error {
  border-color: var(--color-error);
}

.form-input--error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.form-input--valid {
  border-color: var(--color-success);
}

.form-input:disabled {
  background-color: var(--color-slate-100);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Textarea */
.form-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background-color: var(--color-bg-card);
  min-height: 120px;
  resize: vertical;
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

/* Select */
.form-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  padding-right: var(--space-10);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background-color: var(--color-bg-card);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: var(--space-4);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

/* Help text */
.form-help {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Error message */
.form-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-1);
}

/* Checkbox and Radio */
.form-checkbox,
.form-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-base);
}

.form-checkbox input[type="checkbox"],
.form-radio input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Toggle switch */
.form-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-toggle__track {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  background-color: var(--color-slate-300);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.form-toggle__thumb {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.form-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-toggle input[type="checkbox"]:checked + .form-toggle__track {
  background-color: var(--color-primary);
}

.form-toggle input[type="checkbox"]:checked + .form-toggle__track .form-toggle__thumb {
  transform: translateX(1.25rem);
}

.form-toggle input[type="checkbox"]:focus-visible + .form-toggle__track {
  box-shadow: var(--focus-ring);
}

/* File upload */
.form-file {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-slate-50);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast),
              background-color var(--transition-fast);
  text-align: center;
}

.form-file:hover {
  border-color: var(--color-primary);
  background-color: var(--color-bg-card);
}

/* Search input */
.form-search {
  padding-left: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: var(--space-3) center;
  background-size: var(--space-4);
}


/* ----------------------------------------------------------
   5d. Tables (.table)
   ---------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  font-weight: var(--font-semibold);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-slate-50);
  border-bottom: 2px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.table--striped tbody tr:nth-child(even) {
  background-color: var(--color-slate-50);
}

.table--hoverable tbody tr:hover {
  background-color: var(--color-slate-100);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table__empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-8);
}


/* ----------------------------------------------------------
   5e. Badges (.badge)
   ---------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 1;
  white-space: nowrap;
}

.badge--default {
  background-color: var(--color-slate-100);
  color: var(--color-slate-700);
}

.badge--success {
  background-color: var(--color-green-500);
  color: var(--color-bg-card);
}

.badge--warning {
  background-color: var(--color-amber-500);
  color: var(--color-text);
}

.badge--error {
  background-color: var(--color-error);
  color: var(--color-bg-card);
}

.badge--info {
  background-color: var(--color-info);
  color: var(--color-bg-card);
}

.badge--lg {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}


/* ----------------------------------------------------------
   5f. Alerts (.alert)
   ---------------------------------------------------------- */

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-border-strong);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.alert--info {
  background-color: rgba(59, 130, 246, 0.08);
  border-left-color: var(--color-info);
}

.alert--success {
  background-color: rgba(34, 197, 94, 0.08);
  border-left-color: var(--color-success);
}

.alert--warning {
  background-color: rgba(245, 158, 11, 0.08);
  border-left-color: var(--color-warning);
}

.alert--error {
  background-color: rgba(220, 38, 38, 0.08);
  border-left-color: var(--color-error);
}

.alert__icon {
  flex-shrink: 0;
  margin-top: var(--space-0-5);
}

.alert__content {
  flex: 1;
  min-width: 0;
}

.alert__title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.alert__dismiss {
  flex-shrink: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  background: none;
  border: none;
  padding: var(--space-1);
}

.alert__dismiss:hover {
  color: var(--color-text);
}


/* ----------------------------------------------------------
   5g. Modals (.modal)
   ---------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  animation: scaleIn var(--transition-base);
}

.modal--sm {
  max-width: 400px;
}

.modal--md {
  max-width: 560px;
}

.modal--lg {
  max-width: 720px;
}

.modal-wide {
  max-width: 900px;
}

.modal__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

.modal__body {
  padding: var(--space-5);
}

.modal__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-fast),
              background-color var(--transition-fast);
  background: none;
  border: none;
}

.modal__close:hover {
  color: var(--color-text);
  background-color: var(--color-slate-100);
}


/* ----------------------------------------------------------
   5h. Navigation (.navbar, .sidebar)
   ---------------------------------------------------------- */

.navbar {
  background-color: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.navbar__brand {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
  margin-right: auto;
}

.navbar__brand img {
  width: 36px;
  height: 36px;
  max-height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar__item {
  display: flex;
  align-items: center;
}

.navbar__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: color var(--transition-fast),
              background-color var(--transition-fast);
}

.navbar__link:hover,
.navbar__link--active {
  color: var(--color-text);
  background-color: var(--color-slate-100);
}

/* Nav tabs */
.nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-1);
}

.nav-tabs__item {
  display: flex;
}

.nav-tabs__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color var(--transition-fast),
              border-color var(--transition-fast);
  margin-bottom: -1px;
}

.nav-tabs__link:hover {
  color: var(--color-text);
}

.nav-tabs__link--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-cta);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  width: 260px;
  min-height: 100vh;
  background-color: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
}

.sidebar__item {
  display: flex;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast),
              background-color var(--transition-fast);
}

.sidebar__link:hover {
  color: var(--color-text);
  background-color: var(--color-slate-100);
}

.sidebar__link--active {
  color: var(--color-primary);
  background-color: var(--color-slate-100);
  font-weight: var(--font-semibold);
}


/* ----------------------------------------------------------
   5i. Dropdowns (.dropdown)
   ---------------------------------------------------------- */

.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown__trigger {
  cursor: pointer;
}

.dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  min-width: 200px;
  z-index: var(--z-dropdown);
  opacity: 0;
  pointer-events: none;
  transform: translateY(var(--space-1));
  transition: opacity var(--transition-fast),
              transform var(--transition-fast);
  padding: var(--space-1) 0;
}

.dropdown--open .dropdown__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown__item:hover {
  background-color: var(--color-slate-50);
}

.dropdown__divider {
  border-top: 1px solid var(--color-border);
  margin: var(--space-1) 0;
}

/* Hover-open variant — used by nav menus (keyboard-accessible via focus-within).
   Click-toggle dropdowns (e.g. account menu) use .dropdown--open instead. */
.dropdown--hover:hover .dropdown__menu,
.dropdown--hover:focus-within .dropdown__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown--hover .dropdown__trigger {
  cursor: pointer;
}


/* ----------------------------------------------------------
   5j. Tabs (.tabs)
   ---------------------------------------------------------- */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-1);
}

.tabs__tab {
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition-fast),
              border-color var(--transition-fast);
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tabs__tab:hover {
  color: var(--color-text);
}

.tabs__tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-cta);
}

.tabs--underline .tabs__tab--active {
  border-bottom-width: 1px;
}


/* ----------------------------------------------------------
   5k. Tooltips (.tooltip)
   ---------------------------------------------------------- */

.tooltip {
  position: relative;
  display: inline-flex;
}

.tooltip__content {
  position: absolute;
  background-color: var(--color-slate-900);
  color: var(--color-bg-card);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  white-space: nowrap;
  z-index: var(--z-tooltip);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  line-height: var(--leading-normal);
}

/* Top (default) */
.tooltip--top .tooltip__content,
.tooltip .tooltip__content {
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
}

.tooltip--bottom .tooltip__content {
  top: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
}

.tooltip--left .tooltip__content {
  right: calc(100% + var(--space-2));
  top: 50%;
  transform: translateY(-50%);
}

.tooltip--right .tooltip__content {
  left: calc(100% + var(--space-2));
  top: 50%;
  transform: translateY(-50%);
}

.tooltip:hover .tooltip__content {
  opacity: 1;
}


/* ----------------------------------------------------------
   5l. Breadcrumbs (.breadcrumb)
   ---------------------------------------------------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__separator {
  color: var(--color-text-subtle);
  margin: 0 var(--space-1);
}

.breadcrumb__link {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb__link:hover {
  color: var(--color-primary);
}

.breadcrumb__current {
  color: var(--color-text);
  font-weight: var(--font-medium);
}


/* ----------------------------------------------------------
   5m. Pagination (.pagination)
   ---------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
  background: var(--color-bg-card);
  min-width: var(--space-8);
}

.pagination__item:hover {
  background-color: var(--color-slate-50);
  border-color: var(--color-border-strong);
}

.pagination__item--active {
  background-color: var(--color-primary);
  color: var(--color-bg-card);
  border-color: var(--color-primary);
}

.pagination__item--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination__prev,
.pagination__next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color var(--transition-fast),
              color var(--transition-fast);
  background: var(--color-bg-card);
  text-decoration: none;
}

.pagination__prev:hover,
.pagination__next:hover {
  background-color: var(--color-slate-50);
  color: var(--color-text);
}


/* ----------------------------------------------------------
   5n. Toasts (.toast)
   ---------------------------------------------------------- */

.toast-container {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: slideUp var(--transition-base);
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  border-left: 4px solid var(--color-border-strong);
}

.toast--success {
  border-left-color: var(--color-success);
}

.toast--error {
  border-left-color: var(--color-error);
}

.toast--warning {
  border-left-color: var(--color-warning);
}

.toast--info {
  border-left-color: var(--color-info);
}

.toast__dismiss {
  margin-left: auto;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  background: none;
  border: none;
  padding: var(--space-1);
}

.toast__dismiss:hover {
  color: var(--color-text);
}


/* ----------------------------------------------------------
   5n. Pricing Page
   ---------------------------------------------------------- */

.pricing-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--navbar-h, 64px) + 2rem) var(--space-4) var(--space-8);
}

.pricing-section {
  margin-bottom: var(--space-12);
}

.pricing-section__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.pricing-section__subtitle {
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.pricing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}
.pricing-grid > * {
  flex: 1 1 300px;
  max-width: 420px;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}
.pricing-grid > *:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card--popular {
  position: relative;
  border: 2px solid #d4a017;
  box-shadow: 0 4px 16px rgba(212, 160, 23, 0.15);
}

.pricing-card__savings {
  display: inline-block;
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
}

.pricing-card__price {
  font-size: var(--text-4xl, 2.25rem);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  line-height: 1.2;
}

.pricing-card__period {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0;
  text-align: left;
}

.pricing-card__features li {
  padding: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  line-height: 1.5;
}

.oneoff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  text-align: center;
}

@media (max-width: 640px) {
  .pricing-grid > * {
    flex: 1 1 100%;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .oneoff-grid {
    grid-template-columns: 1fr;
  }
}

/* ── CTA Banner ─────────────────────────────────────────────── */
.cta-banner {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  border: 2px solid var(--color-gold);
  margin-top: var(--space-6);
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
  opacity: 0;
  transform: translateY(8px);
  animation: ctaBannerIn 300ms ease-out forwards;
}
@keyframes ctaBannerIn {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cta-banner { opacity: 1; transform: none; animation: none; }
}
.cta-banner__dismiss {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  background: none;
  border: none;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cta-banner__headline {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text);
}
.cta-banner__text {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.cta-banner__price-compare {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  align-items: center;
  margin: var(--space-3) 0;
}
.cta-banner__price-old {
  text-decoration: line-through;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}
.cta-banner__price-new {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-success);
}
.cta-banner__button {
  margin-top: var(--space-3);
}

/* ── Guest Credit Indicator (VIN results) ──────────────────── */
.credit-indicator--guest {
  font-size: var(--text-sm);
  color: var(--color-success);
  font-weight: var(--font-bold);
  margin-top: var(--space-1);
}

/* ── Member Savings (pricing page) ──────────────────────────── */
.member-savings {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  margin: var(--space-8) 0;
  text-align: center;
}
.member-savings__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-2);
}
.member-savings__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-6);
}
.member-savings__grid {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.member-savings__card {
  flex: 1;
  min-width: 160px;
  max-width: 220px;
  padding: var(--space-4);
}
.member-savings__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.member-savings__prices {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}
.member-savings__guest-price {
  text-decoration: line-through;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}
.member-savings__member-price {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-success);
}
.member-savings__badge {
  display: inline-block;
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-success);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
}

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-slate-100) 25%,
    var(--color-slate-200) 50%,
    var(--color-slate-100) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}
.skeleton--rounded { border-radius: var(--radius-full); }
.skeleton--lg { border-radius: var(--radius-lg); }

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: var(--color-slate-100);
  }
}


/* ==================================================================
   SECTION 6: UTILITIES
   ==================================================================
   Essential utility classes. Not full Tailwind — just the most used.
   ================================================================== */

/* Text alignment */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Display */
.d-none        { display: none; }
.d-block       { display: block; }
.d-flex        { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid        { display: grid; }

/* Flex utilities */
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.flex-1          { flex: 1; }
.flex-shrink-0   { flex-shrink: 0; }

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* Margin top */
.mt-0 { margin-top: var(--space-0); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* Margin bottom */
.mb-0 { margin-bottom: var(--space-0); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Margin horizontal auto */
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Padding */
.p-0 { padding: var(--space-0); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Visibility */
.hidden  { display: none; }
.visible { visibility: visible; }

/* Text overflow */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Border radius */
.rounded-full {
  border-radius: var(--radius-full);
}

/* Text colors */
.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }

/* Font weights */
.font-medium   { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold     { font-weight: var(--font-bold); }


/* ==================================================================
   SECTION 7: RESPONSIVE
   ==================================================================
   Breakpoints: 375px (small mobile), 768px (tablet),
                1024px (desktop), 1440px (wide).
   ================================================================== */

/* Small mobile (up to 374px) */
@media (max-width: 374px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }

  .container {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .d-none--mobile { display: none; }
  .d-block--mobile { display: block; }

  .navbar__menu {
    display: none;
  }

  /* Hide brand text on mobile — keep logo only to free space for auth buttons */
  .navbar__brand span {
    display: none;
  }

  /* Navbar flex row: allow children to shrink below intrinsic content size
     so nothing overflows the viewport. `min-width: 0` on flex children is
     required for proper shrinkage in CSS flexbox. */
  .navbar > .container {
    gap: var(--space-2);
    min-width: 0;
    max-width: 100%;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .navbar__brand,
  .navbar__actions {
    min-width: 0;
  }
  .navbar__actions {
    flex-shrink: 0;
  }
  /* Tighten the auth buttons on mobile so two buttons (Login + Sign Up)
     comfortably fit alongside the logo. */
  .navbar__actions .btn {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
    font-size: var(--text-sm);
  }

  .navbar--open .navbar__menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2);
    box-shadow: var(--shadow-md);
  }

  /* Keep `.table-responsive` as the scroll container (see .table-responsive
     base rule). Do NOT set `display: block` on the inner `.table` — that
     breaks table layout containment and leaks overflow to the page level. */
  .table-responsive {
    max-width: 100%;
  }
  .table-responsive .table {
    min-width: max-content;
  }

  .modal {
    margin: var(--space-4);
    max-height: calc(100vh - var(--space-8));
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* CTA Banner responsive */
@media (max-width: 767px) {
  .cta-banner { max-width: 100%; padding: var(--space-4); }
  .member-savings { padding: var(--space-4); }
  .member-savings__grid { flex-direction: column; align-items: center; }
  .member-savings__card { max-width: 100%; }
}
@media (max-width: 374px) {
  .cta-banner__price-compare { flex-direction: column; }
}

/* ==================================================================
   Report Slider — Disabled / Loading State (D-08)
   ================================================================== */
.slider:disabled,
.report-slider--loading {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Tablet (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .d-none--tablet { display: none; }
}

/* Desktop and up (1024px+) */
@media (min-width: 1024px) {
  .d-none--desktop { display: none; }

  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* Wide screens (1440px+) */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
}


/* ==================================================================
   SECTION 8: ANIMATIONS
   ==================================================================
   CSS keyframe animations, transition presets, and reduced motion.
   ================================================================== */

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(var(--space-3));
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes slideDown {
  from {
    transform: translateY(calc(-1 * var(--space-2)));
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Transition presets */
.transition-fast { transition: all var(--transition-fast); }
.transition-base { transition: all var(--transition-base); }
.transition-slow { transition: all var(--transition-slow); }

/* Animation utilities */
.animate-fade-in  { animation: fadeIn var(--transition-base); }
.animate-slide-up { animation: slideUp var(--transition-base); }
.animate-scale-in { animation: scaleIn var(--transition-fast); }
.animate-spin     { animation: spin 1s linear infinite; }

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.processing-overlay__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-bg-card);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.processing-overlay__message {
    color: var(--color-bg-card);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    margin-top: var(--space-4);
}
.processing-overlay__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-bg-card);
    font-size: var(--text-2xl);
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 300ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.processing-overlay__close:hover { background: rgba(255, 255, 255, 0.3); }
.processing-overlay__timeout {
    color: var(--color-slate-300, #cbd5e1);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

/* ═══════════════════════════════════════════════
   Hero Collapse & VIN Results Section (D-11, D-12, D-13)
   ═══════════════════════════════════════════════ */
/* Collapsed hero: thin white bar with horizontal search */
section.hero.hero--collapsed {
  background: #fff !important;
  min-height: auto !important;
  padding-top: calc(var(--navbar-h, 64px) + 12px) !important;
  padding-bottom: 12px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  display: block !important;
}
.hero--collapsed .hero__headline,
.hero--collapsed .hero__subtitle,
.hero--collapsed .hero__trust,
.hero--collapsed .hero__stats { display: none !important; }
.hero--collapsed .container { color: var(--color-text); }
.hero--collapsed .hero__search {
  flex-direction: row !important;
  align-items: center !important;
  max-width: 800px;
  margin: 0 auto;
  gap: 8px !important;
}
.hero--collapsed .hero__search .form-input {
  color: var(--color-text) !important;
  background: var(--color-bg, #f8fafc) !important;
  border: 1px solid var(--color-border) !important;
  flex: 1 !important;
  width: auto !important;
  text-align: left !important;
  font-size: 15px !important;
  padding: 10px 16px !important;
}
.hero--collapsed .hero__search .btn {
  width: auto !important;
  max-width: none !important;
  white-space: nowrap;
  padding: 10px 24px !important;
}
.hero--collapsed #vinFeedback {
  color: var(--color-text-muted);
  text-align: center;
  font-size: var(--text-sm);
}

/* Mobile: stack the collapsed hero search vertically so input and button
   each get full width. Horizontal row was cramping the button text on
   narrow viewports and made the page reflow awkwardly after VIN/plate submit. */
@media (max-width: 767px) {
  section.hero.hero--collapsed {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: calc(var(--navbar-h, 64px) + 8px) !important;
    padding-bottom: 10px !important;
  }

  .hero--collapsed .hero__search {
    flex-direction: column !important;
    gap: 8px !important;
    max-width: 100%;
  }

  .hero--collapsed .hero__search .form-input {
    width: 100% !important;
    flex: 0 0 auto !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
  }

  .hero--collapsed .hero__search .btn {
    width: 100% !important;
    padding: 10px 16px !important;
  }

  #results-section {
    padding: 20px 16px 40px;
  }
}

/* Results section: light bg, full width, centered content */
#results-section {
  transition: opacity 300ms ease;
  background: var(--color-bg, #f8fafc);
  padding: 48px 24px 64px;
}
#results-section .container {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
#results-section h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-1);
  color: var(--color-text);
}
#results-section p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  font-size: var(--text-base);
}

#report-options {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto 32px;
}

/* Promo text below cards */
.results-promo {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
}
.results-guarantee {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}

.report-card__owned {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-success);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.report-card__owned--dark {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    border-color: var(--color-success);
}
.report-card__view-btn { width: 100%; margin-bottom: var(--space-2); }
.report-card__rebuy {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-decoration: underline;
    cursor: pointer;
    display: block;
    text-align: center;
}
.report-card__rebuy:hover { color: var(--color-text); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
