/* ===================================================================
   AC SISTEM — Estilos globais (tokens, reset, fontes, header, footer)
   CSS Nesting nativo — conforme modelo-css.md
   =================================================================== */

/* -------- Fontes (self-hosted) -------- */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/poppins-light.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/poppins-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/poppins-medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/poppins-semibold.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/poppins-bold.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/poppins-extrabold.woff2') format('woff2');
}

/* -------- Tokens -------- */
:root {
    --cor-primaria: #2290cd;
    --cor-secundaria: #252525;
    --cor-branco: #ffffff;
    --cor-fundo-2: #3b515c;
    --cor-fundo1: #f1f1f1;
    --cor-texto-claro: #f5f7fa;

    --fonte-base: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --container-max: 1200px;
    --header-py: 20px;

    --radius-pill: 61px;
}

/* -------- Transição entre páginas (View Transitions API, cross-document) --------
   Puro CSS: navegadores compatíveis animam a troca de páginas; os demais
   navegam normalmente (degrada sozinho). Sem JS, sem custo de performance. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

::view-transition-old(root) {
    animation-name: vt-page-out;
}

::view-transition-new(root) {
    animation-name: vt-page-in;
}

@keyframes vt-page-out {
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes vt-page-in {
    from { opacity: 0; transform: translateY(14px); }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* -------- Reset leve -------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    /* Reserva a barra de rolagem sempre, evitando o "pulo" horizontal
       quando a trava de scroll da intro é liberada */
    scrollbar-gutter: stable;
}

/* Barra de rolagem — Chrome, Edge, Safari (pseudo-elementos webkit) */
::-webkit-scrollbar {
    width: 10px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--cor-primaria);
}
::-webkit-scrollbar-thumb {
    background: var(--cor-branco);
    border-radius: 10px;
    border: 3px solid var(--cor-primaria);
}
::-webkit-scrollbar-thumb:hover {
    background: #e6f1f9;
}

/* Firefox: polegar branco / trilho azul (não afeta os webkit acima) */
@supports (-moz-appearance: none) {
    html {
        scrollbar-color: var(--cor-branco) var(--cor-primaria);
        scrollbar-width: thin;
    }
}

body {
    font-family: var(--fonte-base);
    font-weight: 400;
    color: var(--cor-secundaria);
    background: var(--cor-branco);
    line-height: 1.5;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    font: inherit;
    cursor: pointer;
    background: none;
    border: none;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 24px;
}

/* -------- Preloader / Intro (logo partindo ao meio) -------- */
body.intro-active {
    overflow: hidden;
}

#intro {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;

    --logo-w: min(72vw, 360px);

    .panel {
        display: flex;
        align-items: center;
        width: 50vw;
        height: 100dvh;
        background: var(--cor-primaria);
        overflow: hidden;
        will-change: transform;
    }

    .logo-full {
        flex-shrink: 0;
        width: var(--logo-w);
        aspect-ratio: 250 / 84;
        background: var(--cor-branco);
        -webkit-mask: url('../img/logo.svg') no-repeat center / contain;
        mask: url('../img/logo.svg') no-repeat center / contain;
        will-change: transform, opacity;
    }

    .panel.left {
        justify-content: flex-end;

        .logo-full {
            margin-right: calc(var(--logo-w) / -2);
            transform-origin: right center;
        }
    }

    .panel.right {
        justify-content: flex-start;

        .logo-full {
            margin-left: calc(var(--logo-w) / -2);
            transform-origin: left center;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    #intro { display: none; }
    body.intro-active { overflow: auto; }
}

/* -------- Header -------- */
.site-header {
    position: relative;
    width: 100%;
    background: var(--cor-branco);
    z-index: 20;

    /* Variante transparente sobreposta ao hero (home) */
    &.site-header--overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background: transparent;
    }

    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding-block: var(--header-py);
    }

    .logo {
        flex-shrink: 0;

        img {
            width: clamp(160px, 13vw, 250px);
            height: auto;
        }
    }

    .primary-nav {
        ul {
            display: flex;
            align-items: center;
            gap: 24px;
        }

        a {
            font-weight: 300;
            font-size: 16px;
            letter-spacing: 0.96px;
            text-transform: uppercase;
            color: var(--cor-secundaria);
            white-space: nowrap;
            transition: color 0.2s ease;

            &:hover,
            &.active {
                color: var(--cor-primaria);
            }
        }
    }

    .nav-toggle {
        display: none;
        flex-direction: column;
        gap: 6px;
        width: 44px;
        padding: 8px;

        span {
            display: block;
            width: 100%;
            height: 3px;
            background: var(--cor-secundaria);
            border-radius: 2px;
            transition: transform 0.3s ease, opacity 0.3s ease;
        }
    }
}

/* -------- Botão primário -------- */
.btn-primary {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-shrink: 0;
    padding: 16px 26px;
    border: 0.724px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-pill);
    background: var(--cor-primaria);
    color: var(--cor-branco);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.78px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: transform 0.2s ease, filter 0.2s ease;

    /* Rajada de vento que cruza o botão no hover */
    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 45%;
        height: 100%;
        background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        transform: translateX(-200%) skewX(-18deg);
        pointer-events: none;
    }

    &:hover {
        filter: brightness(1.08);
        transform: translateY(-1px);
    }

    &:hover::before { animation: btn-gust 0.7s ease; }
    &:hover .btn-icon { animation: btn-breeze 0.7s ease; }

    .btn-icon {
        position: relative;
        z-index: 1;
        width: 16px;
        height: 16px;
        background: var(--cor-branco);
        -webkit-mask: url('../img/home/seta-circulo.png') no-repeat center / contain;
        mask: url('../img/home/seta-circulo.png') no-repeat center / contain;
    }
}

