/* --- Resets Globais e Fontes --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* --- FIX v0.8: Gradiente no HTML/BODY --- */
html {
    height: 100%;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100%; /* Garante que o gradiente cubra tudo */
    position: relative;
    color: #333;
    
    /* Gradiente animado */
    background: linear-gradient(135deg, #0171bb, #00417d, #0171bb);
    background-size: 300% 300%;
    animation: moveGradient 12s ease-in-out infinite;
    background-attachment: fixed; /* O gradiente fica parado ao rolar */
}

@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- FIX v0.8: Sparkles em Posição Fixa --- */
.background-animation,
.floating-coins {
    position: fixed; /* Fica parado no fundo */
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1; /* Fica atrás de todo o conteúdo */
    overflow: hidden;
}
.chart-line,
.chart-bar,
.coin {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 4px #fff, 0 0 8px #fff;
    font-size: 0; 
    animation: fall 10s infinite linear;
}
@keyframes fall {
    0% { transform: translateY(-50px); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateY(calc(100vh + 50px)); opacity: 0; }
}
.chart-line:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 8s; }
.chart-line:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 10s; }
.chart-line:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 7s; }
.chart-line:nth-child(4) { left: 40%; animation-delay: 6s; animation-duration: 9s; }
.chart-bar:nth-child(5) { left: 50%; animation-delay: 0.5s; animation-duration: 11s; }
.chart-bar:nth-child(6) { left: 55%; animation-delay: 1s; animation-duration: 8s; }
.chart-bar:nth-child(7) { left: 60%; animation-delay: 1.5s; animation-duration: 10s; }
.chart-bar:nth-child(8) { left: 65%; animation-delay: 2s; animation-duration: 7s; }
.chart-bar:nth-child(9) { left: 70%; animation-delay: 2.5s; animation-duration: 12s; }
.chart-bar:nth-child(10) { left: 75%; animation-delay: 3s; animation-duration: 9s; }
.coin:nth-child(1) { left: 80%; animation-delay: 0s; animation-duration: 10s; }
.coin:nth-child(2) { left: 85%; animation-delay: 3s; animation-duration: 7s; }
.coin:nth-child(3) { left: 90%; animation-delay: 6s; animation-duration: 8s; }
.coin:nth-child(4) { left: 95%; animation-delay: 9s; animation-duration: 11s; }
.coin:nth-child(5) { left: 5%; animation-delay: 12s; animation-duration: 9s; }

/* --- FIX v0.8: Caixa de Login Universal --- */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    width: 95%; /* Segurança para telas pequenas */
    max-width: 420px; /* Largura padrão (login) */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10;
    position: relative;
    animation: slideIn 0.8s ease-out;
    margin: 40px auto; /* Centraliza e permite rolagem */
}
/* Aumenta a largura da caixa SOMENTE no formulário de cadastro */
body.form-page .login-container {
    max-width: 800px;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
.logo-container {
    text-align: center;
    margin-bottom: 25px;
}
.logo {
    width: 200px;
    height: auto;
    transition: transform 0.3s ease;
}
.logo:hover {
    transform: scale(1.05);
}
h2 {
    color: #333;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}
.subtitle {
    text-align: center;
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
    font-weight: 300;
}
/* --- FEATURE v0.8: Asterisco Vermelho --- */
label .required {
    color: red;
    font-weight: bold;
    margin-left: 2px;
}
/* --- RESTO DO CSS (Formulários, Botões, etc.) --- */
.form-group {
    margin-bottom: 25px;
    position: relative;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}
.form-group input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}
/* Corrige inputs que não precisam de ícone de olho */
.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"] {
    padding-right: 15px;
}
.form-group input:focus {
    outline: none;
    border-color: #0171bb;
    box-shadow: 0 0 0 3px rgba(1, 113, 187, 0.1);
}
.form-group .icon {
    position: absolute;
    right: 15px;
    top: 41px;
    color: #999;
    z-index: 10;
}
.form-group .password-toggle {
    cursor: pointer;
    user-select: none;
    font-size: 18px;
}
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}
.remember-forgot label {
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 400;
}
.remember-forgot input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}
.remember-forgot a {
    color: #0171bb;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}
.remember-forgot a:hover {
    color: #00417d;
    text-decoration: underline;
}
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0171bb, #00417d);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(1, 113, 187, 0.4);
}
.login-btn:active {
    transform: translateY(0);
}
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    display: none;
    animation: shake 0.5s;
}
.error-message.show {
    display: block;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}
.footer {
    text-align: center;
    margin-top: 30px;
    color: #999;
    font-size: 12px;
}
@media (max-width: 480px) {
    .login-container {
        margin: 20px;
        padding: 30px 20px;
        width: 90%;
    }
    .logo { width: 150px; }
    h2 { font-size: 20px; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* --- CSS DO FORMULÁRIO (NOVOADV) --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-grid .full-width {
    grid-column: 1 / -1;
}
fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    grid-column: 1 / -1;
}
legend {
    font-size: 1.2em;
    font-weight: 600;
    color: #00417d;
    padding: 0 10px;
}
.hidden-section {
    display: none;
}
.checkbox-group label {
    font-weight: 500;
    display: inline-block;
    margin-left: 10px;
}

/* --- CSS DA TELA DE CONFIRMAÇÃO --- */
.resumo-grupo {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.resumo-grupo h4 {
    color: #00417d;
    font-size: 1.1em;
    margin-bottom: 10px;
}
.resumo-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    margin-bottom: 5px;
    font-size: 0.9em;
}
.resumo-item strong { color: #333; text-transform: capitalize; }
.resumo-item span { color: #555; }
.botoes-acao {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}
.botoes-acao button { width: 48%; }
.botoes-acao .btn-voltar {
    background: #6c757d;
}
.botoes-acao .btn-voltar:hover {
    background: #5a6268;
}

/* --- v1.6.3: ADICIONAR ESTAS DUAS REGRAS --- */

/* v1.6.3: Botão Voltar (Topo da Página) */
.btn-voltar-topo {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    background: #6c757d;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.2s ease;
    z-index: 20; /* Fica acima do container */
}
.btn-voltar-topo:hover {
    background: #5a6268;
    transform: scale(1.05);
}

/* Ajusta o padding do container para o botão não sobrepor */
.login-container {
    padding-top: 60px; /* Mais espaço no topo */
    position: relative; /* Necessário para o .btn-voltar-topo */
}