:root {
    --turquesa: #00BDAE;
    --turquesa-escuro: #00978c;
    --fundo: #0A2024;
    --fundo-2: #0e2b30;
    --card: #102e34;
    --card-borda: #1c4248;
    --texto: #e6f4f3;
    --texto-suave: #9bb6b6;
    --erro: #ff6b6b;
    --sucesso: #36d399;
    --aviso: #fbbd23;
    --raio: 14px;
    --sombra: 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--fundo);
    color: var(--texto);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--turquesa); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--texto); margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

.loading {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; color: var(--turquesa); font-size: 1.2rem;
}

/* ---- Shell ---- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: var(--fundo-2);
    border-bottom: 1px solid var(--card-borda);
    position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
    max-width: 1100px; margin: 0 auto; padding: .75rem 1rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--texto); font-size: 1.25rem; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand strong { color: var(--turquesa); }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--turquesa); color: var(--fundo);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.2rem;
}

.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: var(--texto-suave); font-weight: 600; }
.nav-links a:hover, .nav-links a.active { color: var(--turquesa); text-decoration: none; }

.shell { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.site-footer { border-top: 1px solid var(--card-borda); background: var(--fundo-2); }
.site-footer-inner {
    max-width: 1100px; margin: 0 auto; padding: 1rem; color: var(--texto-suave); font-size: .85rem;
    display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
}
.site-footer-links { display: flex; gap: 1.25rem; }
.site-footer-links a { color: var(--texto-suave); }
.site-footer-links a:hover { color: var(--turquesa); }

/* ---- Gate de re-aceite de Termos (overlay bloqueante) ---- */
.gate-overlay {
    position: fixed; inset: 0; z-index: 80;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(5, 18, 20, .75); backdrop-filter: blur(3px);
}
.gate-card { max-width: 440px; width: 100%; margin: 0; }
.gate-card h2 { margin: 0 0 .75rem; color: var(--turquesa); }
.gate-card p { margin: 0 0 .75rem; }
.gate-card .btn-row { margin-top: 1rem; }

/* ---- Cards ---- */
.card {
    background: var(--card);
    border: 1px solid var(--card-borda);
    border-radius: var(--raio);
    padding: 1.25rem;
    box-shadow: var(--sombra);
}
.card.narrow { max-width: 460px; margin: 2rem auto; }
.auth-blocked { text-align: center; }

.grid { display: grid; gap: 1rem; }
.grid-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.stat { display: flex; flex-direction: column; gap: .25rem; }
.stat-label { color: var(--texto-suave); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--turquesa); }

.section { margin-top: 1.75rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }

/* ---- Tabela ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--card-borda); }
th { color: var(--texto-suave); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
td { font-size: .92rem; }
tbody tr:hover { background: rgba(0, 189, 174, .06); }

/* ---- Badges ---- */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-ok { background: rgba(54, 211, 153, .15); color: var(--sucesso); }
.badge-warn { background: rgba(251, 189, 35, .15); color: var(--aviso); }
.badge-err { background: rgba(255, 107, 107, .15); color: var(--erro); }
.badge-neutral { background: rgba(155, 182, 182, .15); color: var(--texto-suave); }

/* ---- Formulário ---- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .85rem; color: var(--texto-suave); font-weight: 600; }
.input {
    width: 100%; padding: .65rem .8rem;
    background: var(--fundo-2); color: var(--texto);
    border: 1px solid var(--card-borda); border-radius: 10px;
    font-size: 1rem;
}
.input:focus { outline: none; border-color: var(--turquesa); box-shadow: 0 0 0 3px rgba(0, 189, 174, .2); }

/* ---- Botões ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
    font-size: .95rem; font-weight: 700; cursor: pointer;
    transition: filter .12s ease, background .12s ease;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.primary { background: var(--turquesa); color: var(--fundo); }
.btn.primary:hover:not(:disabled) { background: var(--turquesa-escuro); }
.btn.outline { background: transparent; border-color: var(--turquesa); color: var(--turquesa); }
.btn.outline:hover:not(:disabled) { background: rgba(0, 189, 174, .1); }
.btn.ghost { background: transparent; color: var(--texto-suave); }
.btn.ghost:hover:not(:disabled) { color: var(--texto); }
.btn.full { width: 100%; }
.btn.xl { padding: .85rem 1.2rem; font-size: 1.05rem; }
.nav-logout { padding: .4rem .8rem; }
.nav-suporte { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem;
    border: 1px solid #25d36655; border-radius: 8px; color: #25d366 !important; font-weight: 600; }
.nav-suporte:hover { background: #25d3661a; text-decoration: none; }
.nav-suporte-ico { font-size: .95em; }

.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---- Alertas ---- */
.alert { padding: .75rem 1rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; }
.alert.error { background: rgba(255, 107, 107, .12); color: var(--erro); border: 1px solid rgba(255, 107, 107, .3); }
.alert.info { background: rgba(0, 189, 174, .1); color: var(--turquesa); border: 1px solid rgba(0, 189, 174, .3); }
.alert.success { background: rgba(54, 211, 153, .12); color: var(--sucesso); border: 1px solid rgba(54, 211, 153, .3); }

.validation-errors { color: var(--erro); list-style: none; padding: 0; margin: 0 0 .5rem; font-size: .85rem; }

.muted { color: var(--texto-suave); }
.text-right { text-align: right; }

