/* Hybrid Car Center: manutenção de caixas automáticas
   Tokens alinhados com www.hybridcarcenter.pt (preto + laranja, Syne + Inter) */

:root {
  --bg: #0F0F0F;
  --surface: #161616;
  --elevated: #1E1E1E;
  --subtle: #252525;
  --border: #2A2A2A;
  --brand: #E8521A;
  --brand-hover: #FF6A33;
  --brand-dim: rgba(232, 82, 26, .12);
  --text: #F0F0F0;
  --text-2: #A8A8A8;
  --text-3: #8A8A8A;
  --atf: #C8102E;
  --oil: #6B4A22;

  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 700; max-width: 22ch; }
h3 { font-size: 1.15rem; font-weight: 700; }

p { margin: 0; }
a { color: var(--brand); }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 860px; }
.muted { color: var(--text-2); }

/* Botões: o único destino é o formulário */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .8em 1.6em;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #0F0F0F;
  font: 700 1rem/1.1 var(--font-body);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn--small { min-height: 40px; padding: .55em 1.1em; font-size: .92rem; }
.btn--large { min-height: 56px; padding: 1em 2em; font-size: 1.08rem; }
.btn--full { width: 100%; }
.btn--dark { background: var(--bg); color: var(--text); }
.btn--dark:hover { background: #262626; }
.btn--outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px #5A5A5A; }
.btn--outline:hover { background: var(--elevated); }
.btn[disabled] { opacity: .6; cursor: progress; }

.linklike {
  padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-decoration: underline; cursor: pointer;
}

/* Barra de topo */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  background: rgba(15, 15, 15, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.logo { display: block; height: 38px; width: auto; }

/* Hero com vídeo */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  padding: 120px 0 72px;
  overflow: hidden;
  isolation: isolate;
}
.hero__video {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(15,15,15,.96) 0%, rgba(15,15,15,.85) 34%, rgba(15,15,15,.25) 62%, rgba(15,15,15,0) 80%),
    linear-gradient(0deg, var(--bg) 0%, rgba(15,15,15,0) 22%);
}
.hero__content { max-width: var(--wrap); }
.hero__content > * { max-width: 620px; }
.hero__content h1 { max-width: 720px; font-size: clamp(2.1rem, 4.3vw, 3.5rem); }
.eyebrow, .kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 20px;
}
.eyebrow::before, .kicker::before { content: ""; width: 28px; height: 2px; background: var(--brand); }
.hero h1 em { font-style: normal; color: var(--brand); }
.lead { margin-top: 24px; font-size: 1.15rem; color: #C9C9C9; }

.facts { display: flex; margin: 32px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.facts > div { flex: 1 1 0; padding: 14px 16px 14px 0; }
.facts > div + div { padding-left: 16px; border-left: 1px solid var(--border); }
.facts dt { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.facts dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
.facts > .facts__wide { flex-grow: 1.8; }
.note { margin-top: 14px; font-size: .92rem; color: var(--text-2); }

/* Secções */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--raised { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__intro { margin-top: 18px; max-width: 40rem; font-size: 1.1rem; color: var(--text-2); }
.section__intro strong { color: var(--text); }
.section__cta { margin-top: 56px; }

.label {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 14px;
}

.ruled-list { margin-top: 36px; border-top: 1px solid var(--border); }
.ruled-list li {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 4px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.ruled-list strong { font-weight: 600; }
.ruled-list span { color: var(--text-2); }
.ruled-list--single li { grid-template-columns: 1fr; }

/* Porquê */
.why { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.vials { margin: 0; }
.vials svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
.glass { stroke: #D0D0D0; stroke-width: 2; stroke-linecap: round; opacity: .5; }
.glass--lip { stroke-width: 3; opacity: .7; }
.liquid { transform-box: fill-box; transform-origin: bottom; }
.vials__labels { display: grid; grid-template-columns: 1fr 1fr; max-width: 320px; margin: 12px auto 0; text-align: center; font-size: .85rem; font-weight: 600; }
.vials__labels span:first-child { color: #F2556B; }
.vials__labels span:last-child { color: #B88A55; }
.vials__caption { max-width: 320px; margin: 14px auto 0; font-size: .88rem; color: var(--text-2); text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  .liquid { animation: fill 1.1s cubic-bezier(.2, .7, .2, 1) both; animation-play-state: paused; }
  .liquid--b { animation-delay: .35s; }
  .swarf { animation: settle 1.4s .9s ease-out both; animation-play-state: paused; }
  .vials.is-visible .liquid, .vials.is-visible .swarf { animation-play-state: running; }
  @keyframes fill { from { transform: scaleY(0); } }
  @keyframes settle { from { opacity: 0; transform: translateY(-14px); } }
}

.callout {
  margin-top: 64px;
  padding: 28px 32px;
  border-left: 3px solid var(--brand);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 48rem;
}
.callout h3 { margin-bottom: 8px; }
.callout p { color: var(--text-2); }

/* Serviço */
.spec { margin: 48px 0 64px; border-top: 1px solid var(--brand); }
.spec__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 6px 40px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.spec dt { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.spec dd { margin: 0; color: var(--text-2); }

.gearboxes { margin-bottom: 64px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tags li {
  padding: 7px 14px;
  border: 1px solid #3A3A3A;
  border-radius: 999px;
  background: var(--elevated);
  font-size: .92rem;
  font-weight: 600;
}

/* Passos: sequência real, por isso numerados */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.steps li { counter-increment: step; padding-top: 16px; border-top: 2px solid var(--subtle); }
.steps li:first-child { border-top-color: var(--brand); }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--brand);
  margin-bottom: 10px;
}
.steps strong { display: block; }
.steps span { display: block; margin-top: 2px; font-size: .95rem; color: var(--text-2); }

/* Quando + verificador de km */
.when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.km-check {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.km-check label { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.km-check__hint { margin-top: 8px; font-size: .92rem; color: var(--text-2); }
.km-check__field { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: var(--text-2); font-weight: 600; }
.km-check__field input { flex: 1; font-size: 1.3rem; font-weight: 600; }

.km-scale { margin-top: 28px; }
.km-scale__bar {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--atf) 0%, #8A3A1A 45%, var(--oil) 65%, #1C140A 100%);
}
.km-scale__limit { position: absolute; left: 40%; top: -6px; bottom: -6px; width: 2px; background: var(--text); }
.km-scale__marker {
  position: absolute;
  top: 50%; left: 0;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
  opacity: 0;
  transition: left .35s ease, opacity .2s;
}
.km-scale__marker.is-visible { opacity: 1; }
.km-scale__ticks { position: relative; height: 1.4em; margin-top: 10px; font-size: .78rem; color: var(--text-3); }
.km-scale__ticks span { position: absolute; top: 0; }
.km-scale__ticks span:nth-child(1) { left: 0; }
.km-scale__ticks span:nth-child(2) { left: 40%; transform: translateX(-50%); color: var(--text); }
.km-scale__ticks span:nth-child(3) { right: 0; }
.km-check__result { margin-top: 20px; font-weight: 600; }
.km-check__result:empty { display: none; }
#km-cta { margin-top: 18px; }

/* Porque nós */
.reasons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 48px; }
.reasons li { padding-top: 18px; border-top: 2px solid var(--brand); }
.reasons strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.reasons span { display: block; margin-top: 6px; color: var(--text-2); }

/* FAQ */
.faq { margin-top: 40px; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  position: relative;
  padding: 22px 48px 22px 0;
  font-weight: 600;
  font-size: 1.08rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 0; top: 50%;
  width: 32px; height: 32px;
  transform: translateY(-50%);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--elevated);
  color: var(--brand);
  font-size: 1.3rem; font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: #fff; }
.faq details p { padding: 0 48px 24px 0; color: var(--text-2); }

/* CTA final */
.final { background: var(--brand); color: #0F0F0F; padding: clamp(64px, 9vw, 112px) 0; }
.final h2 { max-width: 20ch; }
.final p { margin: 18px 0 32px; max-width: 36rem; font-size: 1.12rem; font-weight: 500; }
.final .btn:focus-visible { outline-color: #0F0F0F; }

/* Rodapé: só informação legal obrigatória */
.footer { background: #0A0A0A; color: var(--text-3); padding: 48px 0 32px; font-size: .88rem; }
.logo--footer { height: 30px; margin-bottom: 18px; opacity: .9; }
.footer p { max-width: 52rem; }
.footer__legal { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; }
.footer__legal a, .footer__legal .linklike { color: var(--text-2); }
.footer__legal a:hover, .footer__legal .linklike:hover { color: var(--text); }
.footer__copy { margin-top: 24px; font-size: .8rem; }

/* Barra fixa no telemóvel */
.mobilebar { display: none; }

/* Formulário */
.modal {
  width: min(640px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(3px); }
.booking { padding: 32px; }
.modal__head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.modal__close {
  width: 40px; height: 40px;
  margin: -8px -8px 0 0;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font-size: 1.8rem; line-height: 1;
  cursor: pointer;
}
.modal__close:hover { background: var(--elevated); color: var(--text); }
.modal__intro { margin-top: 8px; color: var(--text-2); }

fieldset { margin: 28px 0 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 2px; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); }

.field { margin-top: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field label, .label-text { display: block; margin-bottom: 6px; font-weight: 600; font-size: .92rem; }

input[type="text"], input:not([type]), input[type="tel"], input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #3A3A3A;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input::placeholder { color: #6E6E6E; }
input:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }

.radios { display: flex; gap: 28px; }
.radios label, .field--check label { display: flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.field--check { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
input[type="radio"], input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); flex-shrink: 0; }

.field__error { display: none; margin-top: 6px; font-size: .88rem; color: #FF7A59; }
.field.is-invalid .field__error { display: block; }
.field.is-invalid input:not([type="radio"]):not([type="checkbox"]) { border-color: #FF7A59; }
.field__info { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--brand-dim); font-size: .9rem; }
.form-error { margin-top: 20px; padding: 12px 14px; border-left: 3px solid #FF7A59; background: rgba(255, 122, 89, .1); font-size: .92rem; }
.booking .btn--full { margin-top: 24px; }
.booking__legal { margin-top: 14px; font-size: .8rem; color: var(--text-3); }

/* Banner de cookies: aceitar e recusar com o mesmo destaque */
.cookies {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 40;
  max-width: 520px;
  margin-left: auto;
  padding: 20px;
  border: 1px solid #333;
  border-radius: 12px;
  background: var(--elevated);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .6);
  font-size: .92rem;
}
.cookies__title { font-weight: 700; margin-bottom: 4px; font-size: 1rem; }
.cookies p { color: var(--text-2); }
.cookies p a { color: var(--text); }
.cookies__state { margin-top: 8px; font-weight: 600; color: var(--text) !important; }
.cookies__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.cookies__actions .btn { min-height: 44px; padding: .6em 1em; font-size: .92rem; }
.cookies__more { margin-top: 12px; text-align: center; }
.cookies .linklike { color: var(--text-2); font-size: .88rem; }

/* Páginas simples (obrigado, cookies) */
.page { padding: 140px 0 96px; min-height: 70vh; }
.page h1 { font-size: clamp(2rem, 4.5vw, 3rem); max-width: 20ch; }
.page h2 { font-size: 1.35rem; margin: 48px 0 12px; max-width: none; }
.page p, .page li, .page td { color: var(--text-2); }
.page p + p { margin-top: 12px; }
.page ul.bullets { margin-top: 10px; padding-left: 1.2em; list-style: disc; }
.page .meta { margin-top: 12px; font-size: .88rem; color: var(--text-3); }
.page .lead { max-width: 40rem; }

.steps-next { margin-top: 40px; display: grid; gap: 0; border-top: 1px solid var(--border); max-width: 40rem; counter-reset: next; }
.steps-next li { counter-increment: next; display: grid; grid-template-columns: 2.4em 1fr; padding: 16px 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.steps-next li::before { content: counter(next); font-family: var(--font-display); font-weight: 800; color: var(--brand); }
.steps-next strong { color: var(--text); }

.table-wrap { overflow-x: auto; margin-top: 16px; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.cookie-table th { text-align: left; font-weight: 600; color: var(--text); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--brand); }
.cookie-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.cookie-table code { color: var(--text); font-size: .95em; }

/* Responsivo */
@media (max-width: 1000px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { display: grid; grid-template-columns: 2.6em 1fr; padding: 16px 0; border-top: 1px solid var(--border); }
  .steps li:first-child { border-top: 1px solid var(--brand); }
  .steps li::before { grid-row: span 2; margin: 0; font-size: 1.3rem; }
  .reasons { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  body { padding-bottom: 80px; }
  .topbar .btn { display: none; }
  .logo { height: 32px; }
  .hero { min-height: 0; padding: 96px 0 48px; align-items: flex-end; }
  .hero__video { height: 62%; object-position: 62% 50%; }
  .hero__shade { background: linear-gradient(180deg, rgba(15,15,15,.2) 0%, rgba(15,15,15,.55) 30%, var(--bg) 60%); }
  .hero__content { padding-top: 28vh; }
  .why, .when { grid-template-columns: 1fr; }
  .vials svg { max-width: 220px; }
  .ruled-list li { grid-template-columns: 1fr; }
  .spec__row { grid-template-columns: 1fr; }
  .km-check { padding: 22px; }
  .mobilebar {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(15, 15, 15, .94);
    border-top: 1px solid var(--border);
  }
  .cookies { left: 8px; right: 8px; bottom: 8px; padding: 16px; }
  .booking { padding: 22px; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .reasons { grid-template-columns: 1fr; }
  .facts > div { padding-right: 10px; }
  .facts > div + div { padding-left: 10px; }
  .facts dd { font-size: 1.05rem; }
}
