/*
 * RS Funnels — Design System
 * v1.0 · Futurista dark-first · indigo #6366f1 + cyan #06b6d4
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
/* ============================================================
   VARIÁVEIS — TEMA CLARO E ESCURO
   ============================================================ */
:root {
    /* Fontes */
    --font-sans:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:     'Sora', 'Inter', sans-serif;
    --font-mono:        'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Radii */
    --radius-sm:        6px;
    --radius:           10px;
    --radius-lg:        14px;
    --radius-xl:        20px;
    --radius-full:      999px;
}

/* ============================================================
   TEMA ESCURO (padrão)
   ============================================================ */
:root, html[data-tema="dark"] {
    /* Superfícies */
    --bg-base:          #0a0a0f;
    --bg-elevated:      #12121b;
    --bg-elevated-2:    #1a1a26;
    --bg-glass:         rgba(255, 255, 255, 0.03);
    --bg-glass-hover:   rgba(255, 255, 255, 0.05);

    /* Bordas */
    --border:           rgba(255, 255, 255, 0.08);
    --border-hover:     rgba(255, 255, 255, 0.15);
    --border-strong:    rgba(255, 255, 255, 0.25);

    /* Texto */
    --text:             #ffffff;
    --text-2:           rgba(255, 255, 255, 0.7);
    --text-3:           rgba(255, 255, 255, 0.4);
    --text-4:           rgba(255, 255, 255, 0.25);

    /* Marca */
    --indigo:           #6366f1;
    --indigo-2:         #7c7ff5;
    --indigo-soft:      rgba(99, 102, 241, 0.15);
    --cyan:             #06b6d4;
    --cyan-2:           #22c9e5;
    --cyan-soft:        rgba(6, 182, 212, 0.15);

    /* Estado */
    --success:          #10b981;
    --success-soft:     rgba(16, 185, 129, 0.15);
    --warning:          #f59e0b;
    --warning-soft:     rgba(245, 158, 11, 0.15);
    --danger:           #ef4444;
    --danger-soft:      rgba(239, 68, 68, 0.15);
    --info:             #3b82f6;
    --info-soft:        rgba(59, 130, 246, 0.15);

    /* Gradientes */
    --gradient:         linear-gradient(135deg, var(--indigo) 0%, var(--cyan) 100%);
    --gradient-subtle:  linear-gradient(135deg, rgba(99,102,241,.08) 0%, rgba(6,182,212,.08) 100%);
    --gradient-text:    linear-gradient(135deg, #a5a7ff 0%, #67e8f9 100%);

    /* Sombras */
    --shadow-sm:        0 1px 2px rgba(0,0,0,.3);
    --shadow:           0 4px 12px rgba(0,0,0,.4);
    --shadow-lg:        0 12px 32px rgba(0,0,0,.5);
    --shadow-glow:      0 0 40px rgba(99,102,241,.35);
    --shadow-glow-cyan: 0 0 40px rgba(6,182,212,.35);

    /* Ambiente (radials + grid do body) */
    --amb-radial-1:     rgba(99,102,241,.12);
    --amb-radial-2:     rgba(6,182,212,.10);
    --amb-grid:         rgba(255,255,255,.015);
    --amb-scrollbar:    rgba(255,255,255,.15);

    /* Superfícies fixas (sidebar, topbar) — glassmorphism sobre background */
    --surface-sticky:   rgba(10,10,15,.8);
    --surface-sticky-2: rgba(10,10,15,.6);

    color-scheme: dark;
}

/* ============================================================
   TEMA CLARO
   ============================================================ */
html[data-tema="light"] {
    /* Superfícies */
    --bg-base:          #f6f7f9;
    --bg-elevated:      #ffffff;
    --bg-elevated-2:    #fafbfc;
    --bg-glass:         rgba(255, 255, 255, 0.7);
    --bg-glass-hover:   rgba(255, 255, 255, 0.95);

    /* Bordas */
    --border:           rgba(15, 23, 42, 0.08);
    --border-hover:     rgba(15, 23, 42, 0.16);
    --border-strong:    rgba(15, 23, 42, 0.28);

    /* Texto */
    --text:             #0a0a0f;
    --text-2:           #4b5563;
    --text-3:           #9ca3af;
    --text-4:           #d1d5db;

    /* Marca (versões um pouco mais saturadas pra contraste em fundo claro) */
    --indigo:           #4f52e0;
    --indigo-2:         #3f42c9;
    --indigo-soft:      rgba(99, 102, 241, 0.10);
    --cyan:             #0891b2;
    --cyan-2:           #067d99;
    --cyan-soft:        rgba(6, 182, 212, 0.10);

    /* Estado */
    --success:          #059669;
    --success-soft:     rgba(16, 185, 129, 0.10);
    --warning:          #d97706;
    --warning-soft:     rgba(245, 158, 11, 0.12);
    --danger:           #dc2626;
    --danger-soft:      rgba(239, 68, 68, 0.10);
    --info:             #2563eb;
    --info-soft:        rgba(59, 130, 246, 0.10);

    /* Gradientes */
    --gradient:         linear-gradient(135deg, var(--indigo) 0%, var(--cyan) 100%);
    --gradient-subtle:  linear-gradient(135deg, rgba(99,102,241,.05) 0%, rgba(6,182,212,.05) 100%);
    --gradient-text:    linear-gradient(135deg, #4f52e0 0%, #0891b2 100%);

    /* Sombras */
    --shadow-sm:        0 1px 2px rgba(15,23,42,.06);
    --shadow:           0 4px 12px rgba(15,23,42,.08);
    --shadow-lg:        0 12px 32px rgba(15,23,42,.12);
    --shadow-glow:      0 0 40px rgba(99,102,241,.18);
    --shadow-glow-cyan: 0 0 40px rgba(6,182,212,.18);

    /* Ambiente */
    --amb-radial-1:     rgba(99,102,241,.10);
    --amb-radial-2:     rgba(6,182,212,.08);
    --amb-grid:         rgba(15,23,42,.025);
    --amb-scrollbar:    rgba(15,23,42,.15);

    /* Superfícies fixas — branco translúcido pra manter glassmorphism */
    --surface-sticky:   rgba(255,255,255,.85);
    --surface-sticky-2: rgba(255,255,255,.75);

    color-scheme: light;
}

    /* Layout */
    --sidebar-w:        260px;
    --header-h:         64px;

    /* Transições */
    --tr-fast:          120ms cubic-bezier(.4,0,.2,1);
    --tr:               200ms cubic-bezier(.4,0,.2,1);
    --tr-slow:          400ms cubic-bezier(.4,0,.2,1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-base);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Ambiente futurista: radial highlights + grid sutil */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 0%, var(--amb-radial-1), transparent 45%),
        radial-gradient(circle at 85% 100%, var(--amb-radial-2), transparent 45%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--amb-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--amb-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

img, svg, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

a { color: var(--cyan); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--cyan-2); }

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

.text-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }

.title-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* ============================================================
   LAYOUT PAINEL
   ============================================================ */
.layout {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface-sticky);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 24px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gradient);
    display: grid;
    place-items: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-glow);
    letter-spacing: 0;
}

.nav-section {
    padding: 14px 12px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text-2);
    font-weight: 500;
    transition: all var(--tr);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}
.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text);
}
.nav-item.ativo {
    background: var(--indigo-soft);
    color: var(--text);
    border-color: rgba(99,102,241,.3);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--surface-sticky-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 15;
    gap: 16px;
}

.topbar-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-title h1 { font-size: 20px; }
.topbar-title p { font-size: 12px; color: var(--text-3); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.content { padding: 32px; flex: 1; }

/* Uso do plano */
.plano-uso {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: var(--font-mono);
}
.plano-uso-bar {
    width: 80px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.plano-uso-fill {
    height: 100%;
    background: var(--gradient);
    transition: width var(--tr);
}

/* ============================================================
   USER MENU
   ============================================================ */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--tr);
    color: var(--text);
}
.user-menu-btn:hover { border-color: var(--border-hover); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    font-family: var(--font-display);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 30;
}
.user-menu.aberto .user-menu-dropdown { display: block; }

.user-menu-info {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.user-menu-info-nome { font-weight: 600; font-size: 14px; }
.user-menu-info-email { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--tr);
    font-size: 13px;
    text-decoration: none;
}
.user-menu-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--tr);
}
.card:hover { border-color: var(--border-hover); }

