/* ===============================
   LOGIN CSS - DISEÑO MODERNO CON ANIMACIONES
   =============================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animación de fondo con burbujas flotantes */
body::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -250px;
    left: -250px;
    animation: flotar 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    bottom: -200px;
    right: -200px;
    animation: flotar 15s ease-in-out infinite reverse;
}

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

.contenedor-login {
    width: 100%;
    max-width: 450px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: aparecer 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 10;
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.encabezado-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo en el encabezado */
.encabezado-login::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: brillo 3s ease-in-out infinite;
}

@keyframes brillo {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.logo-login {
    width: 180px;
    height: auto;
    margin-bottom: 24px;
    filter: brightness(0) invert(1);
    animation: logo-entrada 0.8s ease-out;
    transition: transform 0.3s ease;
}

.logo-login:hover {
    transform: scale(1.05) rotate(2deg);
}

@keyframes logo-entrada {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.titulo-login {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    animation: texto-entrada 0.8s ease-out 0.2s both;
}

@keyframes texto-entrada {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitulo-login {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 400;
    animation: texto-entrada 0.8s ease-out 0.3s both;
}

.cuerpo-login {
    padding: 40px 30px;
}

.grupo-input {
    margin-bottom: 24px;
    animation: input-entrada 0.6s ease-out both;
}

.grupo-input:nth-child(1) {
    animation-delay: 0.4s;
}

.grupo-input:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes input-entrada {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.etiqueta-input {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.contenedor-input {
    position: relative;
    display: flex;
    align-items: center;
}

.icono-input {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 2;
}

.campo-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f9fafb;
}

.campo-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.campo-input:focus ~ .icono-input {
    color: #667eea;
    transform: scale(1.1);
}

.contenedor-password {
    position: relative;
}

.boton-toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 6px;
    z-index: 2;
}

.boton-toggle-password:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.contenedor-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    animation: input-entrada 0.6s ease-out 0.6s both;
}

.checkbox-personalizado {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-personalizado input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.marca-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    margin-right: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-personalizado:hover .marca-checkbox {
    border-color: #667eea;
    transform: scale(1.05);
}

.checkbox-personalizado input:checked ~ .marca-checkbox {
    background: #667eea;
    border-color: #667eea;
    transform: scale(1.1);
}

.marca-checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.checkbox-personalizado input:checked ~ .marca-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.texto-checkbox {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.enlace-olvidar {
    display: block;
    text-align: center;
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    animation: input-entrada 0.6s ease-out 0.7s both;
}

.enlace-olvidar:hover {
    color: #764ba2;
    text-decoration: underline;
    transform: translateY(-2px);
}

.boton-primario {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    animation: input-entrada 0.6s ease-out 0.8s both;
}

.boton-primario::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.boton-primario:hover::before {
    width: 300px;
    height: 300px;
}

.boton-primario:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.boton-primario:active {
    transform: translateY(-1px);
}

.separador {
    margin: 32px 0;
    text-align: center;
    position: relative;
    animation: input-entrada 0.6s ease-out 0.9s both;
}

.separador::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.texto-separador {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background: white;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.seccion-demo {
    text-align: center;
    animation: input-entrada 0.6s ease-out 1s both;
}

.titulo-demo {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    font-weight: 600;
}

.boton-demo {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

.boton-demo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.boton-demo:hover::before {
    width: 300px;
    height: 300px;
}

.boton-demo:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5);
}

.boton-demo:active {
    transform: translateY(-1px);
}

.badge-demo {
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    animation: pulso 2s ease-in-out infinite;
}

@keyframes pulso {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.nota-demo {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
    line-height: 1.5;
}

.mensaje-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.mensaje-error i {
    color: #dc2626;
    animation: rotar-icono 0.5s ease-in-out;
}

@keyframes rotar-icono {
    from {
        transform: rotate(0deg) scale(0);
    }
    to {
        transform: rotate(360deg) scale(1);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .contenedor-login {
        border-radius: 16px;
    }
    
    .encabezado-login {
        padding: 40px 20px;
    }
    
    .cuerpo-login {
        padding: 30px 20px;
    }
    
    .titulo-login {
        font-size: 26px;
    }
    
    .logo-login {
        width: 400px;
    }
}
