/* ============================================
   RESET E VARIÁVEIS
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais */
    --primary-purple: #5b4b8a;
    --secondary-purple: #6b5b9a;
    --dark-purple: #4a3b7a;
    --accent-orange: #ff8c42;
    --accent-blue: #4a90e2;
    /* Cores de fundo */
    --bg-gradient-start: #5b4b8a;
    --bg-gradient-end: #3d2d6a;
    /* Cores de texto */
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #95a5a6;
    --text-white: #ffffff;
    /* Cores de estado */
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
    /* Transições */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-image: url('../images/capa_fundo_login.jpeg');
    /* Faz a imagem cobrir toda a área do elemento */
    background-size: cover;
    /* Centraliza a imagem horizontalmente e verticalmente */
    background-position: center;
    /* Impede que a imagem se repita (lado a lado) */
    background-repeat: no-repeat;
    /* Define uma cor de fundo caso a imagem demore ou não carregue */
    background-color: #333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ============================================
   FUNDO ANIMADO COM PARTÍCULAS
============================================ */

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }

    33% {
        transform: translateY(-100px) translateX(50px) rotate(120deg);
    }

    66% {
        transform: translateY(-50px) translateX(-50px) rotate(240deg);
    }
}

/* ============================================
   CONTAINER PRINCIPAL
============================================ */

.login-container {
    position: relative;
    z-index: 10;
    padding: 20px;
    width: 100%;
    max-width: 480px;
    animation: slideIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   CARD DE LOGIN
============================================ */

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow-y: auto;
    max-height: 95vh;
}

    .login-card::-webkit-scrollbar {
        width: 8px;
    }

    .login-card::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 10px;
    }

    .login-card::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, var(--primary-purple), var(--accent-blue));
        border-radius: 10px;
    }

        .login-card::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(135deg, var(--accent-blue), var(--primary-purple));
        }

    .login-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 5px;
        background: linear-gradient(90deg, var(--accent-orange), var(--accent-blue), var(--accent-orange));
        background-size: 200% 100%;
        animation: gradientMove 3s ease infinite;
    }

@keyframes gradientMove {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   LOGO
============================================ */

.logo-container {
    text-align: center;
    margin-bottom: 35px;
    animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
    transition: transform var(--transition-normal);
}

    .logo:hover {
        transform: scale(1.05);
    }

/* ============================================
   TÍTULO
============================================ */

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 35px;
    position: relative;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   FORMULÁRIO
============================================ */

.login-form {
    animation: fadeInUp 1s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    margin-bottom: 25px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 20px;
    color: var(--primary-purple);
    font-size: 18px;
    transition: all var(--transition-normal);
    z-index: 2;
}

.input-field {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    font-size: 16px;
    color: var(--text-primary);
    background: #f8f9fa;
    transition: all var(--transition-normal);
    font-family: inherit;
}

    .input-field:focus {
        outline: none;
        border-color: var(--primary-purple);
        background: white;
        box-shadow: 0 0 0 4px rgba(91, 75, 138, 0.1);
        transform: translateY(-2px);
    }

        .input-field:focus + .input-icon,
        .input-field:not(:placeholder-shown) + .input-icon {
            color: var(--accent-orange);
            transform: scale(1.1);
        }

.toggle-password {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
    z-index: 2;
    padding: 5px;
}

    .toggle-password:hover {
        color: var(--primary-purple);
        transform: scale(1.1);
    }

    .toggle-password.active {
        color: var(--accent-orange);
    }

/* ============================================
   OPÇÕES DO FORMULÁRIO
============================================ */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Checkbox customizado */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

    .checkbox-container input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
    }

.checkmark {
    position: relative;
    height: 22px;
    width: 22px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    margin-right: 10px;
    transition: all var(--transition-normal);
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary-purple);
    background-color: rgba(91, 75, 138, 0.05);
}

.checkbox-container input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
    border-color: var(--primary-purple);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
}

    .forgot-password::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--primary-purple), var(--accent-orange));
        transition: width var(--transition-normal);
    }

    .forgot-password:hover {
        color: var(--accent-orange);
    }

        .forgot-password:hover::after {
            width: 100%;
        }

/* ============================================
   BOTÃO DE LOGIN
============================================ */