.card-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.card-titulo h2, .card-titulo h3 { margin: 0; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--tr);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    font-family: var(--font-sans);
}
.btn:hover:not(:disabled) {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    color: var(--text);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--gradient);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(99,102,241,.25);
}
.btn-primary:hover:not(:disabled) {
    background: var(--gradient);
    filter: brightness(1.1);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(99,102,241,.4);
}

.btn-danger { background: var(--danger); border-color: transparent; color: white; }
.btn-danger:hover:not(:disabled) { background: #dc2626; color: white; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-glass); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============================================================
   FORM
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input, .textarea, .select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: all var(--tr);
    outline: none;
}
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--cyan);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--cyan-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:disabled, .input[readonly] { opacity: .6; cursor: not-allowed; }

.textarea { resize: vertical; min-height: 100px; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}
html[data-tema="light"] .select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(15,23,42,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.form-help { font-size: 12px; color: var(--text-3); }
.form-error { font-size: 12px; color: var(--danger); }

.input-group { display: flex; gap: 0; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group > *:first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.input-group > *:last-child { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: nowrap;
}

.field-password { position: relative; }
.field-password .input { padding-right: 40px; }
.field-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    display: grid;
    place-items: center;
}
.field-password-toggle:hover { color: var(--text-2); }

/* ============================================================
   TABELA
   ============================================================ */
.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-3);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}
.tabela td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
}
.tabela tr:hover td { background: var(--bg-glass); color: var(--text); }
.tabela tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGE
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-2);
}
.badge-success { background: var(--success-soft); border-color: rgba(16,185,129,.3); color: var(--success); }
.badge-warning { background: var(--warning-soft); border-color: rgba(245,158,11,.3); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  border-color: rgba(239,68,68,.3);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    border-color: rgba(59,130,246,.3); color: var(--info); }
.badge-indigo  { background: var(--indigo-soft);  border-color: rgba(99,102,241,.3); color: var(--indigo-2); }
.badge-cyan    { background: var(--cyan-soft);    border-color: rgba(6,182,212,.3);  color: var(--cyan-2); }

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ============================================================
   FLASH
   ============================================================ */
.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    max-width: 400px;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    animation: slideIn var(--tr) ease-out;
    font-size: 13px;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.flash-success { border-left: 3px solid var(--success); }
.flash-error, .flash-danger { border-left: 3px solid var(--danger); }
.flash-warning { border-left: 3px solid var(--warning); }
.flash-info    { border-left: 3px solid var(--info); }

/* Flash inline (dentro do form) */
.public-form .flash {
    box-shadow: none;
    animation: none;
}

.flash-x {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}
.flash-x:hover { color: var(--text); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}
.modal-overlay.aberto { display: flex; }

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn var(--tr) ease-out;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================================
   PÁGINAS PÚBLICAS (login, ativar, recuperar, setup)
   ============================================================ */
.public-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.public-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 60px;
}

.public-form-inner { width: 100%; max-width: 380px; }

.public-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 40px;
    justify-content: center;
}
.public-brand .brand-mark { width: 40px; height: 40px; font-size: 14px; }

.public-title { font-size: 26px; margin-bottom: 8px; text-align: center; }
.public-subtitle { color: var(--text-3); text-align: center; margin-bottom: 32px; font-size: 14px; }

