/* ═══════════════════════════════════════════════
   AutoPrime Veículos — tema automotivo premium
   Carvão profundo · prata metálico · vermelho performance
   Display: Saira Condensed · Corpo: Barlow · Dados: IBM Plex Mono
   ═══════════════════════════════════════════════ */

:root {
  --bg:        #0b0c0e;
  --bg-2:      #121418;
  --line:      #23262c;
  --silver:    #c8ccd4;
  --silver-2:  #8b919c;
  --red:       #e02b35;
  --red-deep:  #a11e26;
  --white:     #f2f3f5;

  --display: "Saira Condensed", sans-serif;
  --body:    "Barlow", sans-serif;
  --mono:    "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--silver);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

::selection { background: var(--red); color: var(--white); }

a { color: inherit; }

/* ── Preloader ────────────────────────────── */
#preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.pre-inner { text-align: center; }
.gauge-track { stroke: var(--line); stroke-width: 6; stroke-linecap: round; }
.gauge-fill {
  stroke: var(--red); stroke-width: 6; stroke-linecap: round;
  /* comprimento real do arco: pi x 80 ~ 252 */
  stroke-dasharray: 252; stroke-dashoffset: 252;
}
.gauge-needle {
  stroke: var(--white); stroke-width: 3; stroke-linecap: round;
  transform-origin: 100px 100px;
}
.gauge-hub { fill: var(--red); }
.pre-readout {
  font-family: var(--mono); font-size: 2rem; color: var(--white);
  margin-top: .5rem;
}
.pre-unit { color: var(--silver-2); font-size: 1.1rem; }
.pre-label {
  font-family: var(--display); text-transform: uppercase;
  letter-spacing: .35em; font-size: .8rem; color: var(--silver-2);
  margin-top: .75rem;
}

/* ── Nav ──────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 5vw, 4rem);
  background: linear-gradient(to bottom, rgba(11,12,14,.92), rgba(11,12,14,0));
  transition: background .3s;
}
.nav.scrolled { background: rgba(11,12,14,.95); border-bottom: 1px solid var(--line); }
.nav-brand {
  font-family: var(--display); font-weight: 800; font-size: 1.5rem;
  letter-spacing: .04em; color: var(--white); text-decoration: none;
}
.nav-brand span { color: var(--red); }
.nav-links { display: flex; gap: 2.2rem; align-items: center; }
.nav-links a {
  font-family: var(--display); text-transform: uppercase;
  letter-spacing: .18em; font-size: .85rem; font-weight: 600;
  color: var(--silver); text-decoration: none;
  transition: color .25s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a.nav-cta {
  color: var(--white);
  border: 1px solid var(--red);
  padding: .5rem 1.2rem;
  transition: background .25s;
}
.nav-links a.nav-cta:hover { background: var(--red); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 34px; position: relative;
}
.nav-toggle span {
  position: absolute; left: 7px; right: 7px; height: 2px;
  background: var(--white); transition: transform .3s, top .3s;
}
.nav-toggle span:first-child { top: 12px; }
.nav-toggle span:last-child { top: 20px; }
.nav-toggle.open span:first-child { top: 16px; transform: rotate(45deg); }
.nav-toggle.open span:last-child { top: 16px; transform: rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(11,12,14,.98);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.nav-mobile.open { opacity: 1; pointer-events: auto; }
.nav-mobile a {
  font-family: var(--display); font-size: 2rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--white); text-decoration: none;
}

/* ── Hero ─────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
  padding: 7rem clamp(1.25rem, 5vw, 4rem) 0;
  overflow: hidden;
  clip-path: inset(0);
}
.hero-bg {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--bg);
  clip-path: inset(0);
}
.hero-bg img {
  width: 100%; height: 115%; object-fit: cover; object-position: center;
  filter: saturate(.85);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(11,12,14,.94) 0%, rgba(11,12,14,.78) 45%, rgba(11,12,14,.45) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 35%);
}

.hero-lines { position: absolute; inset: 0; pointer-events: none; }
.hero-lines span {
  position: absolute; height: 1px; left: -10%; right: -10%;
  background: linear-gradient(90deg, transparent, rgba(224,43,53,.5), transparent);
  transform: rotate(-14deg);
}
.hero-lines span:nth-child(1) { top: 22%; }
.hero-lines span:nth-child(2) { top: 50%; opacity: .5; }
.hero-lines span:nth-child(3) { top: 78%; opacity: .25; }

.hero-inner { max-width: 1100px; position: relative; }

.eyebrow {
  font-family: var(--mono); font-size: .8rem;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  line-height: .92; text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--white);
}
.hero-title em {
  font-style: normal; color: transparent;
  -webkit-text-stroke: 2px var(--silver-2);
}
.hero-title .st-char { display: inline-block; }

.hero-sub {
  max-width: 520px; margin-top: 1.75rem;
  color: var(--silver-2); font-size: 1.05rem;
}

.hero-actions { display: flex; gap: 1rem; margin-top: 2.25rem; flex-wrap: wrap; }

.btn {
  font-family: var(--display); font-weight: 700; font-size: 1rem;
  text-transform: uppercase; letter-spacing: .14em;
  padding: 1rem 2.2rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: .6rem;
  cursor: pointer; border: 0;
  transition: transform .2s, background .25s, color .25s, border-color .25s;
}
.btn:active { transform: scale(.97); }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-deep); }
.btn-ghost {
  background: transparent; color: var(--silver);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--silver-2); color: var(--white); }

/* faixa rolante */
.hero-strip {
  position: absolute; bottom: 0; left: 0; right: 0;
  border-top: 1px solid var(--line);
  padding: 1rem 0; overflow: hidden;
  background: var(--bg-2);
}
.strip-track { display: flex; white-space: nowrap; width: max-content; }
.strip-track span {
  font-family: var(--display); font-weight: 600; font-size: .9rem;
  letter-spacing: .3em; color: var(--silver-2);
}

/* ── Seções ───────────────────────────────── */
.section { padding: clamp(5rem, 12vh, 9rem) clamp(1.25rem, 5vw, 4rem); }

.section-head { max-width: 1100px; margin: 0 auto 3.5rem; }

.section-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1; text-transform: uppercase;
  color: var(--white);
}

