/* ========================================
   ESTILOS COMPLETOS Y MEJORADOS PARA EL LOGIN
   ======================================== */

/* 1. VARIABLES DE COLOR */
:root {
    --color-primary: #ff7300;
    --color-primary-dark: #cc5c00;
    --color-text-light: #ffffff;
    --color-text-gray: #918f8f;
    --color-danger: #e74c3c;
    --color-secondary: #1a1a1a;
}

/* 2. RESET Y ESTILOS DE FONDO (BODY) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comfortaa', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;

    /* FONDO OSCURO Y ANIMADO */
    background: linear-gradient(-45deg, #000000, #1a0a00, #000000, #2c1200);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 3. TARJETA DE LOGIN MEJORADA */
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid rgba(255, 115, 0, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    
    /* Sombra y resplandor más pronunciados */
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        0 0 25px 0 rgba(255, 115, 0, 0.25);
    
    text-align: center;
    color: var(--color-text-light);
    
    /* Animación de entrada */
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    animation: popIn 0.6s 0.2s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 4. LOGO */
.logo-container {
    margin-bottom: 20px;
}

.logo-container img {
    width: 120px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 15px rgba(255, 115, 0, 0.6));
}

/* 5. TÍTULOS Y PÁRRAFOS */
.login-card h2 {
    font-size: 28px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ff8c00 0%, #ffae42 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card p {
    color: var(--color-text-gray);
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.5;
}

/* 6. ESTILOS DE FORMULARIO */
.form-group {
    position: relative;
    margin-bottom: 25px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-gray);
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 115, 0, 0.3);
    border-radius: 10px;
    color: var(--color-text-light);
    font-size: 16px;
    font-family: 'Comfortaa', sans-serif;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: var(--color-text-gray);
}

.form-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(255, 115, 0, 0.4);
}

.form-input:focus ~ .input-icon {
    color: var(--color-primary);
}

/* 7. CONTENEDOR DE BOTONES */
#button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

/* 8. BOTÓN DE INGRESAR (PRIMARIO) */
.btn-login {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    font-family: 'Comfortaa', sans-serif;

    /* Gradiente naranja y sombra */
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    box-shadow: 0 5px 20px rgba(255, 115, 0, 0.3);
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 115, 0, 0.5);
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: translateY(0);
}

/* 9. BOTÓN DE REGISTRARSE (SECUNDARIO) - NUEVO DISEÑO */
.btn-register-switch {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Comfortaa', sans-serif;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;

    /* Estilo con borde y fondo transparente */
    background: rgba(255, 115, 0, 0.1);
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

/* Efecto de brillo al pasar el mouse */
.btn-register-switch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 115, 0, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-register-switch:hover::before {
    left: 100%;
}

.btn-register-switch:hover {
    background: rgba(255, 115, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 115, 0, 0.3);
}

.btn-register-switch:active {
    transform: translateY(0);
}

/* Icono opcional dentro del botón */
.btn-register-switch i {
    margin-right: 8px;
}

/* 12. MENSAJES DE ERROR */
#error-message {
    color: var(--color-danger);
    margin-top: 20px;
    min-height: 20px;
    font-weight: 500;
    font-size: 14px;
}

/* 13. LINK DE RECUPERAR CONTRASEÑA */
.forgot-password-link a {
    color: var(--color-text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password-link a:hover {
    color: var(--color-primary);
}

.forgot-password-link i {
    margin-right: 5px;
}

/* 14. ANIMACIÓN SHAKE PARA ERRORES */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s;
}

/* 15. CAMPOS DE REGISTRO (cuando están visibles) */
#register-fields {
    transition: all 0.3s ease;
}

#register-fields .form-group {
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 16. RESPONSIVE */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        max-width: 95%;
    }

    .login-card h2 {
        font-size: 24px;
    }

    .logo-container img {
        width: 100px;
    }

    .btn-login,
    .btn-register-switch {
        padding: 13px;
        font-size: 15px;
    }
}

/* 17. ESTADOS DE CARGA */
.btn-login.loading,
.btn-register-switch.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.btn-login.loading::after,
.btn-register-switch.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}