/* ===========================
   RESET BÁSICO
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   FONDO GENERAL
   =========================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(-45deg, #003b8e, #0052cc, #667eea, #764ba2);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ===========================
   CONTENEDOR PRINCIPAL
   =========================== */
.login-wrapper {
    display: flex;
    width: 900px;
    height: 550px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-in-out;
}

/* Animación de entrada */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* ===========================
   PANEL IZQUIERDO (AZUL)
   =========================== */
.login-left {
    flex: 1;
    background: linear-gradient(135deg, #003b8e 0%, #0052cc 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px;
    overflow: hidden;
}

/* ===========================
   LÍNEAS ANIMADAS DE FONDO
   =========================== */
.animated-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.line {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50px;
}

.line:nth-child(1) {
    width: 350px;
    height: 2px;
    top: 15%;
    left: -350px;
    animation: floatLine1 16s infinite linear;
}

.line:nth-child(2) {
    width: 250px;
    height: 2px;
    top: 35%;
    left: -250px;
    animation: floatLine2 13s infinite linear 2s;
}

.line:nth-child(3) {
    width: 300px;
    height: 2px;
    top: 55%;
    left: -300px;
    animation: floatLine3 18s infinite linear 4s;
}

.line:nth-child(4) {
    width: 200px;
    height: 2px;
    top: 75%;
    left: -200px;
    animation: floatLine4 15s infinite linear 6s;
}

.line:nth-child(5) {
    width: 280px;
    height: 2px;
    top: 90%;
    left: -280px;
    animation: floatLine5 14s infinite linear 3s;
}

@keyframes floatLine1 {
    0% { 
        left: -350px; 
        transform: translateY(0) rotate(0deg); 
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% { 
        left: 100%; 
        transform: translateY(-60px) rotate(12deg); 
        opacity: 0;
    }
}

@keyframes floatLine2 {
    0% { 
        left: -250px; 
        transform: translateY(0) rotate(0deg); 
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% { 
        left: 100%; 
        transform: translateY(40px) rotate(-10deg); 
        opacity: 0;
    }
}

@keyframes floatLine3 {
    0% { 
        left: -300px; 
        transform: translateY(0) rotate(0deg); 
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% { 
        left: 100%; 
        transform: translateY(-30px) rotate(8deg); 
        opacity: 0;
    }
}

@keyframes floatLine4 {
    0% { 
        left: -200px; 
        transform: translateY(0) rotate(0deg); 
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% { 
        left: 100%; 
        transform: translateY(50px) rotate(-15deg); 
        opacity: 0;
    }
}

@keyframes floatLine5 {
    0% { 
        left: -280px; 
        transform: translateY(0) rotate(0deg); 
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% { 
        left: 100%; 
        transform: translateY(-20px) rotate(6deg); 
        opacity: 0;
    }
}

/* ===========================
   PARTÍCULAS FLOTANTES
   =========================== */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.particle:nth-child(1) {
    width: 10px;
    height: 10px;
    top: 20%;
    left: 15%;
    animation: float 18s infinite ease-in-out;
}

.particle:nth-child(2) {
    width: 7px;
    height: 7px;
    top: 50%;
    left: 25%;
    animation: float 20s infinite ease-in-out 2s;
}

.particle:nth-child(3) {
    width: 12px;
    height: 12px;
    top: 70%;
    left: 70%;
    animation: float 22s infinite ease-in-out 4s;
}

.particle:nth-child(4) {
    width: 8px;
    height: 8px;
    top: 35%;
    left: 80%;
    animation: float 19s infinite ease-in-out 1s;
}

.particle:nth-child(5) {
    width: 9px;
    height: 9px;
    top: 85%;
    left: 45%;
    animation: float 21s infinite ease-in-out 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-40px) translateX(20px) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) translateX(-15px) scale(0.9);
        opacity: 0.6;
    }
    75% {
        transform: translateY(-50px) translateX(25px) scale(1.05);
        opacity: 0.9;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===========================
   LOGO E INFORMACIÓN
   =========================== */
.logo-container {
    text-align: center;
    z-index: 2;
    position: relative;
}

.logo-img {
    width: 300px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

.logo-img:hover {
    animation-play-state: paused;
    transform: scale(1.08);
    transition: transform 0.3s ease;
}

/* ===========================
   PANEL DERECHO (BLANCO)
   =========================== */
.login-right {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
}

.login-right h2 {
    color: #003b8e;
    font-weight: 700;
    margin-bottom: 35px;
    font-size: 28px;
    text-align: center;
    position: relative;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-right h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #003b8e, #0052cc);
    border-radius: 2px;
}

/* ===========================
   FORMULARIO DE LOGIN
   =========================== */
.login-form .input-group {
    position: relative;
    margin-bottom: 25px;
    animation: slideInRight 0.6s ease-out backwards;
}

.login-form .input-group:nth-child(1) {
    animation-delay: 0.2s;
}

.login-form .input-group:nth-child(2) {
    animation-delay: 0.3s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.input-group input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus {
    border-color: #0052cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.3), 0 0 0 6px rgba(0, 59, 142, 0.1);
    background: #fff;
    animation: borderGlow 2s ease-in-out infinite;
}

.input-group input:focus + .input-icon {
    color: #0052cc;
    transform: translateY(-50%) scale(1.1);
}

@keyframes borderGlow {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.3), 0 0 0 6px rgba(0, 59, 142, 0.1);
        border-color: #0052cc;
    }
    25% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.4), 0 0 0 8px rgba(118, 75, 162, 0.15);
        border-color: #667eea;
    }
    50% {
        box-shadow: 0 0 0 5px rgba(0, 82, 204, 0.5), 0 0 0 10px rgba(0, 59, 142, 0.2);
        border-color: #003b8e;
    }
    75% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.4), 0 0 0 8px rgba(118, 75, 162, 0.15);
        border-color: #667eea;
    }
}

/* ===========================
   ÍCONOS DENTRO DE INPUTS (Bootstrap Icons)
   =========================== */
.input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    font-size: 18px;
    color: #888;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* ===========================
   BOTÓN DE INGRESO
   =========================== */
.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #003b8e 0%, #0052cc 100%);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    animation: slideInRight 0.6s ease-out 0.4s backwards;
}

.btn-login i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 59, 142, 0.3);
}

.btn-login:hover i {
    transform: translateX(5px);
}

.btn-login:active {
    transform: translateY(0);
}

/* Efecto de brillo en el botón */
.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::before {
    left: 100%;
}

/* Efecto ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===========================
   MENSAJE DE ERROR
   =========================== */
.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    color: #842029;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #f5c2c7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: shake 0.5s ease, slideDown 0.5s ease;
    box-shadow: 0 4px 10px rgba(132, 32, 41, 0.1);
}

.alert-error i {
    font-size: 18px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
}

/* ===========================
   RESPONSIVO
   =========================== */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        width: 90%;
        height: auto;
        max-width: 450px;
    }

    .login-left, .login-right {
        flex: none;
        width: 100%;
    }

    .login-left {
        border-radius: 20px 20px 0 0;
        padding: 50px 20px;
        min-height: 250px;
    }

    .login-right {
        border-radius: 0 0 20px 20px;
        padding: 40px 30px;
    }

    .login-right h2 {
        font-size: 24px;
    }

    .logo-img {
        width: 220px;
    }

    .animated-lines,
    .particles {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        width: 95%;
    }

    .login-right {
        padding: 30px 20px;
    }

    .logo-img {
        width: 180px;
    }
}