/* ===== Selfdrive — Funil de captura ===== */
:root {
  --bg: #040404;
  --bg-soft: #0A0A0A;
  --card: #0E0E0E;
  --line: #1F1F1F;
  --text: #F5F5F5;
  --muted: #9A9A9A;
  --accent: #F7B30A;          /* âmbar Selfdrive */
  --accent-rgb: 247,179,10;   /* mesma cor em RGB, para transparências */
  --accent-ink: #140F00;      /* texto sobre o âmbar */
  --radius: 16px;
  --maxw: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(4,4,4,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 20px; }
.brand span { color: var(--accent); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 16px;
  padding: 15px 26px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn.block { width: 100%; }
.btn.lg { padding: 18px 30px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

/* ===== Hero ===== */
.hero { position: relative; padding: 56px 0 40px; }
/* halo âmbar subtil atrás do hero — dá profundidade sem competir com a foto */
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -160px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 520px; max-width: 130vw;
  background: radial-gradient(ellipse at center, rgba(var(--accent-rgb),.10), transparent 65%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: rgba(var(--accent-rgb),.08); border: 1px solid rgba(var(--accent-rgb),.22);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 20px;
}
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
h1 .hl { color: var(--accent); }
.sub { color: var(--muted); font-size: 18px; margin-top: 18px; max-width: 46ch; }
.hero-cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-mini { margin-top: 16px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.hero-visual {
  background: linear-gradient(160deg, #141414, #080808);
  border: 1px solid var(--line); border-radius: 22px;
  aspect-ratio: 4/5; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; overflow: hidden; position: relative;
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Trust strip ===== */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.trust .wrap { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; padding: 22px 20px; }
.trust-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.trust-item b { color: var(--text); }

/* ===== Section heads ===== */
.head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.head h2 { font-size: clamp(26px, 3.5vw, 38px); letter-spacing: -.02em; font-weight: 800; }
.head p { color: var(--muted); margin-top: 12px; font-size: 17px; }

/* ===== Proof cards ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.card .ico { width: 42px; height: 42px; border-radius: 12px; background: rgba(var(--accent-rgb),.12);
  display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; }

/* ===== Price gate (locked) ===== */
.gate { background: var(--bg-soft); }
.gate-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 40px; text-align: center; position: relative; overflow: hidden;
}
.locked-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 auto 30px; max-width: 700px; }
.locked-car {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: left;
}
.locked-car .ph { aspect-ratio: 4/5; background: linear-gradient(135deg,#141414,#080808); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.locked-car .ph img { width: 100%; height: 100%; object-fit: cover; }
.locked-car h4 { font-size: 15px; }
.locked-car .tag { font-size: 12px; color: var(--muted); }
/* poupança concreta: o motivo para atravessar o gate */
.locked-car .save-hint {
  display: inline-block; margin-top: 10px; white-space: nowrap;
  background: rgba(var(--accent-rgb),.12); color: var(--accent);
  font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px;
}
/* preço real, desfocado até ao registo */
.locked-car .blur { filter: blur(7px); color: var(--accent); font-weight: 800; font-size: 20px; margin-top: 6px; user-select: none; pointer-events: none; }

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.step { text-align: center; padding: 10px; }
.step .n { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.step h4 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }

/* ===== Final CTA ===== */
.finalcta { text-align: center; }
.finalcta .box {
  background: linear-gradient(160deg, rgba(var(--accent-rgb),.10), rgba(var(--accent-rgb),.02));
  border: 1px solid rgba(var(--accent-rgb),.25); border-radius: 22px; padding: 52px 30px;
}

/* ===== FAQ ===== */
.faq { max-width: 720px; margin: 0 auto; }
.qa { border-bottom: 1px solid var(--line); padding: 20px 0; }
.qa summary { font-weight: 600; font-size: 17px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.qa summary::-webkit-details-marker { display: none; }
.qa[open] summary { color: var(--accent); }
.qa p { color: var(--muted); margin-top: 10px; font-size: 15px; }

/* ===== Modal (Tally) ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: none; z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-inner { background: var(--card); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; padding: 8px; position: relative; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; z-index: 2; }

/* ===== CTA fixo (telemóvel) =====
   Aparece assim que o CTA do hero sai do ecrã: o lead nunca fica sem botão à vista.
   O deslocamento vertical adapta-se ao banner de cookies, para não haver sobreposição. */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(4,4,4,.9); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: none;
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta .btn { width: 100%; }
.sticky-cta .mini { display: block; text-align: center; font-size: 11px; color: var(--muted); margin-top: 7px; }
@media (max-width: 860px) { .sticky-cta { display: block; } }

/* ===== Revelação suave ao scroll ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.4,0,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .sticky-cta { transition: none; }
}

/* ===== Banner de consentimento (RGPD) =====
   Não bloqueia a página: o lead pode ignorá-lo e converter na mesma.
   "Recusar" e "Aceitar" têm o mesmo tamanho — exigência do RGPD. */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300;
  max-width: 680px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; display: flex; align-items: center; gap: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  transform: translateY(160%); transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.consent.show { transform: translateY(0); }
.consent p { flex: 1; margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.consent-btn {
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 9px 18px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: filter .12s ease, background .12s ease;
}
.consent-btn:hover { background: rgba(255,255,255,.06); }
.consent-btn.accept { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.consent-btn.accept:hover { background: var(--accent); filter: brightness(1.05); }

@media (max-width: 640px) {
  .consent { flex-direction: column; align-items: stretch; gap: 12px; left: 10px; right: 10px; bottom: 10px; }
  .consent-actions { gap: 10px; }
  .consent-btn { flex: 1; padding: 12px 10px; }  /* mesma largura: sem dark pattern */
}

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer .wrap { padding: 30px 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ===== Estoque page ===== */
/* 3 viaturas lado a lado em desktop; quebra para 2 e depois 1 conforme o espaço */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; justify-content: center; }
.stock-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.stock-card:hover {
  border-color: rgba(var(--accent-rgb),.35); transform: translateY(-4px);
  box-shadow: 0 18px 46px rgba(0,0,0,.5);
}
.stock-card .body { padding: 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

/* ===== Galeria por viatura ===== */
.gallery { position: relative; aspect-ratio: 4/5; background: #0A0A0A; overflow: hidden; }
.gallery-track { display: flex; height: 100%; transition: transform .38s cubic-bezier(.4,0,.2,1); }
.gallery-slide { min-width: 100%; height: 100%; }
.gallery-slide img {
  width: 100%; height: 100%; object-fit: cover; cursor: zoom-in;
  transition: transform .5s ease;
}
.gallery:hover .gallery-slide img { transform: scale(1.03); }

/* gradiente para o badge assentar sobre a foto */
.gallery::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 120px; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
}
.gal-badge {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.gal-count {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px); color: #fff;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
}
.gal-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px); color: #fff;
  font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s ease, background .2s ease;
}
.gallery:hover .gal-btn { opacity: 1; }
.gal-btn:hover { background: rgba(0,0,0,.8); }
.gal-btn.prev { left: 10px; }
.gal-btn.next { right: 10px; }
.gal-dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 6px; }
.gal-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); border: none; padding: 0; cursor: pointer; transition: all .2s ease; }
.gal-dot.active { background: var(--accent); width: 18px; border-radius: 3px; }

/* Em ecrãs táteis os botões ficam sempre visíveis */
@media (hover: none) { .gal-btn { opacity: 1; } }

/* ===== Lightbox ===== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 200; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.lb-close { position: absolute; top: 18px; right: 22px; background: none; border: none; color: #fff; font-size: 34px; cursor: pointer; line-height: 1; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); border: none; color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; cursor: pointer; }
.lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }
.lb-count { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 14px; }
.stock-card .model { font-size: 19px; font-weight: 700; }
.stock-card .spec { color: var(--muted); font-size: 14px; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 15px; }
/* rótulo do comparativo (ex.: "em novo") — a âncora tem de dizer contra o que compara */
.price-ref { color: var(--muted); font-size: 12px; text-decoration: none; display: block; margin-top: 2px; }
.price-now { color: var(--accent); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.save-badge { display: inline-block; background: rgba(var(--accent-rgb),.12); color: var(--accent); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; width: fit-content; }
.stock-card .btn { margin-top: auto; }

.banner-ok { background: rgba(var(--accent-rgb),.10); border: 1px solid rgba(var(--accent-rgb),.25); border-radius: 14px; padding: 16px 20px; text-align: center; color: var(--text); font-size: 15px; margin-bottom: 32px; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  /* No telemóvel o visitante vem de um anúncio em vídeo e já viu a viatura:
     headline + CTA primeiro, foto depois — mantém o botão acima da dobra. */
  .hero-visual { aspect-ratio: 4/3; }
  .hero { padding-top: 32px; }
  .cards, .steps, .stock-grid { grid-template-columns: 1fr; }
  .locked-grid { grid-template-columns: repeat(2, 1fr); max-width: 380px; }
  /* em ecrãs pequenos não há hover: setas da galeria sempre visíveis */
  .gal-btn { opacity: 1; }
  .section { padding: 48px 0; }
  .sub { font-size: 16px; }
  .trust .wrap { gap: 16px; }
}
