@import url('https://fonts.googleapis.com/css2?family=Voltaire&family=Inter:wght@300;400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 12px;
    --accent: #2e2d65;
    --accent-hover: #3d3c85;
    --accent-bright: hsl(241, 72%, 62%);
    --accent-bright-hover: hsl(241, 72%, 68%);
    --accent-dim: rgba(46, 45, 101, 0.20);
    --text-primary: #f0f0f5;
    --text-secondary: #9090a0;
    --text-muted: #5a5a6a;
    --bot-bubble: rgba(255, 255, 255, 0.07);
    --bot-bubble-border: rgba(255, 255, 255, 0.12);
    --user-bubble: rgba(255, 255, 255, 0.06);
    --user-bubble-border: rgba(255, 255, 255, 0.10);
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
    --radius: 12px;
    --radius-sm: 8px;
    --font-brand: 'Voltaire', sans-serif;
    --font-body: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --header-height: 60px;
}

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

html { font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    /* Fundo único persistente — não muda na transição ty-page → chat */
    background:
        linear-gradient(135deg,
            hsl(225, 22%, 7%) 0%,
            hsl(240, 18%, 9%) 50%,
            hsl(241, 22%, 8%) 100%);
}

/* Spotlight fixo no body — persiste em ambas as seções */
body::before {
    content: '';
    position: fixed; inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 100% 60% at 50% -5%,
        rgba(46,45,101,0.30) 0%,
        rgba(46,45,101,0.08) 50%,
        transparent 72%);
    pointer-events: none;
}

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

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Glass ──────────────────────────────────────── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* ─── Botões ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}
.btn-ghost:hover { background: var(--glass-bg); color: var(--text-primary); }

.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.25); }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-icon { padding: 7px; min-width: 32px; justify-content: center; }

/* ─── Inputs ─────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }

input, textarea, select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 14px;
    transition: border-color 0.2s;
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    background: rgba(46,45,101,0.06);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select option { background: var(--bg-secondary); }
textarea { resize: vertical; min-height: 80px; }

/* ─── Logo ───────────────────────────────────────── */
.logo {
    font-family: var(--font-brand);
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0;
}
.logo span { color: var(--accent-bright); }

/* Logo da página de obrigado: sem separação de cor, só Voltaire maiúsculo */
.ty-logo {
    font-family: var(--font-brand);
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    text-transform: uppercase;
}

/* ─── Badge ──────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-active { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-inactive { background: rgba(248,113,113,0.12); color: var(--danger); }

/* ─── Toast ──────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    animation: slideIn 0.25s ease;
    max-width: 320px;
}
.toast.success { border-color: rgba(74,222,128,0.3); color: var(--success); }
.toast.error { border-color: rgba(248,113,113,0.3); color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ─── Modal ──────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.1rem; font-weight: 600; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* ─── Admin Layout ───────────────────────────────── */
.admin-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar .logo { margin-bottom: 24px; padding: 0 8px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--accent-dim);
    color: var(--text-primary);
}
.sidebar-footer { margin-top: auto; }
.main-content { padding: 32px; }
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.page-header h1 { font-size: 1.4rem; font-weight: 600; }

/* ─── Cards ──────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}
.card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 97, 200, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 97, 200, 0.15);
}
.card-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--accent-bright), hsl(270, 65%, 60%));
    border-radius: 0;
}
.card-accent.inactive {
    background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
}
.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}
.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
}
.card-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    padding: 3px 10px;
    width: fit-content;
}
.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 8px;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.stat:last-child { border-right: none; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--accent-bright); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.15);
}
.card-footer-main { display: flex; gap: 8px; flex: 1; }
.card-footer-side { display: flex; gap: 6px; }

/* ─── Empty state ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-secondary);
}
.empty-state i { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 1rem; font-weight: 500; margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ─── Login Page ─────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(46,45,101,0.12) 0%, transparent 70%),
                var(--bg-primary);
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
}
.login-card .logo { justify-content: center; margin-bottom: 32px; font-size: 1.8rem; }
.login-card h2 { font-size: 1.1rem; color: var(--text-secondary); text-align: center; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .btn { width: 100%; justify-content: center; padding: 12px; }
.login-error { font-size: 0.85rem; color: var(--danger); text-align: center; display: none; }

/* ─── Flow Builder Layout ────────────────────────── */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}
.block-list { display: flex; flex-direction: column; gap: 10px; }
.block-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.15s;
}
.block-item:hover { border-color: rgba(46,45,101,0.3); }
.block-item.inactive { opacity: 0.5; }
.block-type-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.block-info { flex: 1; min-width: 0; }
.block-content-preview {
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.block-type-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.block-actions { display: flex; gap: 4px; flex-shrink: 0; }

.block-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
}
.block-panel h3 { font-size: 1rem; font-weight: 600; }
.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-item { display: flex; gap: 6px; }
.option-item input { flex: 1; }

