/* Tokens come straight from driver_insight_mobile/lib/core/theme/app_colors.dart */
:root {
  --night: #071633;          /* brandBackground: app icon + splash */
  --night-2: #0c2149;
  --primary: #0D47A1;
  --secondary: #00897B;
  --surface: #F5F5F5;
  --paper: #FFFFFF;
  --ink: #071633;
  --ink-soft: #46536b;
  --rule: #dfe3ea;

  --bad: #E53935;
  --good: #FFB300;
  --excellent: #43A047;

  --fuel: #FFA000;
  --viaverde: #2E7D32;
  --rental: #8E24AA;        /* expenseTypeRental */

  --on-night: #ffffff;
  --on-night-soft: #a9b6d3;

  --font: "Lexend", system-ui, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0a1a3b;
    --paper: #0f2248;
    --ink: #eef2fa;
    --ink-soft: #a9b6d3;
    --rule: #22365f;
    --primary: #5b8ff0;
  }
}
:root[data-theme="dark"] {
  --surface: #0a1a3b;
  --paper: #0f2248;
  --ink: #eef2fa;
  --ink-soft: #a9b6d3;
  --rule: #22365f;
  --primary: #5b8ff0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--good); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: var(--night); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.top { background: var(--night); color: var(--on-night); }
.top__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.375rem; letter-spacing: -0.01em; }
.brand img { width: 40px; height: 40px; }
.lang { display: flex; gap: 2px; }
.lang button {
  font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--on-night-soft);
  background: none; border: 0; padding: 6px 10px; border-radius: 6px; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--on-night); background: rgba(255,255,255,.1); }

/* ---------- Hero ---------- */
.hero { background: var(--night); color: var(--on-night); padding: clamp(32px, 6vw, 72px) 0 clamp(48px, 7vw, 96px); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(2.375rem, 5.4vw, 4rem); font-weight: 600; letter-spacing: -0.025em; max-width: 17ch; }
.hero__lede { margin-top: 24px; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--on-night-soft); max-width: 36ch; }
.hero__note { margin-top: 12px; font-size: 0.875rem; color: var(--on-night-soft); }