.public-hero {
    background:
        radial-gradient(circle at 30% 20%, rgba(99,102,241,.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6,182,212,.4) 0%, transparent 50%),
        linear-gradient(135deg, #0f0f1a 0%, #0a0a14 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}
.public-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--amb-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--amb-grid) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.public-hero-content { position: relative; z-index: 1; max-width: 500px; }
.public-hero h2 {
    font-family: var(--font-display);
    font-size: 40px;
    line-height: 1.15;
    margin-bottom: 16px;
    font-weight: 700;
}
.public-hero h2 .highlight {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.public-hero p { font-size: 15px; color: var(--text-2); line-height: 1.6; }

.public-link { text-align: center; margin-top: 24px; color: var(--text-3); font-size: 13px; }
.public-link a { font-weight: 600; }

@media (max-width: 900px) {
    .public-layout { grid-template-columns: 1fr; }
    .public-hero { display: none; }
    .public-form { padding: 40px 24px; }
}

/* ============================================================
   ESTADO VAZIO
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--text-3);
}
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--text-3); margin-bottom: 24px; }

/* ============================================================
   UTILS
   ============================================================ */
.d-flex { display: flex; }
.d-grid { display: grid; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.w-full { width: 100%; }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--amb-scrollbar);
    border-radius: 5px;
    border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ============================================================
   RESPONSIVO MOBILE
   ============================================================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 35;
}
.sidebar-backdrop.ativo { display: block; }

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left var(--tr);
        z-index: 40;
    }
    .sidebar.aberto { left: 0; }
    .topbar { padding: 0 16px; gap: 8px; }
    .content { padding: 20px 16px; }
    .sidebar-toggle { display: grid; place-items: center; }
    .plano-uso { display: none; }
    .topbar-title h1 { font-size: 16px; }
    .user-menu-btn span { display: none; }
}

/* ============================================================
   TROCA DE TEMA — transição suave + botão
   ============================================================ */
html.tema-transicao *, html.tema-transicao *::before, html.tema-transicao *::after {
    transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease, box-shadow 220ms ease !important;
}

.btn-tema-toggle {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text) !important;
    padding: 0;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: all var(--tr);
    position: relative;
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0;
    line-height: 1;
}
.btn-tema-toggle:hover {
    background: var(--bg-glass-hover);
    color: var(--text) !important;
    border-color: var(--border-hover);
    transform: scale(1.05);
}
.btn-tema-toggle svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 300ms ease;
    display: block;
}
.btn-tema-toggle:hover svg { transform: rotate(20deg); }
.btn-tema-toggle .icone-sol  { display: none !important; }
.btn-tema-toggle .icone-lua  { display: block !important; }
html[data-tema="light"] .btn-tema-toggle .icone-sol { display: block !important; }
html[data-tema="light"] .btn-tema-toggle .icone-lua { display: none !important; }

/* ============================================================
   Barra de navegação de funil (aparece nas 5 telas do funil)
   ============================================================ */
.funil-nav {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 3px;
    flex-shrink: 0;
}
.funil-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-full);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--tr);
    white-space: nowrap;
}
.funil-nav-item:hover { color: var(--text-2); background: var(--bg-glass-hover); }
.funil-nav-item.ativo {
    background: var(--text);
    color: var(--bg-base);
}
.funil-nav-item svg { width: 14px; height: 14px; }

/* Nome do funil compacto na topbar (quando em contexto de funil) */
.topbar-funil-nome {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
    padding: 6px 10px;
    border-radius: var(--radius);
}

/* ============================================================
   TOPBAR EM CONTEXTO DE FUNIL (visual igual ao editor)
   ============================================================ */
.topbar.topbar-funil {
    height: 56px;
    padding: 0 20px;
    gap: 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.topbar.topbar-funil .topbar-esquerda {
    gap: 12px;
    flex-shrink: 0;
}
.topbar.topbar-funil .sidebar-toggle { display: none; }
.topbar.topbar-funil .topbar-voltar {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.topbar.topbar-funil .topbar-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 0 1 auto;
}
.topbar.topbar-funil .topbar-title h1,
.topbar.topbar-funil .topbar-title p { display: none; }
.topbar.topbar-funil .topbar-actions { gap: 10px; }

/* Em telas apertadas: esconde o texto, mostra só os ícones */
@media (max-width: 900px) {
    .funil-nav-item span { display: none; }
    .funil-nav-item { padding: 6px 10px; }
}
/* Em mobile muito pequeno: esconde toda a nav (fica só o menu ≡) */
@media (max-width: 600px) {
    .funil-nav { display: none; }
}
