/* =====================================================================
   GUI VEICULOS - Design System
   Direcao: garage premium / performance industrial.
   Base preto quente + ouro da marca. Cortes diagonais ecoando as asas
   do logo. Tipografia de poster automotivo.
   ===================================================================== */

/* ---------- Tokens ------------------------------------------------- */
:root {
    /* Superficies */
    --ink:          #08080A;
    --surface:      #0E0E11;
    --surface-2:    #16161A;
    --surface-3:    #1F1F25;
    --line:         rgba(255, 255, 255, .085);
    --line-strong:  rgba(255, 255, 255, .16);

    /* Marca */
    --gold:         #FFC61A;
    --gold-deep:    #E09B00;
    --gold-soft:    rgba(255, 198, 26, .12);
    --gold-glow:    rgba(255, 198, 26, .28);

    /* Texto */
    --text:         #F6F6F7;
    --text-muted:   #A0A0AB;
    --text-dim:     #6C6C78;
    --on-gold:      #0A0A0B;

    /* Estados */
    --success:      #35C36B;
    --danger:       #FF5A5A;
    --warning:      #FFB020;
    --info:         #4EA8FF;

    /* Tipografia */
    --font-display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
    --font-body:    'Barlow', 'Segoe UI', system-ui, sans-serif;

    --step--1: clamp(.78rem, .76rem + .1vw, .84rem);
    --step-0:  clamp(.95rem, .92rem + .15vw, 1.02rem);
    --step-1:  clamp(1.12rem, 1.05rem + .35vw, 1.35rem);
    --step-2:  clamp(1.4rem, 1.25rem + .7vw, 1.85rem);
    --step-3:  clamp(1.75rem, 1.45rem + 1.4vw, 2.6rem);
    --step-4:  clamp(2.2rem, 1.6rem + 2.6vw, 4rem);
    --step-5:  clamp(2.6rem, 1.7rem + 4vw, 5.4rem);

    /* Espacamento */
    --sp-1: .25rem;
    --sp-2: .5rem;
    --sp-3: .75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;
    --sp-9: 6rem;

    /* Formas */
    --radius:    4px;
    --radius-lg: 8px;
    --cut:       18px;              /* corte diagonal caracteristico */
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
    --shadow-lg: 0 24px 60px -24px rgba(0,0,0,.85);

    --container: 1280px;
    --header-h:  76px;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.04;
    letter-spacing: -.015em;
    text-transform: uppercase;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 2px;
}

::selection { background: var(--gold); color: var(--on-gold); }

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

/* ---------- Utilitarios -------------------------------------------- */
.container {
    width: min(100% - 2.5rem, var(--container));
    margin-inline: auto;
}

@media (max-width: 640px) {
    .container { width: min(100% - 1.75rem, var(--container)); }
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    background: var(--gold);
    color: var(--on-gold);
    padding: .75rem 1.25rem;
    font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.stack > * + * { margin-top: var(--sp-4); }
.text-muted { color: var(--text-muted); }
.text-gold  { color: var(--gold); }
.text-center{ text-align: center; }
.nowrap     { white-space: nowrap; }

/* Marca d'agua diagonal: as "linhas de velocidade" do logo. */
.speedlines {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 46px;
    flex: none;
}
.speedlines span {
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 2px;
}
.speedlines span:nth-child(1) { width: 100%; }
.speedlines span:nth-child(2) { width: 72%; }
.speedlines span:nth-child(3) { width: 44%; }

/* ---------- Titulos de secao --------------------------------------- */
.section {
    padding-block: clamp(3rem, 7vw, 6rem);
    position: relative;
}
.section--tight { padding-block: clamp(2.25rem, 4vw, 3.5rem); }
.section--alt { background: var(--surface); }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--sp-5);
    margin-bottom: var(--sp-6);
    flex-wrap: wrap;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: .65rem;
}
.eyebrow::before {
    content: '';
    width: 26px;
    height: 2px;
    background: var(--gold);
}

.section-title { font-size: var(--step-3); }
.section-title em {
    font-style: normal;
    color: var(--gold);
}
.section-sub {
    color: var(--text-muted);
    max-width: 58ch;
    margin-top: .75rem;
}

/* ---------- Botoes -------------------------------------------------- */
.btn {
    --btn-bg: var(--surface-3);
    --btn-fg: var(--text);
    --btn-bd: var(--line-strong);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .85rem 1.5rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bd);
    font-weight: 700;
    font-size: var(--step--1);
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1;
    border-radius: var(--radius);
    transition: transform .18s var(--ease), background-color .18s var(--ease),
                border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
    white-space: nowrap;
}

.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn svg { width: 18px; height: 18px; flex: none; }

.btn--gold {
    --btn-bg: var(--gold);
    --btn-fg: var(--on-gold);
    --btn-bd: var(--gold);
    box-shadow: 0 0 0 0 var(--gold-glow);
}
.btn--gold:hover {
    --btn-bg: #FFD44D;
    box-shadow: 0 10px 30px -10px var(--gold-glow);
}

.btn--ghost {
    --btn-bg: transparent;
    --btn-bd: var(--line-strong);
}
.btn--ghost:hover { --btn-bd: var(--gold); --btn-fg: var(--gold); }

