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

* { font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.font-mono { font-family: 'IBM Plex Mono', monospace; }

.quantum-grid {
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}

.quantum-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}
@keyframes float-delayed {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 15px) scale(0.95); }
    66% { transform: translate(20px, -25px) scale(1.05); }
}

.glow-border { position: relative; }
.glow-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.5), rgba(245, 158, 11, 0.3), transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.stat-item { animation: countUp 0.6s ease forwards; }

.card-lift {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.08);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.marquee-track { animation: marquee 25s linear infinite; }

.chip {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.15);
    color: #2563eb;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.dark-card { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }

/* Section container: fundo cinza medio + borda gradiente invertida */
.section-glass {
    background: linear-gradient(160deg, #dde1e8 0%, #d9dee6 50%, #dcdfe6 100%);
    border: 1px solid transparent;
    border-radius: 24px;
    position: relative;
}
.section-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(340deg, rgba(37, 99, 235, 0.25), rgba(244, 63, 94, 0.15) 40%, rgba(245, 158, 11, 0.20) 70%, rgba(37, 99, 235, 0.12));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Variante mais quente (coral/amarelo) */
.section-glass-warm {
    background: linear-gradient(160deg, #dfdbdf 0%, #dddcdd 50%, #dadbe0 100%);
    border: 1px solid transparent;
    border-radius: 24px;
    position: relative;
}
.section-glass-warm::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(340deg, rgba(245, 158, 11, 0.25), rgba(37, 99, 235, 0.15) 40%, rgba(244, 63, 94, 0.20) 70%, rgba(245, 158, 11, 0.12));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Variante azul */
.section-glass-blue {
    background: linear-gradient(160deg, #dae0ea 0%, #dcdee4 50%, #dbdce0 100%);
    border: 1px solid transparent;
    border-radius: 24px;
    position: relative;
}
.section-glass-blue::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(340deg, rgba(59, 130, 246, 0.28), rgba(245, 158, 11, 0.12) 50%, rgba(37, 99, 235, 0.20));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.demo-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
}

.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.demo-btn-primary { background: #2563eb; color: white; }
.demo-btn-primary:hover { background: #1d4ed8; }
.demo-btn-danger { background: #f43f5e; color: white; }
.demo-btn-danger:hover { background: #e11d48; }
.demo-btn-orange { background: #f59e0b !important; color: white !important; }
.demo-btn-orange:hover { background: #d97706 !important; }
.demo-btn-outline { background: white; color: #374151; border: 1px solid #d1d5db; }
.demo-btn-outline:hover { background: #f9fafb; }
.demo-btn-success { background: #10b981; color: white; }
.demo-btn-success:hover { background: #059669; }
.demo-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.demo-result {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}
.demo-result-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.demo-result-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.demo-result-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }

.loading-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.candidate-btn {
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}
.candidate-btn:hover { border-color: #2563eb; background: #eff6ff; }
.candidate-btn.selected { border-color: #2563eb; background: #2563eb; color: white; }

.authority-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.authority-toggle.active { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.authority-toggle .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.2s;
}
.authority-toggle.active .dot { background: #10b981; }
