/* ================================================================
   FÁCIL PRIME 4 — main.css
   ================================================================ */

:root {
    --ouro:        #D4A520;
    --ouro-brilho: #F5C842;
    --ouro-escuro: #A07810;
    --fundo:       #07070f;
    --fundo-card:  #0f0f1e;
    --fundo-card2: #13132a;
    --borda:       rgba(212,165,32,0.18);
    --texto:       #e8e8f0;
    --texto-dim:   #7878a0;
    --col-azul:    #2563eb;
    --col-rosa:    #db2777;
    --col-laranja: #ea580c;
    --col-amarelo: #ca8a04;
    --col-verde:   #16a34a;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --t: .2s ease;
    --font-display: 'Oxanium', sans-serif;
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition:   .2s ease;
    --sucesso:      #16a34a;
    --erro:         #dc2626;
    --aviso:        #d97706;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--fundo);
    color: var(--texto);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.55;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%,  rgba(212,165,32,.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(26,79,216,.07)  0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── NAVEGAÇÃO ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7,7,15,.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--borda);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 68px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo img {
    height: 44px;
    display: block;
    filter: drop-shadow(0 0 10px rgba(212,165,32,.45));
    transition: filter var(--t);
}
.nav-logo:hover img { filter: drop-shadow(0 0 18px rgba(212,165,32,.85)); }

.nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .25rem;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--texto-dim);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    padding: .45rem .9rem;
    border-radius: var(--r-sm);
    transition: all var(--t);
    white-space: nowrap;
}
.nav-link:hover { color: var(--texto); background: rgba(255,255,255,.06); }
.nav-link.active { color: var(--ouro); }

.nav-badge {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: rgba(212,165,32,.1);
    border: 1px solid rgba(212,165,32,.3);
    border-radius: 20px;
    padding: .28rem .75rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ouro-brilho);
    white-space: nowrap;
    margin-left: .25rem;
}

.dot {
    width: 7px;
    height: 7px;
    background: var(--ouro);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.4; transform:scale(.6); }
}

.btn-nav {
    background: linear-gradient(135deg, var(--ouro), var(--ouro-escuro));
    color: #000;
    font-weight: 700;
    font-size: .82rem;
    padding: .48rem 1.1rem;
    border-radius: var(--r-sm);
    text-decoration: none;
    letter-spacing: .04em;
    transition: all .25s;
    box-shadow: 0 0 18px rgba(212,165,32,.28);
    white-space: nowrap;
}
.btn-nav:hover { transform:translateY(-1px); box-shadow:0 4px 22px rgba(212,165,32,.48); }

