/* css/auth-modern.css - Identidade Visual Concurssauro (Dark Mode) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Cores idênticas à Landing Page */
    --color-primary: #00aaff;
    --color-secondary: #a5fd6d;
    --color-dark: #0c1b3a;
    --color-teal: #259ca5;
    --color-white: #ffffff;
    --color-gray: #8b94a5;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    /* Gradientes */
    --bg-gradient: linear-gradient(135deg, #0c1b3a 0%, #259ca5 100%);
    --card-bg: rgba(12, 27, 58, 0.7); /* Fundo escuro translúcido */
    --input-bg: rgba(255, 255, 255, 0.05);

    /* Espaçamento e Bordas */
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body {
    min-height: 100vh;
    background: var(--bg-gradient);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    color: var(--color-white);
    overflow-x: hidden;
}

/* Wrapper ajustado para alinhar o botão voltar corretamente */
.auth-wrapper {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    padding-top: 1rem; /* Garante respiro no topo em mobile */
}

/* Logo animada */
.logo-area {
    margin-bottom: 2rem;
    animation: floatIn 1s ease forwards;
}
.logo-area img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 170, 255, 0.3));
}

/* === Card com Glassmorphism === */
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px); /* O efeito de vidro */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-white);
}
.auth-header p {
    color: var(--color-gray);
    font-size: 0.95rem;
}

/* === Inputs Modernos (Dark) === */
.input-group {
    margin-bottom: 1.25rem;
    position: relative;
}
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #cbd5e1;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}
.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.8rem;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--color-white);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-wrapper i.field-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray);
    transition: color 0.2s;
}

.input-wrapper .toggle-pass {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--color-gray);
}

/* Foco e Validação */
.input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
}
.input-wrapper input:focus + i {
    color: var(--color-primary);
}

/* Bordas de feedback imediato */
.input-group.success input {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05); /* Fundo verde bem leve */
}
.input-group.error input {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05); /* Fundo vermelho bem leve */
    animation: shake 0.4s ease-in-out; /* Tremidinha sutil ao errar */
}
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}
/* Mensagens de erro com transição suave */
.error-msg {
    display: block; /* Mudamos para block, mas controlamos com altura/opacity */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0;
}

.input-group.error .error-msg {
    max-height: 20px; /* Altura suficiente para o texto */
    opacity: 1;
    margin-top: 0.4rem;
}

/* === Barra de Força da Senha === */
.password-strength {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}
.strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s, background-color 0.3s;
}

/* === Botões === */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-primary), #0088cc);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.4);
}
.btn-primary:disabled {
    background: var(--color-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === Botão Social (Google) === */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--color-gray);
    font-size: 0.85rem;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.divider span {
    padding: 0 10px;
}

.btn-social {
    width: 100%;
    padding: 0.875rem;
    background: white;
    color: #1e293b; /* Texto escuro no botão branco para contraste */
    border: none;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-social:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}
.btn-social img {
    width: 20px;
    height: 20px;
}

/* === Links e Toast === */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-gray);
}
.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover {
    color: var(--color-secondary);
}

/* === Botão Voltar (Apenas Ícone - Dentro do Card) === */
.back-icon {
    position: absolute; /* Fixa no canto do cartão */
    top: 20px;
    left: 20px;
    font-size: 1.25rem; /* Tamanho do ícone */
    color: var(--color-gray);
    text-decoration: none;
    transition: all 0.2s ease;
    z-index: 10; /* Garante que fique sobre tudo */
    padding: 5px; /* Área de toque melhor */
}

.back-icon:hover {
    color: var(--color-primary);
    transform: translateX(-3px); /* Leve movimento para a esquerda */
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}
.toast {
    background: white;
    color: #1e293b;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--color-primary);
    animation: slideIn 0.3s ease;
    /* NOVA ANIMAÇÃO */
    opacity: 0; /* Começa invisível */
    transform: translateY(-20px); /* Começa um pouco acima */
    animation: toastFadeIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes toastFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.toast.success {
    border-left-color: var(--success);
}
.toast.error {
    border-left-color: var(--error);
}
.toast i.fa-check-circle {
    color: var(--success);
}
.toast i.fa-exclamation-circle {
    color: var(--error);
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsivo Mobile */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    .auth-header h1 {
        font-size: 1.5rem;
    }
    .back-link {
        top: -2.5rem;
    }
    .auth-wrapper {
        padding-top: 0; /* Remove padding extra se necessário */
    }
    .back-icon {
        top: 15px;
        left: 15px;
        font-size: 1.1rem;
    }
}
