/* ============================================================
   Cortex Soluções — Estilos do site institucional (TEMA ESCURO)
   ============================================================ */

:root {
    color-scheme: dark;

    --roxo-900: #1a0b3d;
    --roxo-800: #2a0f5e;
    --roxo-700: #4b1d8f;
    --roxo-600: #6326b3;
    --roxo-500: #7b2ff0;
    --roxo-300: #a78bfa;

    --teal-500: #14b8a6;
    --teal-400: #2dd4bf;
    --verde-500: #22c55e;

    /* Superfícies escuras */
    --bg:        #0c0916;   /* fundo principal */
    --bg-soft:   #120d20;   /* seção alternada */
    --surface:   #18122b;   /* cards / form */
    --surface-2: #221a3b;   /* inputs / hover */

    --ink:   #f2effb;       /* texto/títulos claros */
    --muted: #a7a1c4;       /* texto secundário */
    --line:  rgba(255,255,255,.09);
    --line-strong: rgba(255,255,255,.16);

    --grad-hero: linear-gradient(135deg, #140a33 0%, #2a0f5e 45%, #4b1d8f 100%);
    --grad-acento: linear-gradient(135deg, #7b2ff0 0%, #14b8a6 100%);

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 18px 44px -20px rgba(0, 0, 0, .75);
    --shadow-sm: 0 10px 26px -18px rgba(0, 0, 0, .8);
    --glow: 0 0 0 1px rgba(123,47,240,.35), 0 18px 40px -18px rgba(123,47,240,.45);
    --maxw: 1140px;
    --header-h: 74px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); overflow-x: clip; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; line-height: 1.15; margin: 0; color: var(--ink); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .98rem;
    padding: .82rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
    cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    white-space: nowrap;
}
.btn-sm { padding: .55rem 1.05rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--roxo-500); color: #fff; box-shadow: 0 12px 30px -12px rgba(123,47,240,.6); }
.btn-primary:hover { background: #8b46f5; transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(123,47,240,.75); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    height: var(--header-h);
    background: rgba(12, 9, 22, .82);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
/* logo em branco para contraste no header escuro */
.brand-logo { height: 38px; width: auto; filter: brightness(0) invert(1); }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { font-weight: 500; color: var(--ink); font-size: .98rem; transition: color .15s ease; }
.nav a:not(.btn):hover { color: var(--roxo-300); }
.nav-cta { color: #fff; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--grad-hero); color: #fff; overflow: hidden; }
.hero-overlay {
    position: absolute; inset: 0;
    background:
        radial-gradient(900px 500px at 80% -10%, rgba(20,184,166,.28), transparent 60%),
        radial-gradient(700px 500px at 0% 110%, rgba(123,47,240,.4), transparent 55%);
    pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; padding: 5.2rem 22px 5.6rem; }
.hero-eyebrow {
    display: inline-block; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
    font-weight: 600; color: var(--teal-400); margin-bottom: 1rem;
    padding: .35rem .8rem; border: 1px solid rgba(45,212,191,.4); border-radius: 999px;
}
.hero-title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; color: #fff; }
.hero-title .grad {
    background: linear-gradient(90deg, #2dd4bf, #a78bfa);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 1.4rem 0 2rem; font-size: 1.08rem; color: rgba(255,255,255,.85); max-width: 36rem; }
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(330px, 80%); border-radius: 24px; box-shadow: 0 30px 60px -25px rgba(0,0,0,.7); }

/* ---------- Seções ---------- */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-tag {
    display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--roxo-300); margin-bottom: .7rem;
}
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.section-head p { color: var(--muted); margin-top: .8rem; font-size: 1.05rem; }

/* ---------- Cards de serviços ---------- */
/* Carrossel de serviços: ficam em uma linha; viram slide quando não cabem */
.cards-wrap { position: relative; }
.cards {
    display: flex; gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    justify-content: safe center;
    padding: 14px 4px 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    -webkit-overflow-scrolling: touch;
}
.cards::-webkit-scrollbar { height: 8px; }
.cards::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.cards::-webkit-scrollbar-track { background: transparent; }

/* setas (aparecem só quando há overflow — controlado via JS) */
.cards-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
    display: none; place-items: center; cursor: pointer; z-index: 5;
    font-size: 1.7rem; line-height: 1; padding-bottom: 3px;
    box-shadow: var(--shadow-sm); transition: background .15s ease, transform .15s ease;
}
.cards-nav:hover { background: var(--surface-2); transform: translateY(-50%) scale(1.06); }
.cards-prev { left: -6px; }
.cards-next { right: -6px; }
.cards-wrap.has-overflow .cards-nav { display: grid; }

.card {
    flex: 0 0 280px; scroll-snap-align: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 2rem 1.7rem; box-shadow: var(--shadow-sm);
    text-align: center; display: block; color: inherit; cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-6px); box-shadow: var(--glow); border-color: rgba(123,47,240,.5); outline: none; }
/* destaque temporário ao chegar via link do rodapé */
.card--destaque { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--roxo-500), var(--shadow); border-color: var(--roxo-500); }
.card-icon {
    width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
    background: var(--grad-acento); color: #fff; margin: 0 auto 1.2rem;
    box-shadow: 0 10px 24px -12px rgba(123,47,240,.7);
}
.card-icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.22rem; margin-bottom: .9rem; }
.card-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.card-list li { position: relative; padding-left: 1.4rem; margin-bottom: .6rem; color: var(--muted); font-size: .96rem; }
.card-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--teal-400); }
.card-list em { color: var(--roxo-300); font-style: normal; font-weight: 600; }

