/* Variables CSS */
:root {
    --nazarene-primary: #8B0000;
    --nazarene-secondary: #C5A572;
    --nazarene-accent: #4A4A4A;
    --nazarene-light: #F8F6F0;
    --nazarene-white: #FFFFFF;
    --nazarene-dark: #2C1810;
    --nazarene-gold: #D4AF37;
    --nazarene-burgundy: #722F37;
    --sidebar-width: 300px;
    --transition-speed: 0.4s;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--nazarene-light) 0%, var(--nazarene-secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* Contenedor principal */
.login-wrapper {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    animation: slideIn 0.8s ease-out;
}

.login-container {
    background: var(--nazarene-white);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(139, 0, 0, 0.15),
        0 10px 30px rgba(139, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--nazarene-primary), var(--nazarene-gold));
}

/* Logo y cabecera */
.church-logo {
    text-align: center;
    padding: 40px 30px 20px;
    background: linear-gradient(135deg, var(--nazarene-light), var(--nazarene-white));
    border-bottom: 1px solid rgba(139, 0, 0, 0.1);
}

.church-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(139, 0, 0, 0.2));
    transition: transform var(--transition-speed) ease;
}

.church-logo img:hover {
    transform: scale(1.05);
}

.church-logo h1 {
    color: var(--nazarene-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.church-logo p {
    color: var(--nazarene-accent);
    font-size: 16px;
    font-weight: 400;
}

/* Formulario */
.login-form {
    padding: 30px;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

/* Wrapper de inputs */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Iconos de input */
.input-icon {
    position: absolute;
    left: 15px;
    color: var(--nazarene-secondary);
    font-size: 16px;
    z-index: 2;
    transition: color var(--transition-speed) ease;
}

/* Inputs */
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 18px 20px 18px 50px;
    border: 2px solid rgba(139, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    background: var(--nazarene-white);
    color: var(--nazarene-dark);
    transition: all var(--transition-speed) ease;
    outline: none;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: var(--nazarene-primary);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
    transform: translateY(-2px);
}

.login-form input[type="text"]:focus ~ .floating-label,
.login-form input[type="password"]:focus ~ .floating-label,
.login-form input[type="text"]:not(:placeholder-shown) ~ .floating-label,
.login-form input[type="password"]:not(:placeholder-shown) ~ .floating-label {
    transform: translateY(-35px) scale(0.85);
    color: var(--nazarene-primary);
}

.login-form input[type="text"]:focus ~ .input-icon,
.login-form input[type="password"]:focus ~ .input-icon {
    color: var(--nazarene-primary);
}

/* Etiquetas flotantes */
.floating-label {
    position: absolute;
    left: 50px;
    top: 18px;
    color: var(--nazarene-accent);
    font-size: 16px;
    pointer-events: none;
    transition: all var(--transition-speed) ease;
    background: var(--nazarene-white);
    padding: 0 5px;
}

/* Botón de mostrar/ocultar contraseña */
.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--nazarene-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color var(--transition-speed) ease;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--nazarene-primary);
}

/* Checkbox personalizado */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
}

.form-check input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--nazarene-accent);
    user-select: none;
    transition: color var(--transition-speed) ease;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 0, 0, 0.3);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-check input:checked ~ .checkbox-label .checkmark {
    background: var(--nazarene-primary);
    border-color: var(--nazarene-primary);
}

.form-check input:checked ~ .checkbox-label .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--nazarene-white);
    font-size: 12px;
}

.form-check input:checked ~ .checkbox-label {
    color: var(--nazarene-primary);
}

/* Botón principal */
.btn {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--nazarene-primary), var(--nazarene-burgundy));
    color: var(--nazarene-white);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(139, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Estados del botón */
.btn-text,
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Enlaces */
.login-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(139, 0, 0, 0.1);
}

.forgot-password {
    color: var(--nazarene-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.forgot-password:hover {
    color: var(--nazarene-primary);
    background: rgba(139, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Alertas de error */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.field-error {
    margin-top: 8px;
    color: #dc3545;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Responsive */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 15px;
        max-width: 100%;
    }
    
    .login-container {
        border-radius: 15px;
    }
    
    .church-logo {
        padding: 30px 20px 15px;
    }
    
    .church-logo h1 {
        font-size: 24px;
    }
    
    .login-form {
        padding: 25px 20px;
    }
    
    .login-form input[type="text"],
    .login-form input[type="password"] {
        padding: 16px 18px 16px 45px;
        font-size: 15px;
    }
    
    .floating-label {
        left: 45px;
        top: 16px;
        font-size: 15px;
    }
    
    .input-icon {
        left: 12px;
        font-size: 15px;
    }
}

@media (max-width: 320px) {
    .church-logo img {
        width: 60px;
        height: 60px;
    }
    
    .church-logo h1 {
        font-size: 20px;
    }
    
    .login-form {
        padding: 20px 15px;
    }
}