/* =========================================================
   Thiago Towing - styles
   Theme: auto light/dark via tokens.
   Palette: navy + flag red (from the logo / reference), one accent = red.
   Radius rule: 12px on cards, media, inputs and buttons.
   Chips are the only full-pill element.
   ========================================================= */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eceff6;
  --text: #0e1a3a;            /* navy ink */
  --muted: #4a5573;
  --line: #dbe0eb;
  --accent: #c8102e;          /* flag red */
  --accent-hover: #e0152f;
  --accent-ink: #ffffff;      /* text on accent fills */
  --accent-text: #c8102e;     /* accent used as text */
  --navy: #0e1a3a;
  --navy-2: #13244f;
  --dark: #0e1a3a;
  --dark-ink: #ffffff;
  --shadow: 0 1px 2px rgb(14 26 58 / .06), 0 12px 32px rgb(14 26 58 / .10);
  --r: 12px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081129;
    --surface: #0f1b3d;
    --surface-2: #0c1633;
    --text: #f2f4fa;
    --muted: #a9b2c9;
    --line: #22305a;
    --accent-text: #ff4d63;
    --dark: #1d2d5c;
    --dark-ink: #ffffff;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-stretch: 112%; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--r); font-weight: 700;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 16px;
}
.h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; max-width: 22ch; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 52ch; }
.lead b { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 2px solid transparent; border-radius: var(--r);
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn i { font-size: 1.15em; }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn--block { width: 100%; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); box-shadow: 0 8px 24px rgb(200 16 46 / .3); }
.btn--ghost { border-color: var(--text); color: var(--text); background: transparent; }
.btn--ghost:hover { background: var(--text); color: var(--bg); }
.btn--dark { background: var(--dark); color: var(--dark-ink); }

.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 700;
  color: var(--text); text-decoration: underline; cursor: pointer;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.brand img { height: 30px; width: auto; }
.nav__links { display: flex; gap: 28px; margin-left: auto; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 2px; }
.lang button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 700 12.5px/1 var(--font); letter-spacing: .04em; padding: 8px 9px; border-radius: 9px;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .lang button[aria-pressed="true"] { background: var(--accent); } }
.nav__links a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); transition: color .2s; white-space: nowrap; }
.nav__links a:hover { color: var(--text); }
.nav__call { min-height: 44px; }

@media (max-width: 1240px) { .nav__links { gap: 20px; } .nav__inner { gap: 20px; } .nav__links a { font-size: 14px; } }
@media (max-width: 1120px) {
  .nav__links { display: none; }
  .lang { margin-left: auto; }
}
@media (max-width: 560px) {
  .nav__call span { display: none; }
  .nav__call { padding: 0 14px; }
  .nav__inner { gap: 10px; }
  .brand img { height: 22px; }
  .lang button { padding: 7px 6px; font-size: 11.5px; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 6vw, 88px); }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center;
}
.hero h1 { font-size: clamp(40px, 4.6vw, 62px); font-weight: 900; font-stretch: 110%; letter-spacing: -0.035em; line-height: 1.02; }
.hero h1 .hl { display: inline-block; color: var(--accent-text); background: linear-gradient(transparent 86%, var(--accent) 86%, var(--accent) 95%, transparent 95%); }
.hero .lead { margin-top: 22px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero__visual { position: relative; padding: 40px 0; }
.media {
  position: relative; overflow: hidden; border-radius: var(--r);
  background:
    repeating-linear-gradient(135deg, transparent 0 18px, rgb(200 16 46 / .07) 18px 36px),
    var(--surface-2);
  display: grid; place-items: center;
}
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.media__ph { font-size: 64px; color: var(--muted); opacity: .45; }
.media--hero { position: absolute; top: 0; right: 0; bottom: 0; width: 74%; }

/* Quote form overlaps the photo */
.quote {
  position: relative; width: min(440px, 88%); z-index: 2;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 24px;
}
.quote__title { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
.quote__row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.quote__kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 4px; }
.quote__step[hidden] { display: none; }
.quote__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 14px; }

/* Vehicle type picker */
.types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.types label { position: relative; }
.types input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.types span {
  display: grid; justify-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--bg); color: var(--muted);
  font-size: 12px; font-weight: 700; transition: all .2s;
}
.types span i, .types span svg { font-size: 26px; }
.types b { font-weight: 700; }
.types label:hover span { border-color: var(--muted); }
.types input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.types input:focus-visible + span { box-shadow: 0 0 0 3px rgb(200 16 46 / .45); }