.btn--whats {
    --btn-bg: #1FA855;
    --btn-fg: #fff;
    --btn-bd: #1FA855;
}
.btn--whats:hover { --btn-bg: #24C062; --btn-bd: #24C062; }

.btn--danger { --btn-bg: transparent; --btn-bd: rgba(255,90,90,.4); --btn-fg: var(--danger); }
.btn--danger:hover { --btn-bg: rgba(255,90,90,.12); --btn-bd: var(--danger); }

.btn--sm  { padding: .6rem 1rem; font-size: .74rem; }
.btn--lg  { padding: 1.05rem 2rem; font-size: var(--step-0); }
.btn--block { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"] {
    opacity: .5;
    pointer-events: none;
}

/* ---------- Badges --------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .32rem .6rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1;
    border-radius: 3px;
    background: var(--surface-3);
    color: var(--text-muted);
    border: 1px solid var(--line);
}
.badge--gold    { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.badge--outline { background: rgba(8,8,10,.72); color: var(--gold); border-color: var(--gold); backdrop-filter: blur(6px); }
.badge--success { background: rgba(53,195,107,.14); color: var(--success); border-color: rgba(53,195,107,.35); }
.badge--danger  { background: rgba(255,90,90,.14); color: var(--danger); border-color: rgba(255,90,90,.35); }
.badge--warning { background: rgba(255,176,32,.14); color: var(--warning); border-color: rgba(255,176,32,.35); }
.badge--info    { background: rgba(78,168,255,.14); color: var(--info); border-color: rgba(78,168,255,.35); }
.badge--muted   { background: var(--surface-2); }

/* ---------- Cards ---------------------------------------------------- */
.card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* ---------- Formularios ---------------------------------------------- */
.field { display: block; margin-bottom: var(--sp-4); }

.field > label,
.label {
    display: block;
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .45rem;
}

.label .req { color: var(--gold); }

.input,
.select,
.textarea {
    width: 100%;
    padding: .8rem .95rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease);
    appearance: none;
}

.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A0A0AB' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    cursor: pointer;
}

.input:hover, .select:hover, .textarea:hover { border-color: rgba(255,255,255,.26); }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
    background: var(--surface-2);
}

.input::placeholder, .textarea::placeholder { color: var(--text-dim); }

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
    border-color: var(--danger);
}

.field-error {
    display: block;
    color: var(--danger);
    font-size: var(--step--1);
    margin-top: .35rem;
}

.field-hint {
    display: block;
    color: var(--text-dim);
    font-size: var(--step--1);
    margin-top: .35rem;
}

.grid-fields {
    display: grid;
    gap: 0 var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.grid-fields--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.span-2 { grid-column: 1 / -1; }

/* Checkbox e radio */
.check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    cursor: pointer;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .16s var(--ease), background-color .16s var(--ease);
    font-size: var(--step--1);
    line-height: 1.45;
}
.check:hover { border-color: var(--line-strong); }
.check input { accent-color: var(--gold); width: 17px; height: 17px; margin-top: 1px; flex: none; }
.check:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.check--plain { border: 0; background: none; padding: 0; }
.check--plain:hover { border: 0; }

fieldset { border: 0; padding: 0; min-width: 0; }

legend.legend {
    font-family: var(--font-display);
    font-size: var(--step-1);
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: var(--sp-3);
    padding-top: var(--sp-4);
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: var(--sp-5);
}

.honeypot {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0;
    height: 0;
    width: 0;
}

/* ---------- Alertas / flash ------------------------------------------ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    font-size: var(--step--1);
    margin-bottom: var(--sp-4);
}
.alert--success { border-color: rgba(53,195,107,.4); background: rgba(53,195,107,.1); color: #9BE9BC; }
.alert--error   { border-color: rgba(255,90,90,.4); background: rgba(255,90,90,.1); color: #FFB3B3; }
.alert--info    { border-color: rgba(78,168,255,.4); background: rgba(78,168,255,.1); color: #B8DBFF; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------- Toast ----------------------------------------------------- */
.toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: min(360px, calc(100vw - 2rem));
}
.toast {
    padding: .85rem 1.1rem;
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: var(--step--1);
    animation: toast-in .3s var(--ease);
}
.toast--error { border-left-color: var(--danger); }
.toast--success { border-left-color: var(--success); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Skeleton --------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--radius);
}
@keyframes shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- Estado vazio ----------------------------------------------- */
.empty {
    text-align: center;
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.empty svg { width: 44px; height: 44px; margin: 0 auto var(--sp-4); color: var(--text-dim); }
.empty h3 { font-size: var(--step-1); margin-bottom: .5rem; }
.empty p { color: var(--text-muted); max-width: 44ch; margin: 0 auto var(--sp-5); }

/* ---------- Paginacao --------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .35rem;
    margin-top: var(--sp-7);
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: .6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: var(--step--1);
    background: var(--surface-2);
    transition: border-color .16s var(--ease), color .16s var(--ease);
}
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination [aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.pagination .is-disabled { opacity: .35; pointer-events: none; }

/* ---------- Tabelas ------------------------------------------------------ */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}

.table { min-width: 640px; }

.table th {
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--surface-3);
}

.table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: var(--step--1);
}

.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .14s var(--ease); }
.table tbody tr:hover { background: rgba(255,255,255,.025); }

/* ---------- Modal --------------------------------------------------------- */
dialog.modal {
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: 0;
    width: min(520px, calc(100vw - 2rem));
    box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.modal__head { padding: 1.25rem 1.5rem .75rem; }
.modal__head h3 { font-size: var(--step-1); }
.modal__body { padding: 0 1.5rem 1.25rem; color: var(--text-muted); font-size: var(--step--1); }
.modal__foot { display: flex; gap: .6rem; justify-content: flex-end; padding: 1rem 1.5rem 1.5rem; }

/* ---------- Animacao de entrada -------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: opacity .55s var(--ease), transform .55s var(--ease);
}