/* ─── Página de Obrigado ─────────────────────────── */

/* Keyframes */
@keyframes tyFadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes tyFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tyScaleIn {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1);   }
}
@keyframes tyOrbFloat {
    0%, 100% { transform: translateY(0px)   scale(1);    }
    50%       { transform: translateY(-28px) scale(1.06); }
}
@keyframes shimmer {
    0%   { left: -100%; }
    100% { left: 200%;  }
}
@keyframes tyBtnShine {
    0%   { left: -100%; }
    100% { left: 200%;  }
}
@keyframes tyPulseGlow {
    0%, 100% { box-shadow: 0 0 0 8px rgba(46,45,101,0.06), 0 0 22px rgba(46,45,101,0.30); }
    50%       { box-shadow: 0 0 0 12px rgba(46,45,101,0.10), 0 0 40px rgba(46,45,101,0.60); }
}

/* Classes de animação com delay escalonado */
.ty-anim-header  { animation: tyFadeIn    0.6s ease both; animation-delay: 0s;     }
.ty-anim-card    { animation: tyFadeInUp  0.75s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.1s; }
.ty-anim-icon    { animation: tyScaleIn   0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: 0.35s; }
.ty-anim-title   { animation: tyFadeInUp  0.6s ease both; animation-delay: 0.5s;   }
.ty-anim-subtitle{ animation: tyFadeInUp  0.6s ease both; animation-delay: 0.65s;  }
.ty-anim-divider { animation: tyFadeIn    0.6s ease both; animation-delay: 0.78s;  }
.ty-anim-item    { animation: tyFadeInUp  0.5s ease both; animation-delay: 0.2s;   }
.ty-anim-footer  { animation: tyFadeIn    0.6s ease both; animation-delay: 1.0s;   }

/* Animações para elementos exibidos dinamicamente pelo JS */
.video-embed:not(.hidden),
.countdown-wrap:not(.hidden),
.ty-cta-btn:not(.hidden) {
    animation: tyFadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Orbs animados de fundo */
.ty-bg-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.ty-bg-orb-1 {
    width: 640px; height: 640px;
    background: rgba(46, 45, 101, 0.32);
    filter: blur(100px);
    top: -200px; left: -160px;
    animation: tyOrbFloat 9s ease-in-out infinite;
    animation-delay: 0s;
}
.ty-bg-orb-2 {
    width: 500px; height: 500px;
    background: rgba(46, 45, 101, 0.24);
    filter: blur(90px);
    bottom: 0; right: -120px;
    animation: tyOrbFloat 11s ease-in-out infinite;
    animation-delay: -4s;
}
.ty-bg-orb-3 {
    width: 340px; height: 340px;
    background: rgba(46, 45, 101, 0.18);
    filter: blur(70px);
    top: 40%; left: 50%;
    transform: translateX(-50%);
    animation: tyOrbFloat 7s ease-in-out infinite;
    animation-delay: -7s;
}

/* Página */
.ty-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    padding: 0 16px 32px;
    position: relative;
    overflow-x: hidden;
}

/* Oculta o chat enquanto ty-page está ativa; fade suave ao aparecer */
#chat-section {
    transition: opacity 0.5s ease;
}
#thankyou-section:not(.hidden):not([style*="display: none"]) ~ #chat-section {
    opacity: 0;
    pointer-events: none;
}

