:root {
    --primary: #00205B;
    --primary-light: #0066B1;
    --primary-hover: #001233;
    --bg-color: #F8FAFC;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --danger-red: #E02221;
    --success: #10B981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    overscroll-behavior: none;
}

body {
    background-color: var(--bg-color);
    min-height: 100vh;
    width: 100%;
}

/* ==========================================
   LAYOUT DIVIDIDO (painel da marca + formulário)
   ========================================== */
.desktop-split-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #F1F5F9;
}

.desktop-left-panel { display: none; }

.login-right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-color);
}

.login-card {
    background: var(--bg-color);
    border: none;
    box-shadow: none;
    color: var(--text-main);
}

@media (min-width: 992px) {
    .desktop-left-panel {
        display: flex;
        flex: 1.2;
        background: linear-gradient(145deg, #00112B, #00205B);
        position: relative;
        overflow: hidden;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        color: white;
        text-align: center;
        padding: 40px;
        box-shadow: inset -10px 0 20px rgba(0, 0, 0, 0.3);
    }

    .login-right-panel { flex: 1; background: white; }
    .login-container { background: white; }

    .login-card {
        border: 1px solid #E2E8F0;
        padding: 40px !important;
        max-width: 450px !important;
        background: white;
    }
}

/* Painel da marca */
.cyber-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.8;
}

.tech-shield-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
    margin-bottom: 40px;
    z-index: 2;
}

.tech-icon {
    font-size: 85px;
    color: #FFFFFF;
    animation: floatIcon 4s ease-in-out infinite;
    z-index: 3;
    filter: drop-shadow(0 0 20px rgba(0, 130, 251, 0.8));
}

.pulse-ring-1, .pulse-ring-2, .pulse-ring-3 {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    z-index: 1;
}
.pulse-ring-1 { border: 2px solid rgba(0, 130, 251, 0.7); animation: radarPulse 2.5s cubic-bezier(0, 0, 0.2, 1) infinite; }
.pulse-ring-2 { border: 2px solid rgba(245, 25, 41, 0.5); animation: radarPulse 2.5s cubic-bezier(0, 0, 0.2, 1) infinite 0.8s; }
.pulse-ring-3 { border: 1px dashed rgba(255, 255, 255, 0.3); animation: radarPulse 4s linear infinite; }

.painel-titulo { z-index: 2; font-size: 32px; font-weight: 900; margin-bottom: 12px; letter-spacing: -1px; }
.painel-texto  { z-index: 2; font-size: 15px; color: #94A3B8; max-width: 380px; line-height: 1.6; }

.vs-integra-footer {
    position: absolute;
    bottom: 30px;
    font-size: 13px;
    color: #94A3B8;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 2;
}
.vs-integra-footer strong { color: #FFFFFF; font-weight: 800; }

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes radarPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3.5); opacity: 0; }
}

/* ==========================================
   TOPO: LOGO E TEXTOS
   ========================================== */
.header-visual {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.logo-box {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 32, 91, 0.3);
    color: white;
    font-size: 36px;
}

