/* ==========================================================================
   Byte Recursivo — sistema de design
   Paleta derivada do azul da marca (#2849AA): fundo azul-tinta, estrutura
   em hairlines azuis, âmbar reservado exclusivamente a botões de acção.
   Display: Bricolage Grotesque · Corpo: Instrument Sans · Mono: IBM Plex Mono
   ========================================================================== */

:root {
    --bg: #070b1c;
    --surface: #0c1330;
    --surface-2: #131c42;
    --line: rgba(120, 145, 255, 0.14);
    --line-strong: rgba(120, 145, 255, 0.32);
    --brand: #2849aa;
    --bright: #7d97ff;
    --cta: #25d366;
    --cta-ink: #05231a;
    --text: #e9edfb;
    --muted: #9ba5c9;
    --ok: #35c98e;
    --wa-out: #0b5a4a;
    --wa-in: #1b2547;
    --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
    --font-body: "Instrument Sans", "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", Consolas, monospace;
    --radius: 16px;
    --radius-sm: 10px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    background-color: var(--bg);
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

a {
    color: var(--bright);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #a7b8ff;
}

::selection {
    background: var(--brand);
    color: #fff;
}

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

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

strong {
    color: var(--text);
    font-weight: 600;
}

/* Utilitários herdados do markup existente */
.text-white-75 {
    color: var(--muted) !important;
}

.text-warning {
    color: var(--cta) !important;
}

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */

.btn {
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.4rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:focus-visible {
    outline: 2px solid var(--cta);
    outline-offset: 3px;
}

.btn-cta,
.btn-warning {
    background: var(--cta);
    border: 1px solid var(--cta);
    color: var(--cta-ink);
}

.btn-cta:hover,
.btn-cta:focus,
.btn-warning:hover,
.btn-warning:focus {
    background: #4ce381;
    border-color: #4ce381;
    color: var(--cta-ink);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.24);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus {
    border-color: var(--bright);
    color: var(--bright);
    background: rgba(125, 151, 255, 0.06);
}

.btn-lg {
    padding: 0.9rem 1.8rem;
    font-size: 1.0625rem;
}

/* --------------------------------------------------------------------------
   Cabeçalho / navegação
   -------------------------------------------------------------------------- */

.header-area {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.1rem 0;
    transition: padding 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
    border-bottom: 1px solid transparent;
}

.header-area.sticky {
    padding: 0.65rem 0;
    background: rgba(7, 11, 28, 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
}

.navbar-brand img {
    width: 148px;
    height: auto;
}

.navbar-toggler {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.25rem;
    padding: 0.4rem 0.65rem;
    line-height: 1;
    box-shadow: none !important;
}

.navbar-toggler i {
    display: block;
}

.navbar-nav {
    gap: 0.25rem;
}

.navbar-nav li a {
    display: block;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
}

.navbar-nav li a:hover {
    color: var(--bright);
    background: rgba(125, 151, 255, 0.07);
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin-top: 0.9rem;
        padding: 1rem;
    }

    .navbar-nav {
        gap: 0.1rem;
        margin-bottom: 0.75rem;
    }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero-section {
    position: relative;
    padding: 10.5rem 0 5.5rem;
    background-image:
        radial-gradient(ellipse 60% 45% at 70% 0%, rgba(40, 73, 170, 0.35), transparent 70%),
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: auto, 56px 56px, 56px 56px;
    border-bottom: 1px solid var(--line);
}

.hero-section::after {
    /* esbate a grelha à medida que desce, para não competir com o conteúdo */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg) 92%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bright);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.eyebrow::before {
    content: "";
    width: 9px;
    height: 9px;
    border: 2px solid var(--bright);
    border-radius: 50%;
    flex: none;
}

.hero-content h1 {
    font-size: clamp(2.4rem, 5.2vw, 3.9rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.hero-content h1 em {
    font-style: normal;
    color: var(--bright);
}

.hero-lead {
    font-size: 1.15rem;
    max-width: 34rem;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: center;
}

/* --------------------------------------------------------------------------
   Painel de conversa (assinatura do herói)
   -------------------------------------------------------------------------- */

.chat-panel {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(3, 6, 20, 0.6), 0 0 0 6px rgba(40, 73, 170, 0.08);
    max-width: 27rem;
    margin-inline: auto;
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.chat-avatar {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
}

.chat-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.2;
}

.chat-status {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ok);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chat-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
}

.chat-body {
    padding: 1.15rem 1.1rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.msg {
    max-width: 84%;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text);
}

.msg .msg-time {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: rgba(233, 237, 251, 0.5);
    text-align: right;
    margin-top: 0.25rem;
}

.msg-in {
    align-self: flex-start;
    background: var(--wa-in);
    border-bottom-left-radius: 4px;
}

.msg-out {
    align-self: flex-end;
    background: var(--wa-out);
    border-bottom-right-radius: 4px;
}

.chat-log {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--bright);
    border-top: 1px dashed var(--line-strong);
    padding: 0.75rem 1.1rem 0.9rem;
}

.chat-log .ok {
    white-space: nowrap;
}

.chat-log .ok {
    color: var(--ok);
}

/* Revelação escalonada das mensagens (só com JS activo) */
html.js .chat-panel [data-stagger] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

html.js .chat-panel.play [data-stagger] {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   Estrutura de secções
   -------------------------------------------------------------------------- */

.section {
    padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-head {
    max-width: 44rem;
    margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.section-head h1,
.section-head h2 {
    font-size: clamp(1.85rem, 3.6vw, 2.7rem);
    margin-bottom: 0;
}

.section-head h1 span,
.section-head h2 span {
    color: var(--bright);
}

.section-first {
    padding-top: clamp(8rem, 14vw, 10rem);
}

.ico-bright {
    color: var(--bright);
}

.section-head .lead-text {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 1.0625rem;
}

/* Compatibilidade com páginas legais (markup antigo) */
.divider {
    height: clamp(3rem, 6vw, 5rem);
}

/* primeiro espaçador logo a seguir ao cabeçalho fixo precisa de mais altura */
.header-area + .divider {
    height: clamp(8rem, 14vw, 10rem);
}

.divider2 {
    height: clamp(1.5rem, 3vw, 2.5rem);
}

.section-title .text-focused {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bright);
    margin-bottom: 0.85rem;
}

.section-title h1,
.section-title h2 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.section-title h1 span,
.section-title h2 span {
    color: var(--bright);
}

/* --------------------------------------------------------------------------
   Faixa de tecnologias
   -------------------------------------------------------------------------- */

.tech-strip {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1.1rem 0;
}

.tech-strip ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 2.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--muted);
}

.tech-strip .strip-label {
    color: var(--bright);
}

/* --------------------------------------------------------------------------
   Cartões (tiles)
   -------------------------------------------------------------------------- */

.tile {
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tile:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 18px 44px rgba(3, 6, 20, 0.5);
}

.tile-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(40, 73, 170, 0.28);
    border: 1px solid var(--line-strong);
    color: var(--bright);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    margin-bottom: 1.15rem;
}

.tile-icon i {
    line-height: 1;
    transform: translateY(2px);
}

.tile h3,
.tile h4 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}