/* Header */
.ty-header {
    width: 100%;
    max-width: 720px;
    padding: 20px 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* Card de vidro */
.ty-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: linear-gradient(
        145deg,
        rgba(255,255,255,0.07) 0%,
        rgba(255,255,255,0.03) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.09);
    padding: 36px 44px 32px;
    box-shadow:
        0 0 48px rgba(46,45,101,0.12),
        0 2.8px   2.2px rgba(0,0,0,0.034),
        0 6.7px   5.3px rgba(0,0,0,0.048),
        0 12.5px  10px  rgba(0,0,0,0.06),
        0 22.3px  17.9px rgba(0,0,0,0.072),
        0 41.8px  33.4px rgba(0,0,0,0.086),
        0 100px   80px  rgba(0,0,0,0.12);
    z-index: 1;
}

/* Bordas com gradiente duplo (padrão glass-pricing) */
.ty-card-border-top {
    position: absolute; inset: 0;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.45);
    -webkit-mask-image: linear-gradient(135deg, white, transparent 55%);
    mask-image: linear-gradient(135deg, white, transparent 55%);
    pointer-events: none;
}
.ty-card-border-bottom {
    position: absolute; inset: 0;
    border-radius: 28px;
    border: 1px solid rgba(46,45,101,0.5);
    -webkit-mask-image: linear-gradient(135deg, transparent 45%, white);
    mask-image: linear-gradient(135deg, transparent 45%, white);
    pointer-events: none;
}

/* Conteúdo do card */
.ty-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

/* Ícone de sucesso */
.ty-success-icon {
    width: 68px; height: 68px;
    border-radius: 50%;
    background: rgba(46,45,101,0.14);
    border: 1px solid rgba(46,45,101,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.6rem;
    box-shadow:
        0 0 0 8px rgba(46,45,101,0.06),
        0 0 28px rgba(46,45,101,0.3);
    /* .ty-anim-icon cuida da entrada; o glow pulsante começa após */
    animation: tyScaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both, tyPulseGlow 3s ease-in-out 1.2s infinite;
}

/* Divisor decorativo */
.ty-divider {
    width: 100%;
    max-width: 380px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.18) 20%,
        rgba(255,255,255,0.35) 50%,
        rgba(255,255,255,0.18) 80%,
        transparent
    );
    flex-shrink: 0;
}

/* Título com gradiente */
.thankyou-title {
    font-family: 'Plus Jakarta Sans', var(--font-body);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(
        145deg,
        #ffffff           0%,
        rgba(255,255,255,0.92) 35%,
        hsl(241, 95%, 72%) 72%,
        hsl(241, 80%, 80%) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 32px rgba(46,45,101,0.35));
    margin: 0;
}

/* Subtítulo */
.thankyou-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.875rem, 1.8vw, 0.97rem);
    color: rgba(255,255,255,0.55);
    max-width: 520px;
    line-height: 1.65;
    margin: 0;
    white-space: pre-line;
}

/* Barra de progresso */
.progress-bar-wrap {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-align: right;
    letter-spacing: 0.04em;
}
.progress-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 8px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), hsl(241, 95%, 70%));
    border-radius: 99px;
    transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    animation: shimmer 2.2s ease infinite;
    animation-delay: 1.6s;
}

/* Vídeo embed */
.video-embed {
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.05) inset;
}
.video-embed iframe { width: 100%; height: 100%; display: block; }

/* Countdown */
.countdown-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}
.countdown-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.40);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0;
}
.countdown-label i { color: var(--accent); opacity: 0.8; }
.countdown-units {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 68px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    padding: 14px 10px 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.3s ease, background 0.3s ease;
}
.countdown-unit:hover {
    border-color: rgba(46,45,101,0.45);
    background: rgba(46,45,101,0.06);
}
.countdown-unit span {
    font-family: 'Plus Jakarta Sans', var(--font-body);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(145deg, #ffffff, rgba(255,255,255,0.78));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.countdown-unit small {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

/* Botão CTA */
.ty-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 13px 22px 13px 30px;
    background: linear-gradient(135deg, var(--accent) 0%, hsl(241, 95%, 68%) 100%);
    color: #fff;
    border: none;
    border-radius: 99px;
    font-family: 'Plus Jakarta Sans', var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.025em;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease;
    box-shadow:
        0 4px 28px rgba(46,45,101,0.45),
        0 0 0 1px rgba(255,255,255,0.12) inset;
    position: relative;
    overflow: hidden;
}
.ty-cta-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.6s ease;
}
.ty-cta-btn:hover::before { left: 160%; }
.ty-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 44px rgba(46,45,101,0.6),
        0 0 0 1px rgba(255,255,255,0.18) inset;
}
.ty-cta-btn:active { transform: translateY(-1px); }
.ty-cta-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.ty-btn-arrow {
    display: inline-flex;
    width: 34px; height: 34px;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.ty-cta-btn:hover .ty-btn-arrow { transform: translateX(4px); }

/* Rodapé da página */
.ty-footer {
    margin-top: 20px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.18);
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}
.ty-footer strong { color: rgba(255,255,255,0.35); font-weight: 500; }

