/* ============================================
   🎨 BYD LOTTERY - LOGIN MODERNO Y PROFESIONAL
   ============================================ */

/* 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, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* ============================================
   ANIMACIÓN DE FONDO CON FORMAS GEOMÉTRICAS
   ============================================ */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0.1;
    border-radius: 50%;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -150px;
    left: -150px;
    animation: float 20s infinite ease-in-out;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    bottom: -100px;
    right: -100px;
    animation: float 15s infinite ease-in-out reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    top: 50%;
    right: 10%;
    animation: float 18s infinite ease-in-out;
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    bottom: 20%;
    left: 10%;
    animation: float 22s infinite ease-in-out reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

/* ============================================
   CONTENEDOR DEL LOGIN
   ============================================ */
.login-container {
    width: 100%;
    max-width: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ============================================
   CAJA DEL LOGIN
   ============================================ */
.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 50px 40px;
    width: 100%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo sutil en la caja */
.login-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ============================================
   HEADER DEL LOGIN (Logo y Títulos)
   ============================================ */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.4),
        0 0 0 8px rgba(102, 126, 234, 0.1);
    animation: pulse 2s infinite;
}

.logo-circle i {
    font-size: 36px;
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 10px 30px rgba(102, 126, 234, 0.4),
            0 0 0 8px rgba(102, 126, 234, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 15px 40px rgba(102, 126, 234, 0.6),
            0 0 0 12px rgba(102, 126, 234, 0.15);
    }
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* ============================================
   FORMULARIO
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

/* Wrapper de inputs con iconos */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: #999;
    font-size: 18px;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Inputs del formulario */
.form-input {
    width: 100%;
    padding: 16px 18px 16px 52px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background-color: #f8f9fa;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input::placeholder {
    color: #aaa;
}

.form-input:focus {
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input:focus + .toggle-password,
.input-wrapper:focus-within .input-icon {
    color: #667eea;
}

/* Botón para mostrar/ocultar contraseña */
.toggle-password {
    position: absolute;
    right: 18px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    transition: all 0.3s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: #667eea;
}

/* ============================================
   BOTÓN DE ENTRAR
   ============================================ */
.btn-entrar {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-entrar::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.5s ease;
}

.btn-entrar:hover::before {
    left: 100%;
}

.btn-entrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.btn-entrar:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-entrar i {
    transition: transform 0.3s ease;
}

.btn-entrar:hover i {
    transform: translateX(4px);
}

/* ============================================
   FOOTER DEL LOGIN
   ============================================ */
.login-footer {
    margin-top: 30px;
    text-align: center;
}

.footer-text {
    font-size: 13px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-text i {
    color: #667eea;
}

/* ============================================
   ANIMACIÓN DE ENTRADA
   ============================================ */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE - MÓVILES
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .login-box {
        padding: 40px 30px;
        border-radius: 20px;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .logo-circle i {
        font-size: 32px;
    }

    .login-title {
        font-size: 28px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .form-input {
        padding: 14px 16px 14px 48px;
        font-size: 14px;
    }

    .input-icon {
        left: 16px;
        font-size: 16px;
    }

    .toggle-password {
        right: 16px;
        font-size: 16px;
    }

    .btn-entrar {
        padding: 14px 20px;
        font-size: 15px;
    }

    .shape-1, .shape-2, .shape-3, .shape-4 {
        width: 150px;
        height: 150px;
    }
}

/* ============================================
   TABLETS
   ============================================ */
@media (min-width: 481px) and (max-width: 768px) {
    .login-box {
        padding: 45px 35px;
    }
}

/* ============================================
   ALERTAS Y MENSAJES
   ============================================ */
.alert-error,
.alert-success {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: slideInDown 0.4s ease-out;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-error i {
    color: #c33;
    font-size: 18px;
}

.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.alert-success i {
    color: #3c3;
    font-size: 18px;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input con error */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fee !important;
}

.input-error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

/* ============================================
   MEJORAS DE ACCESIBILIDAD
   ============================================ */
.form-input:focus,
.btn-entrar:focus,
.toggle-password:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