/* Pick-or-type list */
.combo { position: relative; }
.combo__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  max-height: 232px; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.combo__list[hidden] { display: none; }
.combo__list li { padding: 9px 10px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.combo__list li:hover, .combo__list li[aria-selected="true"] { background: var(--surface-2); }

/* Estimate */
.est {
  background: var(--navy); color: #fff; border-radius: var(--r);
  padding: 18px 16px; margin: 8px 0 16px; text-align: center;
}
.est__label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.est__value { font-size: clamp(30px, 4vw, 38px); font-weight: 900; font-stretch: 110%; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0; }
.est__value.is-text { font-size: 18px; font-weight: 700; font-stretch: 100%; letter-spacing: 0; }
.est__car { font-size: 14px; font-weight: 600; opacity: .9; }
.est__note { font-size: 12.5px; opacity: .7; margin-top: 8px; }
@media (prefers-color-scheme: dark) { .est { background: #1d2d5c; } }
.quote__row--2 { grid-template-columns: 1fr 1fr; }
.quote__note { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }

.field { display: grid; gap: 6px; margin: 0 0 12px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-size: 13px; font-weight: 700; color: var(--text); padding: 0; }
.field legend { margin-bottom: 6px; }
.field input:not([type="radio"]), .field select {
  width: 100%; min-height: 44px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r);
  transition: border-color .2s, box-shadow .2s;
}
.field select {
  appearance: none; cursor: pointer; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:invalid { color: var(--muted); }
.field input:focus, .field select:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgb(200 16 46 / .28); }
.field.is-error input, .field.is-error select, .field.is-error .seg span, .field.is-error .types span { border-color: #c62828; }
.field__err { font-size: 12.5px; font-weight: 600; color: #c62828; min-height: 0; }
.field__err:empty { display: none; }
@media (prefers-color-scheme: dark) {
  .field.is-error input, .field.is-error select, .field.is-error .seg span, .field.is-error .types span { border-color: #ff7a7a; }
  .field__err { color: #ff8a8a; }
}

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; min-height: 40px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--bg);
  font-size: 14px; font-weight: 600; color: var(--muted); transition: all .2s;
}
.seg input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgb(200 16 46 / .45); }

.quote__done {
  position: absolute; inset: 0; z-index: 3; border-radius: var(--r);
  background: var(--surface); padding: 32px 24px;
  display: flex; flex-direction: column; justify-content: center; gap: 12px; text-align: center; align-items: center;
}
.quote__done[hidden] { display: none; }
.quote__done > i { font-size: 52px; color: var(--accent); }
.quote__done h3 { font-size: 24px; }
.quote__done p { color: var(--muted); }
.quote__done a { font-weight: 700; color: var(--text); }

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { padding: 0; }
  .media--hero { position: relative; width: 100%; aspect-ratio: 16 / 10; }
  .quote { width: 100%; margin-top: -48px; margin-inline: auto; max-width: 560px; }
}
@media (max-width: 420px) {
  .quote { padding: 20px 16px; }
  .quote__row--2 { grid-template-columns: 1fr; }
  .types span { font-size: 11px; }
}

/* ---------- Promises strip ---------- */
.promises { background: linear-gradient(100deg, #a90d26 0%, #c8102e 45%, #e0153d 100%); color: #fff; }
.promises__list {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-block: 28px;
}
.promises li { display: flex; align-items: center; gap: 14px; }
.promises i { font-size: 30px; color: #fff; flex: none; }
.promises span { display: grid; font-size: 14px; opacity: .9; line-height: 1.35; }
.promises b { font-size: 17px; opacity: 1; font-weight: 800; }
@media (max-width: 860px) { .promises__list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .promises__list { gap: 18px 12px; } .promises i { font-size: 26px; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }

/* How it works: connected track */
.how__steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px;
  position: relative; counter-reset: step;
}
.how__steps::before {
  content: ""; position: absolute; top: 28px; left: 28px; right: 10%;
  border-top: 2px dashed var(--line);
}
.how__steps li { position: relative; }
.how__icon {
  position: relative; display: grid; place-items: center; width: 56px; height: 56px;
  border-radius: var(--r); background: var(--accent); color: var(--accent-ink); font-size: 26px; margin-bottom: 20px;
}
.how__steps h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.how__steps p { color: var(--muted); max-width: 34ch; }
@media (max-width: 860px) {
  .how__steps { grid-template-columns: 1fr; gap: 32px; }
  .how__steps::before { top: 28px; bottom: 28px; left: 27px; right: auto; border-top: 0; border-left: 2px dashed var(--line); }
  .how__steps li { padding-left: 80px; }
  .how__icon { position: absolute; left: 0; top: 0; margin: 0; }
}

/* What we buy: bento */
.buy { background: var(--surface-2); }
.bento {
  display: grid; gap: 16px; margin-top: 48px;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto;
}
.tile {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--r);
}
.tile .media { border-radius: 0; aspect-ratio: 4 / 3; }
.tile__body { padding: 20px 22px 24px; }
.tile h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: 15.5px; }
.tile--big { grid-row: span 2; }
.tile--big .media { aspect-ratio: auto; flex: 1; min-height: 280px; }
.tile--big h3 { font-size: 26px; }
.tile--accent { background: var(--accent); color: var(--accent-ink); justify-content: flex-end; }
.tile--accent p { color: var(--accent-ink); opacity: .88; }
.tile--dark { background: var(--navy); color: #fff; justify-content: flex-end; }
.tile--dark p { color: #fff; opacity: .75; }
.tile__icon { font-size: 40px; margin-bottom: 18px; display: block; }
.tile--dark .tile__icon { color: #ff4d63; }
@media (prefers-color-scheme: dark) { .tile--dark { background: #1a2a57; } }

/* Layout: big | wrecked | accent  /  big | dark | used */
.bento > :nth-child(2) { grid-column: 2; grid-row: 1; }
.bento > :nth-child(3) { grid-column: 3; grid-row: 1; }
.bento > :nth-child(4) { grid-column: 2; grid-row: 2; }
.bento > :nth-child(5) { grid-column: 3; grid-row: 2; }

@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile--big { grid-column: 1 / -1 !important; grid-row: auto; }
  .tile--big .media { aspect-ratio: 16 / 9; min-height: 0; }
  .bento > :nth-child(n+2) { grid-column: auto; grid-row: auto; }
}
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } }

/* Why us: split */
.why__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.media--tall { aspect-ratio: 4 / 5; }
.why__copy .lead { margin-top: 20px; }
.checks { display: grid; gap: 14px; margin-top: 32px; }
.checks li { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 18px; }
.checks i { color: var(--accent); font-size: 26px; flex: none; }
@media (max-width: 860px) {
  .why__grid { grid-template-columns: 1fr; }
  .media--tall { aspect-ratio: 16 / 11; }
}

/* Service area */
.area { background: var(--surface-2); }
.area__inner { text-align: left; }
.area .lead { margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; max-width: 820px; }
.chips li {
  padding: 10px 18px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-weight: 600; font-size: 15px;
}

/* FAQ */
.faq__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.faq__list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 0; font-size: 19px; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { font-size: 20px; flex: none; transition: transform .3s var(--ease); }
.faq details[open] summary i { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 62ch; }
@media (max-width: 860px) { .faq__grid { grid-template-columns: 1fr; } }

/* Final CTA */
.cta { padding-block: clamp(56px, 8vw, 96px); background: linear-gradient(100deg, #a90d26 0%, #c8102e 45%, #e0153d 100%); color: #fff; }
.cta__inner { display: grid; justify-items: start; gap: 12px; }
.cta h2 { font-size: clamp(32px, 5vw, 56px); font-weight: 900; font-stretch: 118%; }
.cta p { font-size: 19px; margin-bottom: 16px; }
.cta .btn--accent { background: var(--navy); color: #fff; }
.cta .btn--accent:hover { background: var(--navy-2); box-shadow: 0 8px 24px rgb(14 26 58 / .35); }

/* Footer (always navy) */
.footer { padding-top: 56px; background: #0b1530; color: #f2f4fa; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer__logo img { width: 220px; height: auto; }
.footer h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: #a9b2c9; margin-bottom: 12px; font-stretch: 100%; }
.footer a { text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }
.footer p + p { margin-top: 6px; }
.footer__muted { color: #a9b2c9; margin-top: 12px; }
.footer h3 + .footer__muted { margin-top: 0; }
.footer__base { margin-top: 48px; padding-block: 24px; border-top: 1px solid rgb(255 255 255 / .12); font-size: 14px; color: #a9b2c9; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }

/* Mobile call bar */
.callbar { display: none; }
@media (max-width: 760px) {
  .callbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  body { padding-bottom: 76px; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > *, .hero__visual { animation: rise .8s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: .06s; }
  .hero__copy > :nth-child(3) { animation-delay: .12s; }
  .hero__copy > :nth-child(4) { animation-delay: .18s; }
  .hero__visual { animation-delay: .2s; }

  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .how__steps .reveal:nth-child(2), .bento .reveal:nth-child(2) { transition-delay: .08s; }
  .how__steps .reveal:nth-child(3), .bento .reveal:nth-child(3) { transition-delay: .16s; }
  .bento .reveal:nth-child(4) { transition-delay: .12s; }
  .bento .reveal:nth-child(5) { transition-delay: .2s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