@keyframes btn-gust {
    to { transform: translateX(320%) skewX(-18deg); }
}

@keyframes btn-breeze {
    35% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary::before { display: none; }
    .btn-primary:hover::before,
    .btn-primary:hover .btn-icon { animation: none; }
}

/* Botão secundário (contorno) */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
    padding: 16px 26px;
    border: 1px solid var(--cor-fundo-2);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--cor-fundo-2);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1.08px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;

    &:hover {
        background: var(--cor-fundo-2);
        color: var(--cor-branco);
        transform: translateY(-1px);

        .btn-icon--dark { background: var(--cor-branco); }
    }

    .btn-icon {
        width: 20px;
        height: 20px;
    }
}

.btn-icon--dark {
    background: var(--cor-fundo-2);
    -webkit-mask: url('../img/home/seta-circulo.png') no-repeat center / contain;
    mask: url('../img/home/seta-circulo.png') no-repeat center / contain;
    transition: background 0.2s ease;
}

/* Título de seção — reutilizável */
.section-title {
    font-weight: 700;
    font-size: clamp(1.9rem, 3.4vw, 2.625rem);
    line-height: 1.3;
    color: var(--cor-secundaria);

    .accent { color: var(--cor-primaria); }
}

/* Eyebrow de seção (estrela + rótulo) — reutilizável */
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: clamp(15px, 1.5vw, 20px);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--cor-fundo-2);

    img { width: 20px; height: auto; }
}

/* Botão tamanho grande (hero) */
.btn-lg {
    gap: 12px;
    padding: 22px 36px;
    font-size: 18px;
    letter-spacing: 1.08px;

    .btn-icon { width: 22px; height: 22px; }
}

/* -------- Footer -------- */
.site-footer {
    background: var(--cor-fundo-2);
    color: var(--cor-texto-claro);
    border-top: 1px solid rgba(238, 238, 238, 0.15);
    padding-block: 40px;

    .container {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    h2 {
        font-weight: 700;
        font-size: 16px;
        letter-spacing: 0.64px;
        text-transform: uppercase;
        color: var(--cor-branco);
        margin-bottom: 16px;
    }

    .footer-top {
        display: flex;
        justify-content: space-between;
        gap: 40px;
        padding-top: 20px;
    }

    .footer-logo img {
        width: 250px;
        height: auto;
    }

    a {
        color: var(--cor-texto-claro);
        transition: color 0.2s ease;

        &:hover { color: var(--cor-primaria); }
    }

    .social-list {
        display: flex;
        gap: 24px;
        align-items: center;

        img { width: 25px; height: 25px; }

        a {
            display: inline-flex;
            transition: transform 0.2s ease, opacity 0.2s ease;

            &:hover { transform: translateY(-2px); opacity: 0.85; }
        }
    }

    .footer-links ul {
        display: flex;
        flex-direction: column;
        gap: 13px;

        a {
            font-weight: 300;
            font-size: 15px;
        }
    }

    .footer-contact ul {
        display: flex;
        flex-direction: column;
        gap: 12px;

        li {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 300;
            font-size: 15px;
            letter-spacing: 0.6px;
        }

        img { width: 18px; height: 18px; flex-shrink: 0; }

        .footer-address {
            align-items: flex-start;

            address {
                font-style: normal;
                line-height: 1.4;
            }
        }
    }

    .footer-divider {
        width: 100%;
        height: 0;
        border: none;
        border-top: 1px solid rgba(238, 238, 238, 0.15);
        margin: 0;
    }

    .footer-copy {
        text-align: center;
        font-weight: 300;
        font-size: 16px;
        letter-spacing: 0.64px;

        strong { font-weight: 600; }
    }
}

@media (max-width: 900px) {
    .site-footer .footer-top {
        flex-wrap: wrap;
        gap: 32px;
    }
}

@media (max-width: 600px) {
    .site-footer .footer-top {
        flex-direction: column;
    }

    /* Apenas a logo centralizada (colunas seguem à esquerda). O disclaimer
       (.footer-copy) já é centralizado. */
    .site-footer .footer-logo {
        align-self: center;
    }
}

/* -------- Responsivo -------- */
@media (max-width: 900px) {
    .site-header {
        /* Hambúrguer à esquerda (absoluto) e logo centralizada + margem no topo */
        .header-inner {
            position: relative;
            justify-content: center;
            padding-top: 32px;
        }

        .logo { order: 2; }

        .nav-toggle {
            display: flex;
            order: 1;
            position: absolute;
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
        }

        .primary-nav {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--cor-branco);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
            transform: translateY(-8px);
            opacity: 0;
            visibility: hidden;
            transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
            z-index: 20;

            ul {
                flex-direction: column;
                align-items: flex-start;
                gap: 4px;
                padding: 16px 24px;
            }

            a {
                display: block;
                padding: 10px 0;
            }
        }

        &.nav-open .primary-nav {
            transform: translateY(0);
            opacity: 1;
            visibility: visible;
        }
    }

    /* Esconde apenas o CTA do header no mobile (o hambúrguer assume) */
    .site-header .btn-primary {
        display: none;
    }
}
