/* static/css/login.css - Diseño Moderno Azul y Blanco */

:root {
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

body {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #0ea5e9 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* Efecto de partículas de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    max-width: 950px;
    width: 100%;
    animation: slideInScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Panel Izquierdo */
.login-left {
    background: var(--primary-gradient);
    color: white;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.03) 0px,
        rgba(255, 255, 255, 0.03) 2px,
        transparent 2px,
        transparent 4px
    );
    animation: float 30s linear infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg); 
    }
    25% {
        transform: translate(-10px, -10px) rotate(90deg);
    }
    50% { 
        transform: translate(-20px, 0) rotate(180deg); 
    }
    75% {
        transform: translate(-10px, 10px) rotate(270deg);
    }
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.login-logo {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.login-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    opacity: 0.98;
    position: relative;
    z-index: 2;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.login-subtitle {
    font-size: 1.125rem;
    opacity: 0.85;
    line-height: 1.7;
    position: relative;
    z-index: 2;
    max-width: 350px;
}

/* Panel Derecho - Formulario */
.login-right {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.login-form-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-form-subtitle {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 400;
}

/* Formulario */
.form-floating {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-floating > .form-control {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    height: 62px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
    padding: 1rem 1rem 1rem 3rem;
}

.form-floating > .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: white;
}

.form-floating > label {
    color: #6b7280;
    font-weight: 500;
    padding-left: 3rem;
    font-size: 0.9375rem;
}

.form-floating > label i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.125rem;
}

.form-floating > .form-control:focus ~ label i {
    color: #2563eb;
}

/* Input icon */
.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 5;
    font-size: 1.125rem;
}

.password-toggle {
    cursor: pointer;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #2563eb;
}

/* Checkbox personalizado */
.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-check-label {
    margin-left: 0.5rem;
    color: #4b5563;
    font-size: 0.9375rem;
    cursor: pointer;
}

/* Botón de login */
.btn-login {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1.0625rem;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.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.6s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    color: white;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Alertas */
.alert-custom {
    border-radius: 12px;
    border: none;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-custom i {
    margin-right: 0.5rem;
}

/* Footer del login */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: #6b7280;
    font-size: 0.9375rem;
}

.login-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animaciones de entrada */
.form-floating {
    animation: fadeInUp 0.6s ease-out backwards;
}

.form-floating:nth-child(1) { animation-delay: 0.1s; }
.form-floating:nth-child(2) { animation-delay: 0.2s; }
.btn-login { 
    animation: fadeInUp 0.6s ease-out 0.3s backwards; 
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 991px) {
    .login-left {
        padding: 50px 40px;
    }
    
    .login-right {
        padding: 50px 40px;
    }
    
    .login-logo {
        font-size: 3.5rem;
    }
    
    .login-title {
        font-size: 2.25rem;
    }
    
    .login-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 767px) {
    .login-card {
        margin: 20px;
        border-radius: 20px;
    }
    
    .login-left {
        padding: 40px 30px;
    }
    
    .login-right {
        padding: 40px 30px;
    }
    
    .login-logo {
        font-size: 3rem;
    }
    
    .login-title {
        font-size: 2rem;
    }
    
    .login-subtitle {
        font-size: 0.9375rem;
    }
    
    .login-form-title {
        font-size: 1.875rem;
    }
    
    .form-floating > .form-control {
        height: 58px;
        font-size: 0.9375rem;
    }
    
    .btn-login {
        font-size: 1rem;
        padding: 0.875rem;
    }
}

@media (max-width: 575px) {
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        margin: 10px;
        border-radius: 16px;
    }
    
    .login-left {
        padding: 30px 20px;
    }
    
    .login-right {
        padding: 30px 20px;
    }
    
    .login-logo {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .login-title {
        font-size: 1.75rem;
    }
    
    .login-subtitle {
        font-size: 0.875rem;
    }
    
    .login-form-title {
        font-size: 1.625rem;
    }
    
    .login-form-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }
    
    .form-floating {
        margin-bottom: 1.25rem;
    }
    
    .form-floating > .form-control {
        height: 56px;
        font-size: 0.875rem;
        padding: 1rem 0.875rem 1rem 2.75rem;
    }
    
    .form-floating > label {
        font-size: 0.875rem;
        padding-left: 2.75rem;
    }
    
    .form-floating > label i {
        font-size: 1rem;
        left: 0.875rem;
    }
    
    .input-icon {
        right: 0.875rem;
        font-size: 1rem;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn-login:focus-visible,
.form-control:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Estados de hover mejorados */
.form-control:hover:not(:focus) {
    border-color: #d1d5db;
    background: #f3f4f6;
}

/* Mejoras visuales */
::selection {
    background-color: rgba(37, 99, 235, 0.2);
    color: #1f2937;
}