/* ===== VARIABLES CSS (heredadas del sistema) ===== */
:root {
    --primary-color: #08276b;
    --secondary-color: #102c68;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --transition: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #90caf9 0%, #e3f2fd 30%, #ffffff 70%, #b3e5fc 100%);
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 3px 3px, rgba(52, 152, 219, 0.2) 2px, transparent 0);
    background-size: 60px 60px;
    animation: slide 30s linear infinite;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

/* ===== CONTENEDOR PRINCIPAL LOGIN ===== */
.login-wrapper {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.login-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER LOGIN ===== */
.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

.login-logo {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 400;
}

/* ===== CONTENIDO LOGIN ===== */
.login-content {
    padding: 40px 30px;
}

/* ===== FORMULARIO ===== */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-label i {
    color: var(--accent-color);
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-family: var(--font-family);
    background: var(--white);
    transition: var(--transition);
    min-height: 48px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input.error {
    border-color: var(--danger-color);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ===== PASSWORD FIELD ===== */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 18px;
}

.password-toggle:hover {
    color: var(--accent-color);
    background: rgba(52, 152, 219, 0.1);
}

/* ===== REMEMBER ME & FORGOT PASSWORD ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.remember-me label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
}

.forgot-password {
    font-size: 14px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    min-height: 48px;
    text-decoration: none;
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== SPINNER ===== */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading .spinner {
    display: block;
}

.loading .btn-text {
    display: none;
}

/* ===== MENSAJES DE ERROR ===== */
.error-message {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-message i {
    font-size: 14px;
}

/* ===== ALERTAS ===== */
.alert {
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d5f4e6;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert i {
    font-size: 18px;
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
}

/* ===== FOOTER LOGIN ===== */
.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .login-wrapper {
        max-width: 100%;
    }

    .login-header {
        padding: 30px 25px;
    }

    .login-logo {
        font-size: 28px;
    }

    .login-content {
        padding: 30px 25px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .login-header {
        padding: 25px 20px;
    }

    .login-logo {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .login-content {
        padding: 25px 20px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
}