/* ============================================================
   Tripcosto — Design System & Component Styles
   ============================================================
   Sections:
   1. Custom properties (tokens)
   2. Reset & base
   3. Typography
   4. Layout utilities
   5. Header / nav
   6. Hero section
   7. Estimator card
   8. Segmented tier control
   9. Results section
   10. Map panel
   11. AI assistant panel
   12. Trust / How it works section
   13. Footer
   14. Autocomplete dropdown
   15. Toast
   16. Reveal animations
   17. Responsive (mobile-first)
   18. Dark mode
   19. Reduced motion
   20. SEO page classes
   ============================================================ */

/* ─── 1. Custom Properties ──────────────────────────────────── */
:root {
  /* Brand gradient */
  --grad-hero: linear-gradient(120deg, #FF6B6B 0%, #FFD166 28%, #06D6A0 64%, #118AB2 100%);
  --grad-hero-shift: linear-gradient(120deg, #118AB2 0%, #06D6A0 28%, #FFD166 64%, #FF6B6B 100%);

  /* Brand colors */
  --c-coral:  #FF6B6B;
  --c-amber:  #FFD166;
  --c-teal:   #06D6A0;
  --c-blue:   #118AB2;
  --c-violet: #6C5CE7;

  /* Neutrals */
  --c-ink:   #16182E;
  --c-slate: #5A6478;
  --c-mist:  #F4F7FB;
  --c-card:  rgba(255,255,255,0.82);
  --c-white: #FFFFFF;

  /* Surfaces */
  --c-surface:       #FFFFFF;
  --c-surface-alt:   #F4F7FB;
  --c-border:        rgba(22, 24, 46, 0.08);
  --c-border-strong: rgba(22, 24, 46, 0.15);

  /* Typography */
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* Scale (fluid where possible) */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  2.75rem;
  --text-5xl:  3.75rem;

  /* Weight */
  --fw-normal:    400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;

  /* Shape */
  --radius:    18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-full: 999px;

  /* Shadows */
  --shadow:     0 10px 40px -12px rgba(20, 24, 46, 0.25);
  --shadow-sm:  0 2px 8px -2px rgba(20, 24, 46, 0.12);
  --shadow-lg:  0 24px 64px -16px rgba(20, 24, 46, 0.35);
  --shadow-glow: 0 0 32px rgba(6, 214, 160, 0.3);

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 300ms;
  --duration-slow: 600ms;
}


/* ─── 2. Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  color: var(--c-ink);
  background-color: var(--c-white);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

a {
  color: var(--c-violet);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--c-blue);
}

ul, ol {
  list-style: none;
}


/* ─── 3. Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.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-muted  { color: var(--c-slate); }
.text-center { text-align: center; }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold); }


/* ─── 4. Layout Utilities ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container--narrow {
  max-width: 760px;
}

.section {
  padding: var(--space-16) 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* ─── 5. Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px) saturate(1.8);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  border-bottom: 1px solid var(--c-border);
  padding: var(--space-3) 0;
  transition: box-shadow var(--duration) var(--ease-out);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Wordmark */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  color: var(--c-ink);
}

.site-logo__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--grad-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.site-logo__wordmark span {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav a {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--c-slate);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  transition: color var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out);
}

.site-nav a:hover {
  color: var(--c-ink);
  background: var(--c-mist);
}

/* Focus visible */
:focus-visible {
  outline: 2.5px solid var(--c-violet);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}


/* ─── 6. Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-20) 0 var(--space-10);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--grad-hero);
  background-size: 300% 300%;
  animation: heroShift 12s ease-in-out infinite alternate;
  z-index: 0;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 50%, transparent 30%, rgba(22, 24, 46, 0.25) 100%);
}

@keyframes heroShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: start;
  width: 100%;
}

@media (min-width: 960px) {
  .hero__content {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-16);
  }
}

.hero__text {
  color: #fff;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  color: rgba(255,255,255,0.92);
  margin-bottom: var(--space-5);
}

.hero__headline {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, var(--text-5xl));
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: #fff;
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 20px rgba(22,24,46,0.15);
}

.hero__sub {
  font-size: clamp(var(--text-base), 2vw, var(--text-xl));
  color: rgba(255,255,255,0.85);
  max-width: 440px;
  margin-bottom: var(--space-8);
  line-height: 1.65;
}

.hero__badges {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.hero__badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.2);
}


/* ─── 7. Estimator Card ─────────────────────────────────────── */
.estimator-card {
  background: var(--c-card);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.3) inset;
  position: relative;
}