/* ---- Login ---- */
.auth-layout {
    min-height: calc(100vh - 130px);
    display: flex; align-items: center; justify-content: center;
}
.auth-panel { width: 100%; max-width: 420px; }
.auth-panel-head { text-align: center; margin-bottom: 1.25rem; }
.auth-panel-head p { color: var(--texto-suave); margin: 0; }
.auth-logo {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 16px;
    background: var(--turquesa); color: var(--fundo);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800;
}

/* ---- PIX / QR ---- */
.pix-box { margin-top: 1rem; }
.pix-qr { display: block; margin: 0 auto 1rem; max-width: 240px; width: 100%; border-radius: 12px; background: #fff; padding: 8px; }
.pix-code {
    width: 100%; padding: .7rem; font-family: monospace; font-size: .8rem;
    background: var(--fundo-2); color: var(--texto);
    border: 1px solid var(--card-borda); border-radius: 10px; resize: vertical;
    word-break: break-all;
}

/* ---- Toasts ---- */
.toast-stack {
    position: fixed; bottom: 1rem; right: 1rem; z-index: 50;
    display: flex; flex-direction: column; gap: .5rem; max-width: 360px;
}
.toast {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1rem; border-radius: 10px;
    box-shadow: var(--sombra); font-size: .9rem;
    background: var(--card); border: 1px solid var(--card-borda); color: var(--texto);
}
.toast-sucesso { border-color: var(--sucesso); }
.toast-erro { border-color: var(--erro); }
.toast-aviso { border-color: var(--aviso); }
.toast-info { border-color: var(--turquesa); }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; color: var(--texto-suave); font-size: 1.1rem; cursor: pointer; }

/* ---- Layout público (landing / planos / baixar) ---- */
.nav-cta { padding: .45rem .9rem; }

/* Tabela de preços (página pública /planos) */
.tabela-planos { width: 100%; border-collapse: collapse; margin: .75rem 0 .25rem; font-size: .95rem; }
.tabela-planos th, .tabela-planos td { text-align: right; padding: .5rem .4rem; border-bottom: 1px solid var(--borda, #ffffff14); }
.tabela-planos th:first-child, .tabela-planos td:first-child { text-align: left; }
.tabela-planos thead th { color: var(--texto-suave); font-weight: 600; font-size: .82rem; }
.tabela-planos tbody td { color: var(--texto, #e8eef0); font-weight: 700; }
.tabela-planos tbody td:first-child { font-weight: 600; color: var(--texto-suave); }
.cel-sub { color: var(--texto-suave); font-weight: 400; font-size: .72rem; margin-left: .15rem; }

.hero {
    display: grid; gap: 2rem; align-items: center;
    grid-template-columns: 1.1fr .9fr;
    padding: 1.5rem 0 1rem;
}
.hero-title { font-size: 2.2rem; line-height: 1.15; margin: .75rem 0 1rem; }
.hero-title-light { display: block; font-weight: 400; color: var(--texto-suave); font-size: .9em; margin-top: .3rem; }

/* Paginas de documentos (Termos / Privacidade) */
.shell-doc { max-width: 780px; }
.shell-doc h1 { margin-bottom: .25rem; }
.shell-doc h2 { margin: 1.4rem 0 .5rem; font-size: 1.15rem; }
.shell-doc p, .shell-doc li { color: var(--texto); line-height: 1.6; }
.doc-list { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .4rem; margin: .25rem 0; }
.alert.warn { background: rgba(250,199,117,.12); border: 1px solid #FAC775; color: #FAC775; padding: .75rem 1rem; border-radius: 10px; }
.hero-sub { color: var(--texto-suave); font-size: 1.1rem; max-width: 560px; margin: 0 0 1.5rem; }
.hero-card h2 { margin-bottom: 1rem; }

.bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.bullets li { position: relative; padding-left: 1.5rem; color: var(--texto); }
.bullets li::before {
    content: "✓"; position: absolute; left: 0; top: 0;
    color: var(--turquesa); font-weight: 800;
}
.bullets code {
    background: var(--fundo-2); border: 1px solid var(--card-borda);
    border-radius: 6px; padding: .05rem .35rem; font-size: .85rem;
}

.plano { display: flex; flex-direction: column; gap: .25rem; }
.plano-destaque { border-color: var(--turquesa); box-shadow: 0 8px 24px rgba(0, 189, 174, .18); }
.plano-preco { font-size: 2.2rem; font-weight: 800; color: var(--turquesa); margin: .25rem 0 1rem; }
.plano-periodo { font-size: 1rem; font-weight: 600; color: var(--texto-suave); }
.plano .btn { margin-top: 1rem; }

@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; }
    .hero-title { font-size: 1.8rem; }
}

/* ---- Responsivo: celular ---- */
@media (max-width: 640px) {
    html, body { font-size: 15px; }

    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
        padding: .6rem .8rem;
    }

    /* Topbar/nav empilha e quebra bem em telas estreitas */
    .nav-desktop { width: 100%; }
    .nav-links { width: 100%; gap: .6rem .9rem; }

    .shell { padding: 1rem .8rem 2.5rem; }

    .card { padding: 1rem; }

    /* Stats um pouco menores para caber na largura do celular */
    .stat-value { font-size: 1.45rem; }

    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.15rem; }

    .btn { padding: .55rem .9rem; }

    th, td { padding: .5rem .55rem; }
}

/* ---- Erro Blazor ---- */
#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--erro); color: #fff; padding: .75rem 1rem; z-index: 100;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
