/* =========================================================
   TEMA — SÃO CRISTÓVÃO CENTRO AUTOMOTIVO
   Paleta extraída da logo:
   Amarelo: #E1E319 | Azul marinho: #071141 | Branco: #FAFAEE
   ========================================================= */

:root{
  --brand-yellow: #E1E319;
  --brand-yellow-2: #E4E617;

  --brand-navy: #071141;
  --brand-blue: #101A4F;

  --night-1: #080F32;
  --night-2: #090D23;
  --black:   #05050D;

  --white:   #FFFFFF;
  --paper:   #FAFAEE;

  --text: #FAFAEE;
  --text-dark: #0F1430;
  --muted: #B8BBD0;

  --border: rgba(250,250,238,.14);
  --shadow: 0 10px 28px rgba(0,0,0,.35);

  --radius: 14px;
  --radius-sm: 10px;

  --focus: 0 0 0 4px rgba(225,227,25,.20);

  /* ✅ Espaço reservado para o header sticky (ajuste fino se quiser) */
  --header-offset: 78px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(16,26,79,.55), transparent 60%),
    radial-gradient(900px 600px at 85% 15%, rgba(7,17,65,.60), transparent 55%),
    linear-gradient(180deg, var(--black), var(--night-2) 55%, #050715);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.35;

  /* ✅ Garante que o conteúdo (incluindo carrossel) comece abaixo do header sticky */
  padding-top: var(--header-offset);
}

a{ color: var(--brand-yellow); text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* -----------------------------
   TOPO / NAVBAR
------------------------------ */
.header{
  position: fixed; /* ✅ Melhor do que sticky nesse caso: evita "morder" o layout */
  top: 0;
  left: 0;
  right: 0;
  z-index: 999; /* ✅ Sempre acima do carrossel */
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(5,5,13,.88), rgba(5,5,13,.55));
  border-bottom: 1px solid var(--border);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(225,227,25,.12);
  border: 1px solid rgba(225,227,25,.28);
  display: grid;
  place-items: center;
}