.tile p {
    margin-bottom: 0;
    font-size: 0.9875rem;
}

/* Sectores */
.tile .checks {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9875rem;
}

.tile .checks li {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
}

.tile .checks li::before {
    content: "→";
    font-family: var(--font-mono);
    color: var(--bright);
    flex: none;
}

/* --------------------------------------------------------------------------
   Esquemático MCP
   -------------------------------------------------------------------------- */

.mcp-flow {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.mcp-node {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    text-align: center;
    position: relative;
}

.mcp-node .node-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bright);
    display: block;
    margin-bottom: 0.9rem;
}

.mcp-node.core {
    border-color: var(--brand);
    box-shadow: 0 0 0 5px rgba(40, 73, 170, 0.14), 0 16px 42px rgba(3, 6, 20, 0.5);
}

.mcp-node .tile-icon {
    margin-inline: auto;
}

.mcp-link {
    flex: 0 0 clamp(2rem, 6vw, 4.5rem);
    position: relative;
    align-self: center;
    height: 2px;
    background-image: linear-gradient(90deg, var(--bright) 45%, transparent 45%);
    background-size: 12px 2px;
    animation: dash-flow 1.2s linear infinite;
}

@keyframes dash-flow {
    to {
        background-position: 12px 0;
    }
}

@media (max-width: 767.98px) {
    .mcp-flow {
        flex-direction: column;
    }

    .mcp-link {
        flex-basis: 3rem;
        width: 2px;
        height: 3rem;
        align-self: center;
        background-image: linear-gradient(180deg, var(--bright) 45%, transparent 45%);
        background-size: 2px 12px;
        animation-name: dash-flow-v;
    }

    @keyframes dash-flow-v {
        to {
            background-position: 0 12px;
        }
    }
}

/* --------------------------------------------------------------------------
   Como funciona — timeline numerada
   -------------------------------------------------------------------------- */

.steps {
    position: relative;
    counter-reset: passo;
}

.step {
    position: relative;
    padding: 2rem 0 0;
}

.step::before {
    /* linha condutora por cima de cada passo */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line-strong);
}

.step-num {
    counter-increment: passo;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--bg);
    background: var(--bright);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 600;
    position: absolute;
    top: -20px;
    left: 0;
}

.step-num::after {
    content: "0" counter(passo);
}

.step h3 {
    font-size: 1.25rem;
    margin: 1.4rem 0 0.6rem;
}

.step .step-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--bright);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.step p {
    margin-bottom: 0;
    font-size: 0.9875rem;
}

/* --------------------------------------------------------------------------
   Diferenciais — linhas compactas
   -------------------------------------------------------------------------- */