.estimator-card__title {
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Input group */
.form-group {
  margin-bottom: var(--space-5);
  position: relative;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: 2.8rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--c-ink);
  background: rgba(244,247,251,0.7);
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--c-slate);
  font-weight: var(--fw-normal);
  opacity: 0.7;
}

.form-input:hover {
  border-color: var(--c-violet);
  background: rgba(255,255,255,0.9);
}

.form-input:focus {
  border-color: var(--c-violet);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
  outline: none;
}

.input-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
  line-height: 1;
}

/* Row layout for days/travelers */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-input[type="number"] {
  padding-left: var(--space-4);
}

/* Estimate button */
.btn-primary {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: #fff;
  background: var(--c-violet);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out);
  box-shadow: 0 8px 32px -8px rgba(108,92,231,0.55);
  margin-top: var(--space-4);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-out);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -8px rgba(108,92,231,0.5);
  background: #7c6ef0;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.btn--loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: var(--space-2);
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error message */
.estimate-error {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: var(--radius-xs);
  color: #c0392b;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
}


/* ─── 8. Segmented Tier Control ──────────────────────────────── */
.tier-control {
  display: flex;
  background: rgba(244,247,251,0.8);
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.tier-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-slate);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm) - 3px);
  cursor: pointer;
  transition: background var(--duration) var(--ease-out),
              color var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
}

.tier-btn:hover {
  color: var(--c-ink);
  background: rgba(255,255,255,0.6);
}

.tier-btn--active {
  background: #fff;
  color: var(--c-violet);
  box-shadow: var(--shadow-sm);
}

.tier-btn--active:hover {
  background: #fff;
}


/* ─── 9. Results Section ─────────────────────────────────────── */
#results {
  padding: var(--space-12) 0;
  background: var(--c-surface-alt);
}

#results[hidden] {
  display: none;
}

.results--visible {
  animation: fadeUp 0.5s var(--ease-out) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.results-card__header {
  padding: var(--space-8) var(--space-8) var(--space-6);
  background: linear-gradient(135deg, rgba(108,92,231,0.06) 0%, rgba(6,214,160,0.05) 100%);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.total-block {
  flex: 1;
}

.total-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-slate);
  margin-bottom: var(--space-2);
}

.total-amount {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--c-ink);
  background: linear-gradient(135deg, var(--c-violet) 0%, var(--c-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.total-alt {
  font-size: var(--text-base);
  color: var(--c-slate);
  margin-top: var(--space-1);
  font-weight: var(--fw-medium);
}

/* Currency toggle */
#currency-toggle {
  display: flex;
  gap: 4px;
  background: var(--c-mist);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-full);
  padding: 3px;
  flex-shrink: 0;
}

.currency-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  color: var(--c-slate);
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}