/* ── MAIN & CONTAINER ── */
.main {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 68px - 72px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ── ALERTAS ── */
.alert {
    padding: .85rem 1.1rem;
    border-radius: var(--r-md);
    font-size: .88rem;
    margin-bottom: .5rem;
}
.alert-success { background:rgba(22,163,74,.14);  border:1px solid rgba(22,163,74,.4);  color:#86efac; }
.alert-error,
.alert-danger  { background:rgba(220,38,38,.14);  border:1px solid rgba(220,38,38,.4);  color:#fca5a5; }
.alert-info    { background:rgba(212,165,32,.1);   border:1px solid rgba(212,165,32,.3); color:var(--ouro-brilho); }
.alert-warning { background:rgba(234,88,12,.14);   border:1px solid rgba(234,88,12,.4);  color:#fdba74; }

/* ── NOTIFICAÇÕES ── */
.fp4-toast-region {
    position: fixed;
    top: 82px;
    right: 1rem;
    z-index: 10000;
    display: grid;
    gap: .65rem;
    width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.fp4-toast {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .75rem;
    align-items: start;
    padding: .85rem .95rem;
    border-radius: var(--r-md);
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(15,15,30,.96);
    color: var(--texto);
    box-shadow: 0 14px 40px rgba(0,0,0,.36);
    pointer-events: auto;
    animation: fp4ToastIn .18s ease-out;
}

.fp4-toast-success { border-color: rgba(22,163,74,.45); }
.fp4-toast-error   { border-color: rgba(220,38,38,.5); }
.fp4-toast-warning { border-color: rgba(234,88,12,.5); }
.fp4-toast-info    { border-color: rgba(212,165,32,.38); }

.fp4-toast-text {
    font-size: .88rem;
    line-height: 1.45;
}

.fp4-toast-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r-sm);
    background: rgba(255,255,255,.05);
    color: var(--texto-dim);
    cursor: pointer;
    line-height: 1;
}

.fp4-toast-close:hover {
    color: var(--texto);
    background: rgba(255,255,255,.1);
}

.fp4-toast-out {
    opacity: 0;
    transform: translateY(-6px);
}

@keyframes fp4ToastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── CARDS ── */
.card {
    background: var(--fundo-card);
    border: 1px solid var(--borda);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color var(--t);
}
.card:hover { border-color: rgba(212,165,32,.32); }

.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--borda);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .65rem;
}

.card-title {
    font-family: 'Oxanium', sans-serif;
    font-weight: 700;
    font-size: .95rem;
    color: var(--texto);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.card-subtitle {
    font-size: .78rem;
    color: var(--texto-dim);
    margin-top: .15rem;
}

.card-body { padding: 1.5rem; }

.gold-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ouro), transparent);
    border: none;
    margin: 1rem 0;
}

/* ── BOTÕES ── */
.btn-prime {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: linear-gradient(135deg, var(--ouro) 0%, #b8860b 100%);
    color: #000;
    font-family: 'Oxanium', sans-serif;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .85rem 1.75rem;
    border-radius: var(--r-md);
    border: none;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 0 28px rgba(212,165,32,.32);
}
.btn-prime:hover { transform:translateY(-2px); box-shadow:0 6px 38px rgba(212,165,32,.55); }
.btn-prime:disabled { opacity:.45; cursor:not-allowed; transform:none; box-shadow:none; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: transparent;
    color: var(--texto-dim);
    font-size: .88rem;
    font-weight: 500;
    padding: .65rem 1.1rem;
    border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,.1);
    cursor: pointer;
    transition: all var(--t);
    text-decoration: none;
}
.btn-ghost:hover { color:var(--texto); border-color:rgba(255,255,255,.22); background:rgba(255,255,255,.04); }

.btn-block { width: 100%; }

/* ── FORMULÁRIOS ── */
.form-group { margin-bottom: 1.2rem; }

.form-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--texto-dim);
    margin-bottom: .45rem;
}