.feature-item {
    border-top: 1px solid var(--line);
    padding: 1.5rem 0.25rem 1.25rem;
    height: 100%;
}

.feature-item .d-flex i {
    color: var(--bright);
    font-size: 1.3rem;
    flex: none;
    transform: translateY(2px);
}

.feature-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.feature-item p {
    margin: 0.65rem 0 0;
    font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Prova social
   -------------------------------------------------------------------------- */

.quote-card {
    display: flex;
    flex-direction: column;
}

.quote-card .quote-mark {
    font-family: var(--font-display);
    font-size: 2.6rem;
    line-height: 1;
    color: var(--brand);
    margin-bottom: 0.75rem;
}

.quote-card blockquote {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.quote-card .quote-author {
    margin-top: auto;
}

.quote-card .quote-author strong {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9875rem;
}

.quote-card .quote-author span {
    font-size: 0.875rem;
}

.badge-exemplo {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bright);
    border: 1px solid rgba(125, 151, 255, 0.4);
    border-radius: 99px;
    padding: 0.15rem 0.6rem;
    display: inline-block;
    margin-bottom: 0.9rem;
    align-self: flex-start;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq-wrapper .accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-border-width: 0;
}

.faq-wrapper .accordion-item {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
}

.faq-wrapper .accordion-item:last-child {
    border-bottom: 1px solid var(--line);
}

.faq-wrapper .accordion-button {
    background: transparent;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1.35rem 0.25rem;
    box-shadow: none;
}

.faq-wrapper .accordion-button::after {
    filter: invert(70%) sepia(30%) saturate(900%) hue-rotate(200deg);
}

.faq-wrapper .accordion-button:not(.collapsed) {
    color: var(--bright);
}

.faq-wrapper .accordion-button:focus-visible {
    outline: 2px solid var(--cta);
    outline-offset: -2px;
}

.faq-wrapper .accordion-body {
    padding: 0 0.25rem 1.5rem;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Faixa final de CTA
   -------------------------------------------------------------------------- */

.cta-band {
    background:
        radial-gradient(ellipse 70% 90% at 50% 120%, rgba(125, 151, 255, 0.28), transparent 65%),
        linear-gradient(160deg, #223d8e, var(--brand) 55%, #1c3378);
    border: 1px solid var(--line-strong);
    border-radius: 26px;
    padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
    text-align: center;
}

.cta-band h2 {
    font-size: clamp(1.8rem, 3.8vw, 2.7rem);
    color: #fff;
    margin-bottom: 0.9rem;
}

.cta-band p {
    color: rgba(233, 237, 251, 0.85);
    max-width: 36rem;
    margin: 0 auto 1.8rem;
}

.cta-band .eyebrow {
    color: #c3d0ff;
}

.cta-band .eyebrow::before {
    border-color: #c3d0ff;
}

/* --------------------------------------------------------------------------
   Formulários
   -------------------------------------------------------------------------- */

.form-label {
    color: var(--text);
    font-weight: 500;
    font-size: 0.9375rem;
}

.form-control {
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.7rem 0.9rem;
}

.form-control::placeholder {
    color: rgba(155, 165, 201, 0.55);
}

.form-control:focus {
    background: var(--surface-2);
    border-color: var(--bright);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(125, 151, 255, 0.2);
}

.form-control.is-invalid {
    border-color: #e05d6f;
}

.invalid-feedback {
    color: #f2909d;
}

.alert-success {
    background: rgba(53, 201, 142, 0.12);
    border: 1px solid rgba(53, 201, 142, 0.45);
    color: #7fe3bc;
    border-radius: var(--radius-sm);
}

.alert-danger {
    background: rgba(224, 93, 111, 0.12);
    border: 1px solid rgba(224, 93, 111, 0.45);
    color: #f2909d;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Rodapé
   -------------------------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--line);
    padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
    background: linear-gradient(180deg, var(--bg), #060918);
}

.footer-logo img {
    width: 150px;
}

.footer h5 {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bright);
}

.footer ul li {
    margin-bottom: 0.55rem;
}

.footer ul a {
    color: var(--muted);
    font-size: 0.9375rem;
}

.footer ul a:hover {
    color: var(--bright);
}

.footer .footer-bottom {
    border-top: 1px solid var(--line);
    margin-top: 3rem;
    padding-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    align-items: center;
}

.footer .footer-nif {
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Voltar ao topo
   -------------------------------------------------------------------------- */

#scrollToTop {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--bright);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

#scrollToTop.scrolltop-show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

#scrollToTop:hover {
    border-color: var(--bright);
}

/* --------------------------------------------------------------------------
   Revelação no scroll (progressive enhancement)
   -------------------------------------------------------------------------- */

html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .reveal.visible {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   Movimento reduzido
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html.js .reveal,
    html.js .chat-panel [data-stagger] {
        opacity: 1;
        transform: none;
    }
}