.brand-title{
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-title strong{ font-size: 15px; letter-spacing: .5px; }
.brand-title span{ font-size: 12px; color: var(--muted); }

/* -----------------------------
   BOTÕES
------------------------------ */
.btn{
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn:active{ transform: translateY(1px); }
.btn:focus{ outline: none; box-shadow: var(--focus); }

.btn-primary{
  color: #0C1030;
  background: linear-gradient(180deg, var(--brand-yellow), var(--brand-yellow-2));
  box-shadow: 0 10px 24px rgba(225,227,25,.18);
}
.btn-primary:hover{ filter: brightness(1.02); }

.btn-outline{
  color: var(--text);
  background: rgba(250,250,238,.04);
  border-color: rgba(225,227,25,.35);
}
.btn-outline:hover{
  background: rgba(225,227,25,.10);
  border-color: rgba(225,227,25,.55);
}

.btn-ghost{
  color: var(--text);
  background: transparent;
  border-color: rgba(250,250,238,.12);
}
.btn-ghost:hover{ background: rgba(250,250,238,.06); }

/* -----------------------------
   CARDS / PAINÉIS
------------------------------ */
.card{
  background: linear-gradient(180deg, rgba(250,250,238,.06), rgba(250,250,238,.03));
  border: 1px solid rgba(250,250,238,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header{
  padding: 16px 16px 10px 16px;
  border-bottom: 1px solid rgba(250,250,238,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title{
  margin: 0;
  font-size: 16px;
  letter-spacing: .4px;
}
.card-subtitle{
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.card-body{ padding: 16px; }

/* KPI */
.kpis{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.kpi{
  grid-column: span 3;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(225,227,25,.18);
  background: radial-gradient(600px 240px at 10% 0%, rgba(225,227,25,.10), transparent 55%),
              linear-gradient(180deg, rgba(16,26,79,.45), rgba(7,17,65,.25));
}
.kpi small{ color: var(--muted); display:block; }
.kpi strong{ font-size: 22px; display:block; margin-top: 6px; }

/* -----------------------------
   FORM / INPUTS
------------------------------ */
.form-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.field{ grid-column: span 4; display:flex; flex-direction:column; gap: 6px; }
.field label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: .2px;
}

.input, select, textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(250,250,238,.14);
  background: rgba(5,5,13,.25);
  color: var(--text);
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.input:focus, select:focus, textarea:focus{
  border-color: rgba(225,227,25,.55);
  box-shadow: var(--focus);
  background: rgba(5,5,13,.35);
}

.help{
  font-size: 12px;
  color: var(--muted);
}

/* -----------------------------
   TABELAS
------------------------------ */
.table-wrap{ overflow: auto; border-radius: 14px; border: 1px solid rgba(250,250,238,.10); }
table{
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: rgba(250,250,238,.03);
}
thead th{
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(225,227,25,.18), rgba(225,227,25,.10));
  color: var(--paper);
  text-align: left;
  font-size: 12px;
  letter-spacing: .3px;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(250,250,238,.10);
}
tbody td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(250,250,238,.07);
  color: rgba(250,250,238,.92);
}
tbody tr:hover{ background: rgba(225,227,25,.06); }
td.num{ text-align: right; font-variant-numeric: tabular-nums; }

/* -----------------------------
   BADGES / STATUS
------------------------------ */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(250,250,238,.14);
  background: rgba(250,250,238,.05);
  color: var(--paper);
}
.badge.ok{
  border-color: rgba(225,227,25,.45);
  background: rgba(225,227,25,.12);
  color: var(--brand-yellow);
}
.badge.warn{
  border-color: rgba(255,199,0,.40);
  background: rgba(255,199,0,.10);
  color: #FFD55C;
}
.badge.danger{
  border-color: rgba(255,70,70,.42);
  background: rgba(255,70,70,.10);
  color: #FF8A8A;
}

/* -----------------------------
   ALERTAS
------------------------------ */
.alert{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(250,250,238,.12);
  background: rgba(250,250,238,.05);
}
.alert strong{ color: var(--brand-yellow); }

/* -----------------------------
   FOOTER
------------------------------ */
.footer{
  padding: 22px 0 26px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid rgba(250,250,238,.08);
  margin-top: 26px;
}

/* -----------------------------
   RESPONSIVO
------------------------------ */
@media (max-width: 980px){
  .kpi{ grid-column: span 6; }
  .field{ grid-column: span 6; }
}
@media (max-width: 640px){
  .header-inner{ flex-direction: column; align-items: flex-start; }
  .kpi{ grid-column: span 12; }
  .field{ grid-column: span 12; }

  /* ✅ Header ocupa mais linhas no mobile, então aumentamos o offset */
  :root { --header-offset: 104px; }
}

/* ===========================
   CARROSSEL - HOME
=========================== */
.carousel {
  position: relative;
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(250,250,238,.08);
  z-index: 1;
}

.carousel-track {
  display: flex;
  transition: transform .6s ease;
}

.carousel-slide {
  min-width: 100%;
  height: 420px;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.85);
}

/* Botões */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(5,5,13,.6);
  border: 1px solid rgba(225,227,25,.5);
  color: var(--brand-yellow);
  font-size: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s ease;
  z-index: 5;
}

.carousel-btn:hover {
  background: rgba(225,227,25,.15);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

/* Responsivo */
@media (max-width: 768px) {
  .carousel,
  .carousel-slide {
    height: 240px;
  }
}
/* ===========================
   POPUP PROMOÇÃO
=========================== */
.promo-modal{
  position: fixed;
  inset: 0;
  display: none; /* aberto via JS */
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.promo-modal.is-open{ display: flex; }

.promo-overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(6px);
}

.promo-card{
  position: relative;
  width: min(560px, 92vw);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(225,227,25,.35);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  background:
    radial-gradient(900px 380px at 10% 0%, rgba(225,227,25,.10), transparent 55%),
    linear-gradient(180deg, rgba(16,26,79,.55), rgba(5,5,13,.88));
}

.promo-close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(250,250,238,.18);
  background: rgba(5,5,13,.45);
  color: var(--paper);
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.promo-close:hover{
  border-color: rgba(225,227,25,.45);
  background: rgba(225,227,25,.12);
  color: var(--brand-yellow);
}

.promo-top{
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(250,250,238,.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.promo-tag{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .7px;
  color: #0C1030;
  background: linear-gradient(180deg, var(--brand-yellow), var(--brand-yellow-2));
  box-shadow: 0 10px 22px rgba(225,227,25,.16);
}

.promo-title{
  font-weight: 800;
  font-size: 13px;
  color: rgba(250,250,238,.92);
  text-align: right;
}

.promo-body{ padding: 16px; }

.promo-text{
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .2px;
  color: var(--paper);
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.promo-actions{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.promo-cta{
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
}

.promo-later{
  justify-content: center;
  border-radius: 14px;
}

.promo-footnote{
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  opacity: .95;
}

@media (max-width: 480px){
  .promo-text{ font-size: 18px; }
}
/* ===========================
   NAV MOBILE (hambúrguer)
=========================== */
.nav{
  display:flex;
  align-items:center;
  gap:10px;
  position: relative; /* ✅ ancoragem do dropdown */
}

.nav-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

/* Botão hambúrguer */
.nav-toggle{
  display:none;
  width:44px;
  height:44px;
  border-radius: 12px;
  border: 1px solid rgba(225,227,25,.35);
  background: rgba(250,250,238,.04);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:10px;
}
.nav-toggle:hover{
  background: rgba(225,227,25,.10);
  border-color: rgba(225,227,25,.55);
}
.nav-toggle span{
  display:block;
  width:22px;
  height:2px;
  background: var(--brand-yellow);
  border-radius: 2px;
}

/* Mobile */
@media (max-width: 820px){
  .nav-links{ display:none; }
  .nav-toggle{ display:flex; }
}

/* Dropdown */
.nav.is-open .nav-links{
  display:flex;
  position:absolute;
  right: 0;
  top: calc(100% + 10px); /* ✅ sem var inexistente */
  width: min(360px, 92vw);
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  border-radius: 16px;
  border: 1px solid rgba(225,227,25,.28);
  background:
    radial-gradient(900px 380px at 10% 0%, rgba(225,227,25,.10), transparent 55%),
    linear-gradient(180deg, rgba(16,26,79,.70), rgba(5,5,13,.92));
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  z-index: 1200;
}

/* Botões e badge ocupam 100% no dropdown */
.nav.is-open .nav-links .btn{
  width: 100%;
  justify-content: center;
}
.nav.is-open .nav-links .badge{
  width: 100%;
  justify-content: center;
  white-space: normal !important;
  text-align: center;
}

/* ===========================
   LOGIN – corrigir largura/caixa
=========================== */
body.login-page{
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

/* wrapper controla a largura do login */
.login-wrapper{
  width: 100%;
  max-width: 420px;
}

/* garante que o card NÃO vire faixa */
.login-card{
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
  overflow: hidden;
}

/* header centralizado */
.login-header{
  justify-content: center;
  text-align: center;
}

/* marca/logo */
.login-brand{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.login-brand-logo{
  width: 90px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.45));
}

/* deixar o form com cara de login (compacto) */
.login-form{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.login-form .field{
  grid-column: auto !important;
}

.login-form .input{
  padding: 10px 12px;
  font-size: 14px;
}

.login-form label{
  font-size: 12px;
}
/* ===========================
   LOGIN – toggle senha + rodapé
=========================== */
.pw-wrap{
  position: relative;
}

.pw-input{
  padding-right: 46px; /* espaço pro botão */
}

.pw-toggle{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(250,250,238,.14);
  background: rgba(250,250,238,.04);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.pw-toggle:hover{
  border-color: rgba(225,227,25,.45);
  background: rgba(225,227,25,.10);
}

.pw-ico{
  width: 18px;
  height: 18px;
  fill: var(--brand-yellow);
  opacity: .95;
}

.login-footer{
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: rgba(184,187,208,.9);
}