.currency-btn.active {
  background: var(--c-violet);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Breakdown rows */
.results-card__body {
  padding: var(--space-6) var(--space-8);
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--c-border);
  gap: var(--space-4);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-row__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.breakdown-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.breakdown-icon--flight  { background: rgba(255,107,107,0.1); }
.breakdown-icon--accom   { background: rgba(255,209,102,0.15); }
.breakdown-icon--daily   { background: rgba(6,214,160,0.1); }

.breakdown-row__label {
  font-weight: var(--fw-semibold);
  font-size: var(--text-base);
  color: var(--c-ink);
}

.breakdown-row__note {
  font-size: var(--text-xs);
  color: var(--c-slate);
  margin-top: 2px;
}

.breakdown-row__amounts {
  text-align: right;
  flex-shrink: 0;
}

.breakdown-amount {
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  letter-spacing: -0.02em;
}

.breakdown-alt {
  font-size: var(--text-xs);
  color: var(--c-slate);
  margin-top: 2px;
}

/* Results card footer */
.results-card__footer {
  padding: var(--space-5) var(--space-8);
  background: var(--c-mist);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.results-disclaimer {
  font-size: var(--text-xs);
  color: var(--c-slate);
  max-width: 480px;
}

/* Share button */
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-violet);
  background: rgba(108,92,231,0.08);
  border: 1.5px solid rgba(108,92,231,0.2);
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease-out);
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-share:hover {
  background: var(--c-violet);
  color: #fff;
  border-color: var(--c-violet);
  box-shadow: 0 6px 20px -4px rgba(108,92,231,0.4);
}

.btn-share:disabled {
  opacity: 0.4;
  cursor: default;
}


/* ─── 10. Map Panel ─────────────────────────────────────────── */
#map-panel {
  padding: var(--space-12) 0;
  background: var(--c-white);
}

#map-panel[hidden] {
  display: none;
}

.map-panel__header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.map-panel__title {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: var(--space-2);
}

.map-panel__sub {
  color: var(--c-slate);
  font-size: var(--text-base);
}

.map-container {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--c-border);
  background: #0a1628;
  aspect-ratio: 2/1;
  max-height: 420px;
}

#route-map-svg {
  width: 100%;
  height: 100%;
}

.map-attrib {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-3);
  font-size: 10px;
  color: rgba(255,255,255,0.35);
}

.map-attrib a {
  color: rgba(255,255,255,0.4);
}


/* ─── 11. AI Assistant Panel ───────────────────────────────── */
#ai-panel {
  padding: var(--space-12) 0;
  background: linear-gradient(180deg, var(--c-mist) 0%, var(--c-white) 100%);
}

.ai-panel__header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.ai-panel__title {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: var(--space-2);
}

.ai-panel__sub {
  color: var(--c-slate);
  font-size: var(--text-base);
  max-width: 440px;
  margin: 0 auto;
}

.ai-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
  .ai-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
}

.btn-ai {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
  background: var(--c-white);
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease-out);
  cursor: pointer;
  text-align: center;
  line-height: 1.35;
}

.btn-ai:hover:not(:disabled) {
  border-color: var(--c-violet);
  color: var(--c-violet);
  box-shadow: 0 4px 16px -4px rgba(108,92,231,0.2);
  transform: translateY(-2px);
}

.btn-ai:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-ai__icon {
  font-size: 1.8rem;
  line-height: 1;
}

#ai-output {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
  min-height: 120px;
  box-shadow: var(--shadow-sm);
}

#ai-output[hidden] {
  display: none;
}

.ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 80px;
}

.ai-loading span {
  width: 8px;
  height: 8px;
  background: var(--c-violet);
  border-radius: 50%;
  animation: aiPulse 1.2s ease-in-out infinite;
}

.ai-loading span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1.1); opacity: 1; }
}

.ai-response__title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--c-border);
}

.ai-response p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--c-ink);
  margin-bottom: var(--space-3);
}

.ai-response p:last-child {
  margin-bottom: 0;
}

.ai-soft-error {
  text-align: center;
  color: var(--c-slate);
  font-size: var(--text-sm);
  padding: var(--space-6) 0;
}


/* ─── 12. Trust / How It Works Section ──────────────────────── */
#how-it-works {
  padding: var(--space-16) 0;
  background: var(--c-white);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-violet);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: var(--space-3);
}

.section-sub {
  font-size: var(--text-lg);
  color: var(--c-slate);
  max-width: 560px;
  margin: 0 auto;
}

.trust-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .trust-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.trust-card {
  background: var(--c-mist);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
}

.trust-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.trust-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  display: block;
}

.trust-card__title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: var(--space-2);
}

.trust-card__desc {
  font-size: var(--text-sm);
  color: var(--c-slate);
  line-height: 1.65;
}