/* ── Estoque ──────────────────────────────── */
.stock-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
}
.stock-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: border-color .3s, transform .3s;
}
.stock-photo {
  margin: 0; height: 200px; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  clip-path: inset(0);
}
.stock-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.8) contrast(1.05);
  transition: transform .5s ease, filter .5s ease;
}
.stock-card:hover .stock-photo img { transform: scale(1.05); filter: saturate(1) contrast(1.05); }
.stock-body { padding: 1.75rem; }
.stock-card::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 42px; height: 3px; background: var(--red);
  transition: width .35s;
}
.stock-card:hover { border-color: var(--silver-2); transform: translateY(-6px); }
.stock-card:hover::before { width: 100%; }

.stock-year { font-family: var(--mono); font-size: .78rem; color: var(--silver-2); letter-spacing: .1em; }
.stock-model {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2rem, 3.4vw, 2.7rem); line-height: .95;
  color: var(--white); margin: .9rem 0 1.4rem;
}
.stock-specs { list-style: none; border-top: 1px solid var(--line); }
.stock-specs li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.stock-specs span { color: var(--silver-2); }
.stock-specs b { font-family: var(--mono); font-weight: 500; color: var(--silver); }

.stock-link {
  display: inline-block; margin-top: 1.4rem;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; font-size: .82rem;
  color: var(--red); text-decoration: none;
}
.stock-link:hover { color: var(--white); }

/* ── Ficha técnica (assinatura) ───────────── */
.ficha { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.ficha-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.25rem;
  align-items: stretch;
}
.ficha-photo {
  margin: 0; overflow: hidden;
  border: 1px solid var(--line);
  min-height: 320px;
  background: var(--bg);
  clip-path: inset(0);
}
.ficha-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); }

