:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #66BB6A;
    --secondary-color: #2196F3;
    --accent-color: #00BCD4;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

* {
    box-sizing: border-box;
}

.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Patrón de fondo animado */
.auth-bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.1) 35px, rgba(255,255,255,.1) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(255,255,255,.05) 35px, rgba(255,255,255,.05) 70px);
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(70px, 70px); }
}

/* Tarjeta principal con efecto glassmorphism */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    overflow: hidden;
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.auth-card.animate-in {
    transform: translateY(0);
    opacity: 1;
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Brand section */
.auth-brand {
    text-align: center;
    padding: 40px 30px 30px;
    background: var(--gradient-success);
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    transform: rotate(-10deg);
    transition: transform 0.3s ease;
}

.auth-card:hover .brand-icon {
    transform: rotate(0deg);
}

.brand-name {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -1px;
}

.brand-tagline {
    font-size: 14px;
    opacity: 0.9;
    margin: 5px 0 0;
    font-weight: 400;
}

/* Form container */
.auth-form-container {
    padding: 40px 40px 30px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 30px;
}

/* Form inputs mejorados */
.form-floating {
    position: relative;
}

.custom-input {
    height: 56px;
    border: 2px solid transparent;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    padding-left: 45px;
}

.custom-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.form-floating label {
    padding-left: 45px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-floating label i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.custom-input:focus ~ label i {
    color: var(--primary-color);
}

/* Password toggle button */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

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

/* Custom checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox .form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.custom-checkbox .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-checkbox .form-check-label {
    margin-left: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Botón de login mejorado */
.btn-login {
    width: 100%;
    height: 56px;
    background: var(--gradient-success);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

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

.btn-icon {
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
    transform: translateX(5px);
}

/* Footer links */
.auth-footer-links {
    text-align: center;
    margin-top: 20px;
}

.link-forgot {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.link-forgot:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Card footer */
.auth-card-footer {
    padding: 20px;
    background: var(--bg-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-text {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.footer-text i {
    color: var(--primary-color);
}

/* Formas flotantes animadas */
.floating-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation: float1 20s infinite ease-in-out;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation: float2 15s infinite ease-in-out;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
    animation: float3 25s infinite ease-in-out;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 50px) scale(1.1); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -50px) scale(0.9); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Mensajes de alerta mejorados */
.alert {
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary-color);
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* Responsive design */
@media (max-width: 480px) {
    .auth-card {
        margin: 20px;
    }
    
    .auth-form-container {
        padding: 30px 20px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .brand-name {
        font-size: 28px;
    }
    
    .shape-1 {
        width: 200px;
        height: 200px;
    }
    
    .shape-2 {
        width: 150px;
        height: 150px;
    }
    
    .shape-3 {
        width: 100px;
        height: 100px;
    }
}

/* Loading animation */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login.loading .btn-text {
    visibility: hidden;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px 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); }
}

/* Mejoras de accesibilidad */
.form-control:focus-visible,
.btn-login:focus-visible,
.link-forgot:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Soporte para modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f8f9fa;
        --text-secondary: #adb5bd;
        --bg-primary: #212529;
        --bg-secondary: #343a40;
        --border-color: #495057;
    }
    
    .auth-card {
        background: rgba(33, 37, 41, 0.95);
    }
    
    .custom-input {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    
}