/* ─── 13. Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--c-ink);
  color: rgba(255,255,255,0.5);
  padding: var(--space-10) 0;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

@media (min-width: 640px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: var(--text-lg);
}

.footer-links {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color var(--duration) var(--ease-out);
}

.footer-links a:hover {
  color: rgba(255,255,255,0.8);
}

.footer-disclaimer {
  font-size: var(--text-xs);
  line-height: 1.6;
  max-width: 560px;
  margin-top: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-attrib {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.3);
  margin-top: var(--space-3);
}

.footer-attrib a {
  color: rgba(255,255,255,0.4);
}


/* ─── 14. Autocomplete Dropdown ─────────────────────────────── */
.autocomplete-wrapper {
  position: relative;
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--c-white);
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}

.suggestions-list:empty {
  display: none;
}

.suggestions-list li {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--c-ink);
  cursor: pointer;
  transition: background var(--duration) var(--ease-out);
  border-bottom: 1px solid var(--c-border);
}

.suggestions-list li:last-child {
  border-bottom: none;
}

.suggestions-list li:hover,
.suggestions-list li.active {
  background: var(--c-mist);
  color: var(--c-violet);
}


/* ─── 15. Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + var(--space-6)));
  background: var(--c-ink);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
  opacity: 0;
  white-space: nowrap;
}

.toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast--success {
  background: var(--c-ink);
}

.toast--error {
  background: #c0392b;
}

.toast--info {
  background: var(--c-blue);
}


/* ─── 16. Reveal Animations ─────────────────────────────────── */
.reveal-pending {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal-pending.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}


