﻿/**`n * =====================================================`n * ESTILOS MEJORADOS PARA LOGIN`n * =====================================================`n */

/* ===================================
   FONDO ANIMADO
   =================================== */

#back {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
}

/* Partículas flotantes */
#back::before,
#back::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0.3;
}

#back::before {
    background-image: radial-gradient(circle, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    animation: particlesFloat 20s linear infinite;
}

#back::after {
    background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: particlesFloat 15s linear infinite reverse;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes particlesFloat {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-50px) translateX(50px); }
}

/* ===================================
   CONTENEDOR DEL LOGIN
   =================================== */

.login-box {
    width: 420px;
    margin: 5% auto;
    position: relative;
    z-index: 1;
    animation: slideInDown 0.6s ease-out;
}

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

/* ===================================
   LOGO Y TÍTULO
   =================================== */

.login-logo {
    margin-bottom: 30px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.login-logo b {
    color: white;
    font-size: 42px;
    font-weight: 800;
    text-shadow: 
        0 2px 10px rgba(0,0,0,0.3),
        0 0 30px rgba(255,255,255,0.3);
    letter-spacing: 2px;
    display: block;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 
            0 2px 10px rgba(0,0,0,0.3),
            0 0 30px rgba(255,255,255,0.3);
    }
    to {
        text-shadow: 
            0 2px 10px rgba(0,0,0,0.3),
            0 0 40px rgba(255,255,255,0.5),
            0 0 50px rgba(255,255,255,0.3);
    }
}

.login-logo::after {
    content: '🏍️';
    display: block;
    font-size: 60px;
    margin-top: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===================================
   CAJA DEL FORMULARIO
   =================================== */

.login-box-body {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 25px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.1) inset;
    border: 2px solid rgba(255,255,255,0.2);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   MENSAJE DE BIENVENIDA
   =================================== */

.login-box-msg {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

/* ===================================
   FORMULARIO
   =================================== */

.login-box-body .form-group {
    margin-bottom: 25px;
    position: relative;
}

/* Labels */
.login-box-body label {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* Inputs */
.login-box-body .form-control {
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 14px 45px 14px 15px;
    font-size: 15px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.login-box-body .form-control:focus {
    border-color: #667eea;
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.2),
        0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-2px);
}

/* Select especial */
.login-box-body select.form-control,
.login-box-body .select-sucursal {
    height: 48px !important;
    line-height: 48px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-color: #ffffff !important;
    padding: 0 45px 0 15px !important;
    cursor: pointer !important;
    color: #333333 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-indent: 0 !important;
    opacity: 1 !important;
}

.login-box-body select.form-control option,
.login-box-body .select-sucursal option {
    color: #333333 !important;
    background-color: #ffffff !important;
    padding: 10px !important;
    font-weight: normal !important;
}

.login-box-body select.form-control option:checked,
.login-box-body .select-sucursal option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    background-color: #667eea !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.login-box-body select.form-control option[disabled],
.login-box-body .select-sucursal option[disabled] {
    color: #999999 !important;
    background-color: #f5f5f5 !important;
    font-style: italic !important;
}

/* Iconos de feedback */
.login-box-body .form-control-feedback {
    color: #667eea;
    font-size: 18px;
    line-height: 48px;
    transition: all 0.3s ease;
}

.login-box-body .has-feedback .form-control:focus ~ .form-control-feedback {
    color: #764ba2;
    transform: scale(1.1);
}

/* ===================================
   BOTÓN DE INGRESO
   =================================== */

.login-box-body .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    padding: 14px 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.4),
        0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100% !important;
}

.login-box-body .btn-primary::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: all 0.5s ease;
}

.login-box-body .btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.5),
        0 4px 8px rgba(0,0,0,0.15);
}

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

.login-box-body .btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.4),
        0 2px 4px rgba(0,0,0,0.1);
}

.login-box-body .row {
    margin-bottom: 0;
}

.login-box-body .row .col-xs-4 {
    width: 100%;
}

/* ===================================
   SEPARADOR Y DEMO
   =================================== */

.login-box-body hr {
    border-color: #e8e8e8;
    margin: 25px 0 20px 0;
}

.login-box-body .text-muted {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 0;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.login-box-body .text-muted strong {
    color: #667eea;
    font-weight: 700;
}

/* ===================================
   MENSAJES DE ERROR/ÉXITO
   =================================== */

.login-box-body .alert {
    border-radius: 12px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-box-body .alert-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.login-box-body .alert-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

/* ===================================
   LOADING SPINNER
   =================================== */

.login-box-body .btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login-box-body .btn-primary.loading::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 480px) {
    .login-box {
        width: 95%;
        margin: 10% auto;
    }
    
    .login-logo b {
        font-size: 32px;
    }
    
    .login-logo::after {
        font-size: 50px;
    }
    
    .login-box-body {
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .login-box-body .form-control {
        padding: 12px 40px 12px 12px;
        font-size: 14px;
    }
    
    .login-box-body .btn-primary {
        padding: 12px 0;
        font-size: 14px;
    }
}

/* ===================================
   ANIMACIÓN DE ENTRADA DE INPUTS
   =================================== */

.login-box-body .form-group {
    animation: fadeInUp 0.6s ease-out backwards;
}

.login-box-body .form-group:nth-child(1) { animation-delay: 0.1s; }
.login-box-body .form-group:nth-child(2) { animation-delay: 0.2s; }
.login-box-body .form-group:nth-child(3) { animation-delay: 0.3s; }
.login-box-body .row { animation: fadeInUp 0.6s ease-out 0.4s backwards; }

/* ===================================
   EFECTOS ADICIONALES
   =================================== */

/* Brillo sutil en el borde del formulario */
@keyframes borderGlow {
    0%, 100% {
        box-shadow: 
            0 20px 60px rgba(0,0,0,0.3),
            0 0 0 1px rgba(255,255,255,0.1) inset;
    }
    50% {
        box-shadow: 
            0 20px 60px rgba(0,0,0,0.3),
            0 0 0 1px rgba(255,255,255,0.2) inset,
            0 0 30px rgba(102, 126, 234, 0.2);
    }
}

.login-box-body {
    animation: fadeInUp 0.8s ease-out, borderGlow 3s ease-in-out infinite;
}