.btn--play {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 36px;
  padding: 14px 22px 14px 18px; border-radius: 12px;
  background: #fff; color: var(--night); font-weight: 600; text-decoration: none;
}
.btn--play:hover { background: #e8eefb; }

/* Phone mock: map + driver-app sheet + Oratsio card on top */
.phone {
  margin: 0; justify-self: center; width: min(320px, 100%);
  aspect-ratio: 9 / 18.5; padding: 10px; border-radius: 44px;
  background: #02091a; box-shadow: 0 0 0 1px #24375f, 0 40px 80px -30px rgba(0, 0, 0, .7);
}
.phone__screen { position: relative; height: 100%; border-radius: 34px; overflow: hidden; background: #12244a; }
.phone__map { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 18px 22px;
  background: #1c2433; border-radius: 22px 22px 0 0;
}
.sheet__line { height: 10px; border-radius: 5px; background: #3a4458; margin-bottom: 10px; }
.sheet__line--w60 { width: 60%; }
.sheet__line--w40 { width: 40%; }
.sheet__accept { height: 44px; border-radius: 22px; background: #3a4458; margin-top: 16px; }

/* Matches trip_offer_view.dart: radius 16, source + badge + close, €/h headline in rating colour */
.offer {
  --rate: var(--excellent);
  position: absolute; top: 34px; left: 12px; right: 12px;
  padding: 8px 6px 12px 14px; border-radius: 16px;
  background: #fff; color: #1b1f27;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.offer[data-rating="bad"] { --rate: var(--bad); }
.offer[data-rating="good"] { --rate: var(--good); }
.offer__head { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.offer__source { font-size: 0.8125rem; color: #5b6475; }
.badge {
  font-size: 0.75rem; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px;
  color: #fff; background: var(--rate);
}
.offer[data-rating="good"] .badge { color: #3d2b00; }
.offer__close { margin-left: auto; padding: 6px; color: #5b6475; display: flex; }
.offer__rates { display: flex; align-items: baseline; gap: 10px; padding-right: 8px; white-space: nowrap; }
.offer__hour { font-size: 1.75rem; font-weight: 700; color: var(--rate); letter-spacing: -0.01em; }
.offer[data-rating="good"] .offer__hour { color: #c98a00; }
.offer__km { font-size: 0.875rem; font-weight: 500; color: #5b6475; }
.offer__stats { display: flex; gap: 16px; margin: 8px 0 0; padding-right: 8px; }
.offer__stats dt { font-size: 0.6875rem; color: #5b6475; }
.offer__stats dd { margin: 2px 0 0; font-size: 0.9375rem; font-weight: 500; }
.offer__timer { margin: 10px 8px 0 0; height: 4px; border-radius: 2px; background: rgba(13, 71, 161, .15); overflow: hidden; }
.offer__timer span { display: block; height: 100%; width: 100%; background: #0D47A1; transform-origin: left; }
.offer.is-swap { animation: drop .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Try-it band */
.trial { margin-top: clamp(48px, 7vw, 88px); display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px clamp(32px, 5vw, 64px); align-items: end; }
.trial__title { font-size: 1.25rem; font-weight: 500; margin-bottom: 16px; }
.trial__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; font-size: 0.8125rem; color: var(--on-night-soft); }
.field__box {
  display: flex; align-items: center; gap: 4px; padding: 0 12px; height: 52px; border-radius: 10px;
  background: var(--night-2); box-shadow: inset 0 0 0 1px #2a3f6b;
}
.field__box:focus-within { box-shadow: inset 0 0 0 2px var(--good); }
.field__unit { color: var(--on-night-soft); font-size: 0.9375rem; }
.field input {
  width: 100%; min-width: 0; border: 0; background: none; color: #fff;
  font: inherit; font-size: 1.25rem; font-weight: 500; outline: none; -moz-appearance: textfield;
}
.field input::-webkit-inner-spin-button, .field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* The €/km scale, drawn as the road from the logo */
.road { position: relative; padding-top: 4px; }
.road__zones { display: grid; grid-template-columns: 33.333% 26.667% 40%; font-size: 0.8125rem; font-weight: 500; margin-bottom: 8px; }
.road__zone { padding-left: 4px; }
.road__zone--bad { color: #ff8a87; }
.road__zone--good { color: var(--good); }
.road__zone--excellent { color: #7fd483; }
.road__asphalt {
  position: relative; height: 56px; border-radius: 6px; background: #1a2846;
  border-top: 4px solid; border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--bad) 0 33.333%, var(--good) 33.333% 60%, var(--excellent) 60% 100%) 1;
}
.road__asphalt::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 4px; margin-top: -2px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 22px, transparent 22px 40px);
}
.road__pin {
  position: absolute; bottom: 24px; left: 0; z-index: 1; margin-left: -14px;
  color: var(--excellent); filter: drop-shadow(0 4px 6px rgba(0,0,0,.5));
  transition: left .5s cubic-bezier(.2, .8, .2, 1), color .3s;
}
.road__ticks { position: relative; height: 22px; margin-top: 8px; font-size: 0.75rem; color: var(--on-night-soft); }
.road__ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.road__ticks span:first-child { transform: none; }
.road__ticks span:last-child { transform: translateX(-100%); }
.trial__caption { grid-column: 2; font-size: 0.875rem; color: var(--on-night-soft); max-width: 52ch; }

/* ---------- Light sections ---------- */
.section-title { font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -0.02em; max-width: 22ch; }
.section-lede { margin-top: 12px; color: var(--ink-soft); max-width: 52ch; }

.features { padding: clamp(64px, 9vw, 120px) 0 clamp(32px, 4vw, 48px); }
.features .section-title { margin-bottom: clamp(32px, 5vw, 56px); }
.feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(32px, 6vw, 96px);
  padding: clamp(32px, 4vw, 48px) 0; border-top: 1px solid var(--rule); align-items: start;
}
.feature h3 { font-size: 1.5rem; }
.feature__text p:last-child { margin-top: 12px; color: var(--ink-soft); max-width: 46ch; }
.plan-tag { margin-top: 6px; font-size: 0.875rem; font-weight: 500; color: var(--secondary); }

/* Slide-to-confirm (Time Bank) */
.clock { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.clock__status { font-size: 0.875rem; color: var(--ink-soft); }
.clock__time { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em; }
.slider {
  position: relative; height: 64px; border-radius: 32px; background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule); overflow: hidden; touch-action: none; user-select: none;
}
.slider__fill { position: absolute; inset: 0 auto 0 0; width: 64px; background: rgba(0, 137, 123, .14); border-radius: 32px; }
.slider__label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 56px; font-weight: 500; color: var(--ink-soft); }
.slider__thumb {
  position: absolute; top: 6px; left: 6px; width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--secondary); color: #fff; display: grid; place-items: center; cursor: grab;
}
.slider__thumb:active { cursor: grabbing; }
.slider.is-on .slider__thumb { background: var(--bad); }
.slider.is-on .slider__fill { background: rgba(229, 57, 53, .12); }
.slider.is-settling .slider__thumb, .slider.is-settling .slider__fill { transition: transform .3s, width .3s; }

/* Ledger */
.ledger__bar { display: flex; gap: 3px; height: 18px; border-radius: 4px; overflow: hidden; }
.ledger__rows { margin: 18px 0 0; }
.ledger__rows div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; }
.ledger__rows dt { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.ledger__rows dd { margin: 0; font-weight: 500; }
.ledger__rows i { width: 10px; height: 10px; border-radius: 2px; }
.ledger__total { border-bottom: 0 !important; }
.ledger__total dt, .ledger__total dd { color: var(--ink); font-weight: 600; }

/* Events */
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.events li:last-child { border-bottom: 0; }
.events__date { display: grid; justify-items: center; width: 48px; flex: none; line-height: 1.1; }
.events__date b { font-size: 1.375rem; font-weight: 600; }
.events__date small, .events li > span:last-child small { font-size: 0.8125rem; color: var(--ink-soft); }
.events li > span:last-child { display: grid; }
.events strong { font-weight: 500; }

/* Plans */
.plans { padding: clamp(48px, 7vw, 96px) 0; }
.table-scroll { margin-top: 32px; overflow-x: auto; }
.plan-table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 0.9375rem; }
.plan-table th, .plan-table td { padding: 14px 12px; text-align: center; border-bottom: 1px solid var(--rule); }
.plan-table thead th { font-weight: 600; font-size: 1rem; border-bottom: 2px solid var(--ink); }
.plan-table tbody th { text-align: left; font-weight: 400; padding-left: 0; }
.plan-table thead th:first-child { padding-left: 0; }
.plan-table .y { color: var(--secondary); font-weight: 600; }
.plan-table .n { color: var(--ink-soft); opacity: .6; }
.plan-table .is-top { background: color-mix(in srgb, var(--primary) 7%, transparent); }

/* Privacy */
.privacy { padding: clamp(48px, 7vw, 96px) 0; background: var(--paper); }
.privacy__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(32px, 6vw, 96px); }
.privacy__grid > div > p { color: var(--ink-soft); max-width: 52ch; }
.privacy__list { margin: 20px 0 24px; padding-left: 1.1em; max-width: 52ch; }
.privacy__list li { padding: 4px 0; }
.privacy__list li::marker { color: var(--secondary); }
.link { color: var(--primary); font-weight: 500; text-underline-offset: 3px; }

/* Closing + footer */
.closing { background: var(--night); color: var(--on-night); padding: clamp(64px, 9vw, 120px) 0; text-align: center; }
.closing__inner { display: grid; justify-items: center; }
.closing img { width: 96px; height: 96px; margin-bottom: 24px; }
.closing h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); letter-spacing: -0.02em; max-width: 20ch; }
.closing .btn--play { margin-top: 32px; }

.foot { background: var(--night); color: var(--on-night-soft); font-size: 0.875rem; border-top: 1px solid #1a2b4f; }
.foot__inner { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.foot a { margin-right: 20px; text-underline-offset: 3px; }
.foot a:last-child { margin-right: 0; }

/* ---------- Privacy policy page ---------- */
.legal { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 112px); }
.legal__inner { max-width: calc(46rem + 2 * var(--gutter)); }
.legal h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.02em; }
.legal .meta { margin-top: 8px; font-size: 0.875rem; color: var(--ink-soft); }
.legal .meta + p { margin-top: 28px; font-size: 1.125rem; }
.legal h2 { font-size: 1.25rem; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); }
.legal h2 + p, .legal h2 + table, .legal h2 + ul { margin-top: 12px; }
.legal p, .legal ul { margin: 12px 0 0; }
.legal ul { padding-left: 1.2em; }
.legal li { padding: 3px 0; }
.legal li::marker { color: var(--secondary); }
.legal strong { font-weight: 600; }
.legal a { color: var(--primary); text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal code { font-size: 0.9em; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--primary) 9%, transparent); }
.legal small { font-size: 0.875rem; color: var(--ink-soft); }
.legal table { display: block; overflow-x: auto; margin-top: 16px; border-collapse: collapse; font-size: 0.9375rem; }
.legal th, .legal td { padding: 10px 16px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.legal th { font-weight: 600; font-size: 0.875rem; color: var(--ink-soft); border-bottom-color: var(--ink); }
.legal td:first-child { font-weight: 500; min-width: 9rem; }
/* Phones: each row becomes a short stacked block instead of a sideways-scrolling table */
@media (max-width: 600px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; }
  .legal tr:first-child { display: none; }
  .legal tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .legal td { padding: 2px 0; border: 0; }
  .legal td:first-child { min-width: 0; color: var(--ink); }
  .legal td + td { color: var(--ink-soft); }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero__grid, .trial, .feature, .privacy__grid { grid-template-columns: minmax(0, 1fr); }
  .trial__caption { grid-column: 1; }
  .phone { width: min(300px, 86%); }
}
@media (max-width: 480px) {
  .trial__fields { gap: 8px; }
  .field__box { padding: 0 8px; }
  .field input { font-size: 1.0625rem; }
  .foot a { display: inline-block; margin-bottom: 4px; }
  .plan-table { min-width: 0; font-size: 0.8125rem; }
  .plan-table th, .plan-table td { padding: 12px 4px; }
  .plan-table thead th { font-size: 0.8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