.ficha-panel {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: clamp(1.5rem, 4vw, 3rem);
}
.ficha-row {
  display: flex; align-items: baseline; gap: .9rem;
  padding: .95rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: clamp(.9rem, 1.6vw, 1.05rem);
}
.ficha-row:last-child { border-bottom: 0; }
.ficha-key {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--silver-2); white-space: nowrap;
}
.ficha-dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-4px); }
.ficha-val { font-family: var(--mono); color: var(--white); text-align: right; }
.ficha-val b { font-weight: 500; color: var(--white); }
.ficha-val.ok { color: #57c98a; }

/* ── Processo ─────────────────────────────── */
.steps {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
}
.step { border-top: 2px solid var(--line); padding-top: 1.5rem; position: relative; }
.step-num {
  font-family: var(--mono); color: var(--red); font-size: .85rem;
  display: block; margin-bottom: .9rem;
}
.step h3 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.35rem; letter-spacing: .04em; color: var(--white);
  margin-bottom: .6rem;
}
.step p { color: var(--silver-2); font-size: .95rem; }

/* ── Formulário ───────────────────────────── */
.testdrive { background: var(--bg-2); border-top: 1px solid var(--line); }

.form { max-width: 900px; margin: 0 auto; }
.hp { position: absolute; left: -9999px; opacity: 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; }
.field { display: flex; flex-direction: column; }
.field-full { grid-column: 1 / -1; }