.form-control {
    width: 100%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r-sm);
    color: var(--texto);
    font-family: 'DM Sans', sans-serif;
    font-size: .92rem;
    padding: .7rem .95rem;
    transition: border-color var(--t), box-shadow var(--t);
    outline: none;
    -webkit-appearance: none;
}
.form-control:focus {
    border-color: rgba(212,165,32,.5);
    box-shadow: 0 0 0 3px rgba(212,165,32,.1);
}
.form-control option { background: #1a1a2e; color: var(--texto); }

/* ── ESFERAS ── */
.esfera,
.esfera-sm {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Oxanium', sans-serif;
    font-weight: 700;
    position: relative;
    transition: transform var(--t);
    flex-shrink: 0;
    cursor: default;
}
.esfera    { width:42px; height:42px; font-size:.85rem; }
.esfera-sm { width:32px; height:32px; font-size:.72rem; }

.esfera::after, .esfera-sm::after {
    content: '';
    position: absolute;
    top: 22%; left: 26%;
    width: 28%; height: 16%;
    background: rgba(255,255,255,.48);
    border-radius: 50%;
    transform: rotate(-35deg);
    pointer-events: none;
}

.col-1 { background:radial-gradient(circle at 35% 30%, #93c5fd, #2563eb 60%, #1e40af); color:#fff; box-shadow:0 2px 10px rgba(37,99,235,.55); }
.col-2 { background:radial-gradient(circle at 35% 30%, #f9a8d4, #db2777 60%, #9d174d); color:#fff; box-shadow:0 2px 10px rgba(219,39,119,.55); }
.col-3 { background:radial-gradient(circle at 35% 30%, #fdba74, #ea580c 60%, #9a3412); color:#fff; box-shadow:0 2px 10px rgba(234,88,12,.55); }
.col-4 { background:radial-gradient(circle at 35% 30%, #fde047, #ca8a04 60%, #854d0e); color:#fff; box-shadow:0 2px 10px rgba(202,138,4,.55); }
.col-5 { background:radial-gradient(circle at 35% 30%, #86efac, #16a34a 60%, #14532d); color:#fff; box-shadow:0 2px 10px rgba(22,163,74,.55); }

.esfera:hover, .esfera-sm:hover { transform:scale(1.1); }

/* ── LEGENDA COLUNAS ── */
.legenda-colunas {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.legenda-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    color: var(--texto-dim);
    font-weight: 500;
}
.legenda-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legenda-dot.col-azul    { background: var(--col-azul); }
.legenda-dot.col-rosa    { background: var(--col-rosa); }
.legenda-dot.col-laranja { background: var(--col-laranja); }
.legenda-dot.col-amarelo { background: var(--col-amarelo); }
.legenda-dot.col-verde   { background: var(--col-verde); }

/* ── SPINNER ── */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(212,165,32,.18);
    border-top-color: var(--ouro);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
.spinner-lg { width:48px; height:48px; border-width:4px; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── LOADING OVERLAY ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7,7,15,.88);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(8px);
}
.loading-overlay.hidden { display: none; }

.loading-text {
    font-family: 'Oxanium', sans-serif;
    font-size: 1rem;
    color: var(--ouro-brilho);
    letter-spacing: .08em;
}

.loading-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    justify-content: center;
    padding: 2rem;
    color: var(--texto-dim);
    font-size: .9rem;
}

/* ── RODAPÉ ── */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--borda);
    padding: 1.3rem 1.5rem;
    text-align: center;
    font-size: .78rem;
    color: var(--texto-dim);
}
.footer-brand {
    font-family: 'Oxanium', sans-serif;
    font-weight: 700;
    color: var(--ouro);
}

/* ── UTILITÁRIOS ── */
.hidden   { display: none !important; }
.mt-sm    { margin-top: .5rem; }
.text-ouro { color: var(--ouro-brilho); }
.text-dim  { color: var(--texto-dim); }
.font-oxanium { font-family: 'Oxanium', sans-serif; }

/* ── RESPONSIVO ── */
@media (max-width: 768px) {
    .nav-inner { height: 56px; padding: 0 1rem; }
    .nav-link  { display: none; }
    .nav-logo img { height: 36px; }
    .nav-badge { font-size:.72rem; padding:.22rem .55rem; }
    .container { padding: 0 1rem; }
    .card-body { padding: 1rem; }
    .esfera    { width:36px; height:36px; font-size:.78rem; }
    .esfera-sm { width:28px; height:28px; font-size:.66rem; }
}

@media (max-width: 480px) {
    .nav-badge { display: none; }
    .btn-nav   { padding:.4rem .75rem; font-size:.78rem; }
}

/* ── Estados de seleção das esferas (seletor de desdobramento) ── */
.esfera.estado-vazia{opacity:.3;filter:grayscale(.5);}
.esfera-sm.estado-vazia{opacity:.3;filter:grayscale(.5);}
.esfera.estado-variavel,.esfera-sm.estado-variavel{opacity:1;filter:none;}
.esfera.estado-nucleo,.esfera-sm.estado-nucleo{opacity:1;filter:none;box-shadow:0 0 0 3px var(--fundo-card),0 0 0 5px var(--ouro);}
.esfera-toggle{cursor:pointer;border:none;padding:0;-webkit-appearance:none;appearance:none;}