/* ─── 17. Responsive (mobile-first) ─────────────────────────── */
@media (max-width: 639px) {
  .hero {
    padding: var(--space-12) 0 var(--space-8);
    min-height: auto;
  }

  .hero__headline {
    font-size: 2rem;
  }

  .estimator-card {
    padding: var(--space-5);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .results-card__header {
    padding: var(--space-5);
  }

  .results-card__body {
    padding: var(--space-4) var(--space-5);
  }

  .results-card__footer {
    padding: var(--space-4) var(--space-5);
    flex-direction: column;
    align-items: flex-start;
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .trust-cards {
    grid-template-columns: 1fr;
  }

  .ai-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-nav {
    display: none;
  }

  .map-container {
    aspect-ratio: 3/2;
  }
}

@media (min-width: 640px) and (max-width: 959px) {
  .hero__content {
    grid-template-columns: 1fr;
  }

  .estimator-card {
    max-width: 560px;
    margin: 0 auto;
  }
}


/* ─── 18. Dark Mode ─────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --c-ink:           #E8EAF6;
    --c-slate:         #9BA3B8;
    --c-mist:          #1A1D2E;
    --c-card:          rgba(26,29,46,0.88);
    --c-white:         #12141F;
    --c-surface:       #1A1D2E;
    --c-surface-alt:   #0F111A;
    --c-border:        rgba(255,255,255,0.07);
    --c-border-strong: rgba(255,255,255,0.12);
  }

  body {
    background: #12141F;
    color: var(--c-ink);
  }

  .site-header {
    background: rgba(18,20,31,0.85);
    border-bottom-color: var(--c-border);
  }

  .site-logo {
    color: var(--c-ink);
  }

  .site-nav a {
    color: var(--c-slate);
  }

  .site-nav a:hover {
    color: var(--c-ink);
    background: rgba(255,255,255,0.06);
  }

  .hero__bg {
    filter: brightness(0.75) saturate(1.3);
  }

  .estimator-card {
    background: var(--c-card);
    border-color: rgba(255,255,255,0.1);
  }

  .form-input {
    background: rgba(255,255,255,0.06);
    border-color: var(--c-border-strong);
    color: var(--c-ink);
  }

  .form-input::placeholder {
    color: var(--c-slate);
  }

  .form-input:focus {
    background: rgba(255,255,255,0.09);
    border-color: var(--c-violet);
  }

  .tier-control {
    background: rgba(255,255,255,0.04);
    border-color: var(--c-border-strong);
  }

  .tier-btn--active {
    background: rgba(255,255,255,0.1);
    color: var(--c-teal);
    box-shadow: none;
  }

  #results {
    background: var(--c-surface-alt);
  }

  .results-card {
    background: var(--c-surface);
    border-color: var(--c-border);
  }

  .results-card__header {
    background: linear-gradient(135deg, rgba(108,92,231,0.1) 0%, rgba(6,214,160,0.07) 100%);
    border-bottom-color: var(--c-border);
  }

  .results-card__footer {
    background: rgba(255,255,255,0.03);
    border-top-color: var(--c-border);
  }

  #currency-toggle {
    background: rgba(255,255,255,0.05);
    border-color: var(--c-border-strong);
  }

  .currency-btn.active {
    background: var(--c-violet);
    color: #fff;
  }

  .trust-card {
    background: rgba(255,255,255,0.04);
    border-color: var(--c-border);
  }

  .trust-card:hover {
    background: rgba(255,255,255,0.07);
  }

  .suggestions-list {
    background: #1A1D2E;
    border-color: var(--c-border-strong);
  }

  .suggestions-list li {
    color: var(--c-ink);
    border-bottom-color: var(--c-border);
  }

  .suggestions-list li:hover,
  .suggestions-list li.active {
    background: rgba(255,255,255,0.06);
    color: var(--c-teal);
  }

  .btn-ai {
    background: var(--c-surface);
    border-color: var(--c-border-strong);
    color: var(--c-ink);
  }

  .btn-ai:hover:not(:disabled) {
    border-color: var(--c-teal);
    color: var(--c-teal);
  }

  #ai-output {
    background: var(--c-surface);
    border-color: var(--c-border);
  }

  #how-it-works {
    background: var(--c-white);
  }

  .section-title {
    color: var(--c-ink);
  }

  .site-footer {
    background: #0A0C14;
  }
}


/* ─── 19. 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;
  }

  .hero__bg {
    animation: none;
  }

  .reveal-pending,
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ─── 20. SEO Page Classes ──────────────────────────────────── */
.seo-page {
  font-family: var(--font-body);
  color: var(--c-ink);
}

.seo-hero {
  padding: var(--space-16) 0 var(--space-12);
  background: var(--c-mist);
  text-align: center;
}

.seo-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: var(--space-4);
}

.seo-hero p {
  font-size: var(--text-lg);
  color: var(--c-slate);
  max-width: 520px;
  margin: 0 auto var(--space-6);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-head);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: #fff;
  background: var(--c-violet);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--duration) var(--ease-out);
  box-shadow: 0 6px 20px -4px rgba(108,92,231,0.45);
}

.cta:hover {
  background: #7c6ef0;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -6px rgba(108,92,231,0.5);
}

.seo-content {
  padding: var(--space-12) 0;
}

.seo-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin: var(--space-8) 0 var(--space-3);
}

.seo-content p {
  color: var(--c-slate);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

.seo-estimate-card {
  background: var(--c-mist);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-8);
  margin: var(--space-8) 0;
}

.seo-related-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.seo-related-links a {
  padding: var(--space-3) var(--space-4);
  background: var(--c-mist);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: all var(--duration) var(--ease-out);
}

.seo-related-links a:hover {
  background: rgba(108,92,231,0.06);
  border-color: var(--c-violet);
  color: var(--c-violet);
}


/* ─── 21. Ad Slot (Sponsored / Native Banner) ────────────────── */
.ad-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-5);
  border-top: 1px solid var(--c-border);
  text-align: center;
}

.ad-label {
  display: block;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-slate);
  margin-bottom: var(--space-3);
  text-align: center;
}

.ad-slot {
  display: block;
  width: 100%;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin: 0 auto;
}

@media (max-width: 639px) {
  .ad-slot {
    min-height: 200px;
  }
}

@media (prefers-color-scheme: dark) {
  .ad-section {
    border-top-color: var(--c-border);
  }
}