/* ---------- Por que nós ---------- */
.porque-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.porque-text h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 1.2rem; }
.porque-text p { color: var(--muted); margin: 0 0 1rem; font-size: 1.04rem; }
.porque-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.porque-list li {
    background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--roxo-500);
    border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm);
}
.porque-list strong { display: block; font-family: 'Poppins', sans-serif; color: var(--ink); margin-bottom: .2rem; }
.porque-list span { color: var(--muted); font-size: .95rem; }

/* ---------- Contato ---------- */
.contato-inner { display: grid; grid-template-columns: .95fr 1.05fr; gap: 3rem; align-items: start; }
.contato-info h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.contato-lead { color: var(--muted); margin: .8rem 0 2rem; font-size: 1.05rem; }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
.info-list li { display: flex; gap: 1rem; align-items: flex-start; }
.info-ic { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(123,47,240,.16); color: var(--roxo-300); border: 1px solid rgba(123,47,240,.28); }
.info-ic svg { width: 21px; height: 21px; }
.info-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.info-list a { font-weight: 600; color: var(--ink); transition: color .15s ease; }
.info-list a:hover { color: var(--roxo-300); }
.info-plain { color: var(--ink); font-weight: 500; }

/* ---------- Formulário ---------- */
.contato-form-wrap {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 2rem; box-shadow: var(--shadow);
}
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .45rem; color: var(--ink); }
.field input, .field select, .field textarea {
    width: 100%; padding: .8rem .9rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 1rem; color: var(--ink); background: var(--surface-2); transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder, .field textarea::placeholder { color: #8b86a8; }
.field select option { background: var(--surface-2); color: var(--ink); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--roxo-500); box-shadow: 0 0 0 3px rgba(123,47,240,.28);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: .9rem 0 0; font-size: .95rem; min-height: 1.2em; }
.form-status.ok { color: #34d399; font-weight: 600; }
.form-status.erro { color: #f87171; font-weight: 600; }
.form-flash { padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; font-weight: 500; }
.flash-ok { background: rgba(16,185,129,.12); color: #34d399; border: 1px solid rgba(16,185,129,.35); }
.flash-erro { background: rgba(248,113,113,.1); color: #f87171; border: 1px solid rgba(248,113,113,.35); }

/* ---------- Footer ---------- */
.site-footer { background: var(--roxo-900); color: rgba(255,255,255,.8); margin-top: 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; padding: 3.5rem 22px 2.5rem; }
.footer-brand { display: flex; align-items: center; gap: 1rem; max-width: 320px; }
.footer-logo { width: 56px; height: 56px; border-radius: 12px; }
.footer-brand strong { display: block; font-family: 'Poppins', sans-serif; color: #fff; font-size: 1.15rem; }
.footer-brand span { font-size: .92rem; color: rgba(255,255,255,.68); }
.footer-cols { display: flex; gap: 3.5rem; flex-wrap: wrap; }
.footer-cols h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-cols a { display: block; color: rgba(255,255,255,.74); margin-bottom: .55rem; font-size: .94rem; transition: color .15s ease; }
.footer-cols a:hover { color: var(--teal-400); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); }
.footer-bottom .container { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; padding-top: 1.3rem; padding-bottom: 1.3rem; font-size: .85rem; color: rgba(255,255,255,.55); }

/* ---------- Bolhas flutuantes (FAB) ---------- */
.fab-stack { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .9rem; }

/* Cápsula escura: colapsada mostra só o círculo colorido; no hover expande
   para a esquerda revelando o número (mantém o ícone fixo à direita). */
.fab {
    display: flex; align-items: center; justify-content: flex-end;
    height: 54px; max-width: 54px;
    border-radius: 999px; overflow: hidden;
    background: #15102a;
    color: #fff; text-decoration: none;
    box-shadow: 0 14px 30px -10px rgba(0,0,0,.7), inset 0 0 0 1px var(--line);
    transition: max-width .4s cubic-bezier(.4,0,.2,1), box-shadow .2s ease;
}
.fab-text {
    white-space: nowrap; font-weight: 600; font-size: .98rem;
    padding: 0 .5rem 0 1.15rem; color: #fff;
}
.fab-btn {
    flex: 0 0 54px; width: 54px; height: 54px; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
}
.fab-btn svg { width: 27px; height: 27px; }
.fab-wpp .fab-btn { background: #25d366; }
.fab-tel .fab-btn { background: var(--roxo-500); }
.fab:hover, .fab:focus-visible {
    max-width: 290px;
    box-shadow: 0 18px 38px -10px rgba(0,0,0,.85), inset 0 0 0 1px var(--line-strong);
    outline: none;
}

/* ---------- Responsivo ---------- */
@media (max-width: 880px) {
    .nav {
        position: fixed; top: var(--header-h); right: 0; width: min(280px, 80vw);
        height: calc(100vh - var(--header-h)); background: #0f0b1c; border-left: 1px solid var(--line);
        flex-direction: column; align-items: flex-start; gap: 0; padding: 1.2rem;
        transform: translateX(100%); visibility: hidden; z-index: 55;
        transition: transform .25s ease, visibility 0s linear .25s; box-shadow: var(--shadow);
    }
    .nav.open { transform: translateX(0); visibility: visible; transition: transform .25s ease, visibility 0s; }

    .fab-stack { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .nav a { width: 100%; padding: .85rem .2rem; border-bottom: 1px solid var(--line); }
    .nav .nav-cta { margin-top: .8rem; width: 100%; border-bottom: 0; }
    .nav-toggle { display: flex; }
    .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.open span:nth-child(2) { opacity: 0; }
    .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .hero-inner { grid-template-columns: 1fr; text-align: center; padding-top: 3.5rem; }
    .hero-eyebrow { margin-inline: auto; }
    .hero-sub { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .hero-art { order: -1; }
    .hero-art img { width: 200px; }

    .porque-inner, .contato-inner { grid-template-columns: 1fr; gap: 2rem; }

    /* No mobile: título da seção -> formulário -> dados de contato */
    .contato-info { display: contents; }
    .contato-head { order: 1; }
    .contato-form-wrap { order: 2; }
    .info-list { order: 3; }
    .contato-head .contato-lead { margin-bottom: 0; }
}

@media (max-width: 480px) {
    .section { padding: 3.5rem 0; }
    .contato-form-wrap { padding: 1.4rem; }
    .footer-cols { gap: 2rem; }
    .cards-nav { display: none !important; }   /* no celular: arrastar (swipe) */
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