.brand-text { padding: 0 20px; text-align: center; }
.brand-text h2 { color: var(--primary); font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.brand-text p { color: var(--text-muted); font-size: 14px; line-height: 1.5; font-weight: 500; }

/* ==========================================
   ÁREA DE AÇÕES
   ========================================== */
.action-area { flex: 1; display: flex; flex-direction: column; padding: 30px 20px; }

.step { display: none; flex-direction: column; gap: 15px; width: 100%; }
.step.active { display: flex; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

input, select {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    background-color: #FFFFFF;
    color: var(--text-main);
    transition: all 0.3s;
    font-weight: 500;
}
input::placeholder { color: #94A3B8; }
input:focus, select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(0, 102, 177, 0.1); }

.codigo-input { text-align: center; letter-spacing: 10px; font-size: 24px; font-weight: 800; color: var(--primary); }
.rotulo-codigo { font-size: 13px; color: var(--text-muted); font-weight: 600; text-align: left; text-transform: uppercase; }

.btn-colored {
    background: var(--primary);
    color: white;
    font-weight: 700;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    box-shadow: 0 8px 20px rgba(0, 32, 91, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-colored:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 12px 25px rgba(0, 32, 91, 0.35); }
.btn-colored:active { transform: scale(0.98); }
.btn-colored:disabled { background: #CBD5E1; box-shadow: none; cursor: not-allowed; transform: none; }

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-outline:hover { background-color: var(--primary); color: white; }
.btn-outline:disabled { opacity: .5; cursor: not-allowed; }

.btn-text-only {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 10px;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
}
.btn-text-only:hover { color: var(--primary-light); }
.btn-text-only:disabled { opacity: .5; cursor: not-allowed; }

.message { margin-top: 15px; font-size: 13px; font-weight: 700; text-align: center; min-height: 18px; }
.message.erro { color: var(--danger-red); }
.message.ok { color: var(--success); }

.aviso-dev {
    background: #FFFBEB;
    border: 1px dashed #F59E0B;
    color: #92400E;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: left;
}
.aviso-dev strong { font-size: 16px; letter-spacing: 3px; }

/* ==========================================
   RODAPÉ
   ========================================== */
.app-footer { text-align: center; padding: 20px; font-size: 12px; color: #94A3B8; font-weight: 500; }
.app-footer a.link { color: inherit; text-decoration: underline; cursor: pointer; }
.app-footer .marca { font-size: 11px; font-weight: bold; opacity: 0.8; color: var(--primary); }
.app-footer .ajuda { margin-top: 16px; padding-top: 14px; border-top: 1px solid #E2E8F0; }

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 32, 91, 0.2);
    text-align: center;
}

.modal-content h2 { color: var(--primary); margin-bottom: 8px; font-size: 20px; }
.modal-content .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.modal-icone { font-size: 40px; color: var(--primary); margin-bottom: 10px; }

.campo { margin-bottom: 15px; text-align: left; }
.campo label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; }
.campo input { padding: 12px; border-radius: 6px; font-size: 14px; }

.aceite-lgpd {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background: #F8FAFC;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    text-align: left;
}
.aceite-lgpd input { width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0; padding: 0; accent-color: var(--primary); }
.aceite-lgpd label { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; cursor: pointer; }
.aceite-lgpd a { color: var(--primary); font-weight: 700; text-decoration: underline; }

.modal-acoes { display: flex; gap: 10px; margin-top: 20px; }
.modal-acoes .btn-text-only { flex: 1; border: 1px solid #CBD5E1; border-radius: 6px; padding: 12px; font-weight: bold; color: #475569; }
.modal-acoes .btn-colored { flex: 1; border-radius: 6px; padding: 12px; }

.termos { padding: 0; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.termos-topo { padding: 22px 24px 16px; border-bottom: 1px solid #E2E8F0; flex-shrink: 0; text-align: left; }
.termos-topo h2 { font-size: 18px; margin: 0 0 4px; }
.termos-topo p { margin: 0; font-size: 11.5px; color: var(--text-muted); }
.termos-corpo { padding: 20px 24px; overflow-y: auto; font-size: 13px; line-height: 1.65; color: #334155; text-align: left; }
.termos-corpo p { margin-bottom: 14px; }
.termos-rodape { padding: 16px 24px; border-top: 1px solid #E2E8F0; flex-shrink: 0; text-align: right; }
.termos-rodape .btn-colored { width: auto; padding: 10px 24px; display: inline-flex; }

/* ==========================================
   SPLASH
   ========================================== */
#splash-screen {
    position: fixed;
    inset: 0;
    background: #FFFFFF;
    z-index: 99999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
#splash-screen.active { display: flex; opacity: 1; }

.splash-logo {
    font-size: 60px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    color: white;
    background: var(--primary);
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    box-shadow: 0 15px 30px rgba(0, 32, 91, 0.3);
}
.splash-title { font-size: 28px; font-weight: 900; margin-bottom: 10px; letter-spacing: -1px; color: var(--primary); text-transform: uppercase; }
.splash-user { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.loader-splash { width: 40px; height: 40px; border: 4px solid #E2E8F0; border-top: 4px solid var(--primary-light); border-radius: 50%; animation: spin 1s linear infinite; margin-top: 40px; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