.btn-login {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all var(--transition-normal);
    box-shadow: 0 8px 20px rgba(91, 75, 138, 0.3);
    position: relative;
    overflow: hidden;
}

    .btn-login::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s ease;
    }

    .btn-login:hover::before {
        left: 100%;
    }

    .btn-login:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(91, 75, 138, 0.4);
    }

    .btn-login:active {
        transform: translateY(-1px);
        box-shadow: 0 6px 15px rgba(91, 75, 138, 0.3);
    }

    .btn-login.loading {
        pointer-events: none;
        opacity: 0.8;
    }

        .btn-login.loading .btn-text {
            opacity: 0;
        }

        .btn-login.loading::after {
            content: '';
            position: absolute;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-icon {
    font-size: 18px;
    transition: transform var(--transition-normal);
}

.btn-login:hover .btn-icon {
    transform: translateX(5px);
}

/* ============================================
   DIVISOR
============================================ */

.divider {
    position: relative;
    text-align: center;
    margin: 35px 0;
}

    .divider::before,
    .divider::after {
        content: '';
        position: absolute;
        top: 50%;
        width: 42%;
        height: 1px;
        background: linear-gradient(to right, transparent, #dee2e6, transparent);
    }

    .divider::before {
        left: 0;
    }

    .divider::after {
        right: 0;
    }

    .divider span {
        background: white;
        padding: 0 15px;
        color: var(--text-light);
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

/* ============================================
   PÁGINA DE REGISTRO
============================================ */

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin: -25px 0 30px 0;
    line-height: 1.5;
}

.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all var(--transition-normal);
    border-radius: 3px;
}

    .strength-fill.weak {
        width: 33%;
        background: var(--error);
    }

    .strength-fill.medium {
        width: 66%;
        background: var(--warning);
    }

    .strength-fill.strong {
        width: 100%;
        background: var(--success);
    }

.strength-text {
    font-size: 12px;
    color: var(--text-light);
    display: block;
}

    .strength-text.weak {
        color: var(--error);
    }

    .strength-text.medium {
        color: var(--warning);
    }

    .strength-text.strong {
        color: var(--success);
    }

.terms-container {
    margin-bottom: 25px;
}

    .terms-container .checkbox-label {
        font-size: 13px;
        line-height: 1.6;
    }

.terms-link {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-normal);
}

    .terms-link:hover {
        color: var(--accent-orange);
        text-decoration: underline;
    }

/* ============================================
   PÁGINA DE REDEFINIR SENHA
============================================ */

.info-box {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(91, 75, 138, 0.1));
    border-left: 4px solid var(--accent-blue);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

    .info-box i {
        color: var(--accent-blue);
        font-size: 20px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .info-box p {
        color: var(--text-secondary);
        font-size: 14px;
        line-height: 1.6;
        margin: 0;
    }

/* ============================================
   MENSAGEM DE REDIRECIONAMENTO
============================================ */

.redirect-message {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(46, 204, 113, 0.1));
    border-left: 4px solid var(--success);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInUp 0.5s ease;
}

    .redirect-message i {
        color: var(--success);
        font-size: 24px;
    }

    .redirect-message p {
        color: var(--text-secondary);
        font-size: 14px;
        margin: 0;
        font-weight: 500;
    }

/* ============================================
   ESTADOS DE ERRO
============================================ */

.input-field.error {
    border-color: var(--error) !important;
    background: rgba(220, 53, 69, 0.05);
}

    .input-field.error:focus {
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
    }

/* ============================================
   RODAPÉ
============================================ */

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

    .login-footer p {
        color: var(--text-secondary);
        font-size: 15px;
        margin-bottom: 12px;
    }

.register-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-purple);
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 30px;
    border: 2px solid var(--primary-purple);
    border-radius: 12px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

    .register-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 100%;
        background: var(--primary-purple);
        transition: width var(--transition-normal);
        z-index: -1;
    }

    .register-link:hover::before {
        width: 100%;
    }

    .register-link:hover {
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(91, 75, 138, 0.3);
    }

/* ============================================
   TOAST DE NOTIFICAÇÃO
============================================ */

.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    padding: 18px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all var(--transition-normal);
}

    .toast.show {
        transform: translateX(0);
        opacity: 1;
    }

    .toast.success {
        border-left: 4px solid var(--success);
    }

    .toast.error {
        border-left: 4px solid var(--error);
    }

    .toast.warning {
        border-left: 4px solid var(--warning);
    }

    .toast.info {
        border-left: 4px solid var(--info);
    }

.toast-icon {
    font-size: 24px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

/* ============================================
   RESPONSIVO
============================================ */

@media (max-width: 768px) {
    .login-container {
        padding: 15px;
    }

    .login-card {
        padding: 35px 25px;
        border-radius: 25px;
    }

    .logo {
        max-width: 220px;
    }

    .login-title {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .input-field {
        padding: 16px 18px 16px 50px;
        font-size: 15px;
    }

    .input-icon {
        left: 18px;
        font-size: 16px;
    }

    .toggle-password {
        right: 18px;
        font-size: 16px;
    }

    .btn-login {
        padding: 16px 25px;
        font-size: 16px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .social-login {
        grid-template-columns: 1fr;
    }

    .toast {
        top: 20px;
        right: 20px;
        left: 20px;
        transform: translateY(-200px);
    }

        .toast.show {
            transform: translateY(0);
        }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }

    .logo {
        max-width: 180px;
    }

    .login-title {
        font-size: 22px;
    }

    .register-link {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   ANIMAÇÕES EXTRAS
============================================ */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.input-field.error {
    border-color: var(--error);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}
