/* ==========================================================================
   VARIÁVEIS E BASE
   ========================================================================== */
:root {
    --bg: #0b0d10;
    --surface: rgba(26, 29, 35, 0.6);
    --accent: #e63946;
    --accent-hover: #ff4d5a;
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    background-image: radial-gradient(circle at 50% -20%, #2a1013 0%, #0b0d10 60%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   LAYOUT DO CARD (SEM ANIMAÇÃO DE PULOS)
   ========================================================================== */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Removida animação de entrada para estabilidade */
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.auth-header p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin: 0;
}

/* ==========================================================================
   INPUTS E FORMULÁRIO
   ========================================================================== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15);
}

/* Bloqueia a seleção de texto nos campos de senha para evitar cópias acidentais */
input[type="password"] {
    user-select: none; /* Impede selecionar os pontinhos */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Garante que o placeholder também não seja selecionável */
input::placeholder {
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================================
   CENTRALIZAÇÃO E LINKS VERMELHOS
   ========================================================================== */

/* Link "Esqueci minha senha" */
#forgot-password-link {
    text-align: center !important; /* Força centralização */
    margin: 15px 0 25px 0 !important;
}

#forgot-password-link a {
    color: var(--accent) !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
}

/* Rodapé "Não tem conta? Criar conta" */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--accent) !important;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.auth-footer a:hover, 
#forgot-password-link a:hover {
    filter: brightness(1.2);
    text-decoration: underline;
}

/* Checkbox Termos Centralizado */
.checkbox-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.terms-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}

.terms-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Esta é a parte que muda a cor do link para vermelho */
.terms-label a {
    color: var(--accent) !important;
    text-decoration: none;
    font-weight: 700;
}

.terms-label a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

.terms-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ==========================================================================
   ERRO COM ANIMAÇÕES (SHAKE E EXPLODE)
   ========================================================================== */
.error-container {
    background: rgba(230, 57, 70, 0.15);
    color: #ff4d4d;
    border: 1px solid rgba(230, 57, 70, 0.3);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* Classe de animação ao chegar */
.error-shake {
    display: block !important;
    animation: shake 0.4s ease-in-out;
}

/* Classe de animação ao sair */
.error-explode {
    animation: explode 0.5s forwards ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; filter: blur(0); }
    100% { transform: scale(1.4); opacity: 0; filter: blur(12px); }
}

/* ==========================================================================
   BOTÃO E LOADER
   ========================================================================== */
.btn-submit {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
}

.btn-submit:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Barra de Força */
.password-strength {
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* Loader padrão */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Impede a seleção de texto em labels e placeholders para evitar bugs de cópia */
label, 
input::placeholder, 
#forgot-password-link, 
.auth-footer,
.auth-header p {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto; /* Garante que o clique ainda funcione */
}

/* Impede selecionar os pontinhos da senha */
input[type="password"] {
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================================
   OTIMIZAÇÃO MOBILE (TELAS ATÉ 480PX)
   ========================================================================== */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 20px 15px;
        /* Mudamos de flex-start para center para manter a box no meio */
        align-items: center; 
        /* Adicionamos uma margem mínima no topo para garantir que não cole no header */
        padding-top: 60px; 
        min-height: calc(100vh - 60px);
    }

    .auth-card {
        padding: 30px 20px;
        border-radius: 20px;
        /* Garante que o card não "pule" quando o erro aparecer */
        margin-bottom: 20px; 
    }

    .auth-header h2 {
        font-size: 1.5rem; /* Título um pouco menor */
    }

    .auth-header p {
        font-size: 0.9rem;
    }

    /* Aumenta a área de toque dos inputs e botões (melhor para o dedo) */
    .input-group input, 
    .btn-submit {
        padding: 16px; 
        font-size: 16px; /* Evita que o iPhone dê zoom automático no input */
    }

    .input-group label {
        font-size: 0.7rem;
    }

    /* Links e Rodapé */
    .auth-footer {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    #forgot-password-link a {
        padding: 5px; /* Maior área de clique */
    }

    /* Termos de uso mais espaçados no mobile */
    .terms-label {
        font-size: 0.8rem;
        gap: 12px;
    }

    .terms-label input[type="checkbox"] {
        width: 22px; /* Checkbox maior para facilitar o toque */
        height: 22px;
    }

    /* Ajuste do Loader para não sobrepor o texto */
    .loader {
        width: 14px;
        height: 14px;
    }
}