/* Divisor entre seção de obrigado e chat */
.chat-divider {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.chat-divider::before,
.chat-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--glass-border);
}
.chat-divider span {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ─── Responsivo – Obrigado ──────────────────────── */
@media (max-width: 640px) {
    .ty-card { padding: 28px 20px 24px; border-radius: 20px; }
    .ty-content { gap: 12px; }
    .countdown-units { gap: 6px; }
    .countdown-unit { min-width: 58px; padding: 12px 8px 8px; }
    .countdown-unit span { font-size: 1.55rem; }
    .ty-cta-btn { width: 100%; justify-content: center; }
}

/* ─── Chat Page ──────────────────────────────────── */
.chat-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    padding: 24px 16px 48px;
}
.chat-header {
    width: 100%;
    max-width: 640px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 8px;
}
.chat-container {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
}
.bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: bubbleIn 0.25s ease;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.bubble-bot {
    align-self: flex-start;
    background: var(--bot-bubble);
    border: 1px solid var(--bot-bubble-border);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}
.bubble-user {
    align-self: flex-end;
    background: var(--user-bubble);
    border: 1px solid var(--user-bubble-border);
    border-bottom-right-radius: 4px;
    color: var(--text-primary);
}
.typing-indicator {
    align-self: flex-start;
    background: var(--bot-bubble);
    border: 1px solid var(--bot-bubble-border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
    display: flex;
    gap: 5px;
    align-items: center;
}
.typing-dot {
    width: 7px; height: 7px;
    background: rgba(255,255,255,0.55);
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }

.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}
.chat-input-row {
    display: flex;
    gap: 8px;
}
.chat-input-row input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 11px 18px;
    font-size: 0.9rem;
}
.chat-input-row input:focus { border-color: var(--accent-bright); outline: none; box-shadow: 0 0 0 3px rgba(88,86,184,0.18); }
.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-bright) 0%, hsl(241, 72%, 72%) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(88,86,184,0.40);
}
.chat-send-btn:hover {
    background: linear-gradient(135deg, var(--accent-bright-hover) 0%, hsl(241, 72%, 76%) 100%);
    box-shadow: 0 4px 20px rgba(88,86,184,0.55);
    transform: scale(1.05);
}

.choice-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.choice-btn {
    padding: 9px 18px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.choice-btn:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
    color: #fff;
    box-shadow: 0 2px 12px rgba(88,86,184,0.35);
}

.chat-final {
    text-align: center;
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    animation: bubbleIn 0.35s ease;
    width: 100%;
    max-width: 640px;
    margin-top: 16px;
}
.chat-final h2 { font-size: 1.2rem; font-weight: 600; }
.chat-final p { color: var(--text-secondary); font-size: 0.9rem; }
.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    background: #25D366;
    color: #fff;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s;
}
.whatsapp-btn:hover { background: #1ebe5a; color: #fff; }

/* ─── Loader ─────────────────────────────────────── */
.loader {
    width: 32px; height: 32px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 48px; }

/* ─── Utilities ──────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--glass-border); margin: 8px 0; }

@media (max-width: 768px) {
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .builder-layout { grid-template-columns: 1fr; }
    .block-panel { position: static; }
}

/* ─── Roteamento de blocos (conditions) ───────────────────────────────── */
.condition-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--glass-border);
}
.condition-row:last-child { border-bottom: none; }
.condition-answer {
    flex: 0 0 auto;
    max-width: 110px;
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.condition-target {
    flex: 1;
    font-size: 0.8rem;
}