.field label {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; font-size: .78rem; color: var(--silver-2);
  margin-bottom: .5rem;
}
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--line);
  color: var(--white); font-family: var(--body); font-size: 1rem;
  padding: .9rem 1rem; border-radius: 0;
  transition: border-color .25s;
  width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--silver-2);
}
.field input.invalid, .field select.invalid, .field textarea.invalid { border-color: var(--red); }
.field input.valid, .field select.valid, .field textarea.valid { border-color: #57c98a; }
.field-err { color: var(--red); font-size: .8rem; margin-top: .35rem; min-height: 1em; }

.btn-submit { margin-top: 1.75rem; position: relative; }
.btn-spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-submit.loading .btn-spinner { display: inline-block; }
.btn-submit.loading { pointer-events: none; opacity: .75; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-ok, .form-fail {
  margin-top: 1.25rem; padding: 1rem 1.25rem;
  font-size: .95rem; border: 1px solid;
}
.form-ok { color: #57c98a; border-color: rgba(87,201,138,.4); background: rgba(87,201,138,.06); }
.form-fail { color: var(--red); border-color: rgba(224,43,53,.4); background: rgba(224,43,53,.06); }

/* ── Onde estamos ─────────────────────────── */
.contact-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 1.25rem;
  align-items: stretch;
}
.contact-info { display: grid; gap: 1rem; align-content: start; }
.contact-item {
  border: 1px solid var(--line); background: var(--bg-2);
  padding: 1.1rem 1.35rem;
}
.contact-item span {
  display: block;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; font-size: .75rem; color: var(--red);
  margin-bottom: .3rem;
}
.contact-item p { color: var(--silver); }
.contact-item a { color: var(--white); text-decoration: none; transition: color .25s; }
.contact-item a:hover { color: var(--red); }
.contact-map {
  border: 1px solid var(--line); background: var(--bg-2);
  overflow: hidden; clip-path: inset(0);
  min-height: 400px;
}
.contact-map iframe {
  width: 100%; height: 100%; min-height: 400px; border: 0; display: block;
  filter: grayscale(1) invert(.9) hue-rotate(180deg) contrast(.92);
}

/* ── Footer ───────────────────────────────── */
.footer {
  padding: 4rem clamp(1.25rem, 5vw, 4rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--silver-2); font-size: .9rem;
}
.footer-grid {
  max-width: 1100px; margin: 0 auto 2.5rem;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2.5rem;
}
.footer-brand {
  font-family: var(--display); font-weight: 800; font-size: 1.5rem;
  color: var(--white); letter-spacing: .04em; margin-bottom: .6rem;
}
.footer-brand span { color: var(--red); }
.footer-tag { max-width: 300px; font-size: .9rem; }
.footer-col h4 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .16em; font-size: .8rem; color: var(--white);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; display: grid; gap: .5rem; }
.footer-col a { color: var(--silver-2); text-decoration: none; transition: color .25s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  max-width: 1100px; margin: 0 auto;
  border-top: 1px solid var(--line); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  font-size: .8rem;
}
.footer-credit { display: flex; align-items: flex-start; gap: .45rem; }
.codenx-link { display: inline-flex; align-items: center; }
.codenx-link img { height: 15px; display: block; }

/* ── Reveals (estado inicial via JS) ──────── */
.reveal { will-change: transform, opacity; }

/* ── Acessibilidade ───────────────────────── */
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═══ Microinterações ═══════════════════════
   A régua: nada novo na tela — só o que já existe
   respondendo com precisão de painel de instrumentos. */

/* nav: sublinhado vermelho que se desenha da esquerda */
.nav-links a:not(.nav-cta) {
  background-image: linear-gradient(var(--red), var(--red));
  background-size: 0 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 3px;
  transition: color .25s, background-size .35s ease;
}
.nav-links a:not(.nav-cta):hover { background-size: 100% 2px; }

/* ficha técnica: a linha sob o cursor "acende" como um mostrador */
.ficha-row { transition: padding-left .3s ease; }
.ficha-key { transition: color .3s ease; }
.ficha-dots { transition: border-color .3s ease; }
.ficha-row:hover { padding-left: .5rem; }
.ficha-row:hover .ficha-key { color: var(--white); }
.ficha-row:hover .ficha-dots { border-color: var(--red); }

/* estoque: o link estica o tracking, como quem pisa no acelerador */
.stock-link { transition: color .25s, letter-spacing .3s ease; }
.stock-link:hover { letter-spacing: .24em; }

/* formulário: o rótulo do campo em foco assume o vermelho,
   e o campo ganha um fio vermelho na borda esquerda */
.field label { transition: color .25s; }
.field:focus-within label { color: var(--red); }
.field input:focus, .field select:focus, .field textarea:focus {
  box-shadow: inset 2px 0 0 0 var(--red);
}

/* CTA: brilho de lanterna traseira no hover */
.btn { will-change: transform; }
.btn-red { transition: transform .2s, background .25s, box-shadow .35s ease; }
.btn-red:hover { box-shadow: 0 10px 28px -10px rgba(224,43,53,.55); }

/* contato: a barra vermelha desce pela borda esquerda (eco dos cards) */
.contact-item { position: relative; transition: border-color .3s ease; }
.contact-item::before {
  content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px;
  background: var(--red);
  transform: scaleY(0); transform-origin: top;
  transition: transform .35s ease;
}
.contact-item:hover { border-color: var(--silver-2); }
.contact-item:hover::before { transform: scaleY(1); }
.contact-map { transition: border-color .35s ease; }
.contact-map:hover { border-color: var(--silver-2); }

/* rodapé: sublinhado que se desenha, mesmo gesto da nav */
.footer-col a {
  background-image: linear-gradient(var(--red), var(--red));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: color .25s, background-size .3s ease;
}
.footer-col a:hover { background-size: 100% 1px; }
.codenx-link { transition: opacity .25s; opacity: .85; }
.codenx-link:hover { opacity: 1; }

/* ── Mobile ───────────────────────────────── */
@media (max-width: 900px) {
  .stock-grid, .steps { grid-template-columns: 1fr; }
  .ficha-grid { grid-template-columns: 1fr; }
  .ficha-photo { min-height: 220px; max-height: 280px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-map, .contact-map iframe { min-height: 300px; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { justify-content: center; text-align: center; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding-bottom: 5rem; }
  .ficha-row { flex-wrap: wrap; }
  .ficha-dots { display: none; }
  .ficha-val { text-align: left; width: 100%; }
}
