/* assets/css/login.css - VERSIÓN MEJORADA */
:root {
    --color-fondo: #0f2027;
    --gradiente-espacio: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --blanco: #ffffff;
    --neon-azul: #00d2ff;
    --neon-rosa: #ff0099;
    --neon-verde: #00ff88;
    --sombra-neon: 0 0 20px rgba(0, 210, 255, 0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradiente-espacio);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    color: var(--blanco);
    padding: 20px;
}

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

/* Partículas de fondo (estrellas) */
body::before {
    content: "";
    position: fixed;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(white 1px, transparent 2px),
        radial-gradient(white 1px, transparent 2px);
    background-size: 50px 50px, 30px 30px;
    background-position: 0 0, 25px 25px;
    opacity: 0.3;
    animation: moverEstrellas 100s linear infinite;
    z-index: -1;
    top: 0;
    left: 0;
}

@keyframes moverEstrellas {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

.contenedor-login {
    width: 100%;
    max-width: 450px;
    perspective: 1000px;
}

.tarjeta {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 40px 35px;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
    text-align: center;
    display: none;
    animation: flotar 6s ease-in-out infinite;
}

.tarjeta.activa {
    display: block;
    animation: aparecer 0.5s ease-out forwards, flotar 6s ease-in-out infinite 0.5s;
}

h1 {
    font-size: 2em;
    text-shadow: 0 0 20px var(--neon-azul), 0 0 40px var(--neon-azul);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

h2 {
    font-size: 1.7em;
    text-shadow: 0 0 15px var(--neon-rosa);
    margin-bottom: 10px;
}

.tarjeta > p {
    opacity: 0.9;
    margin-bottom: 25px;
    font-size: 1.05em;
    line-height: 1.5;
}

/* Inputs mejorados */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    margin: 8px 0;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    background: rgba(255,255,255,0.95);
    font-size: 1.05em;
    outline: none;
    transition: all 0.3s ease;
    color: #1e293b;
    font-weight: 500;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--neon-azul);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4), 0 0 40px rgba(0, 210, 255, 0.2);
    transform: scale(1.02);
    background: #fff;
}

/* Botones 3D mejorados */
button.btn-accion {
    width: 100%;
    padding: 18px 30px;
    margin-top: 25px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 50%, #667eea 100%);
    background-size: 200% 200%;
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 
        0 6px 0 #1a5276,
        0 8px 25px rgba(0, 210, 255, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

button.btn-accion::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;
}

button.btn-accion:hover {
    background-position: 100% 0;
    transform: translateY(-3px);
    box-shadow: 
        0 9px 0 #1a5276,
        0 12px 35px rgba(0, 210, 255, 0.5);
}

button.btn-accion:hover::before {
    left: 100%;
}

button.btn-accion:active {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #1a5276,
        0 4px 15px rgba(0, 210, 255, 0.3);
}

/* Selector de Avatar mejorado */
.tarjeta > p:last-of-type {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1em;
}

.grid-avatares {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.avatar-opcion {
    position: relative;
}

.avatar-opcion input {
    display: none;
}

.avatar-opcion label {
    font-size: 2.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(0.8) brightness(0.8);
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    border: 3px solid transparent;
}

.avatar-opcion label:hover {
    filter: grayscale(0.3) brightness(1);
    transform: scale(1.1);
    background: rgba(255,255,255,0.2);
}

.avatar-opcion input:checked + label {
    transform: scale(1.2);
    filter: grayscale(0) brightness(1);
    background: rgba(255,255,255,0.3);
    border-color: var(--neon-verde);
    box-shadow: 
        0 0 20px var(--neon-verde),
        0 0 40px rgba(0, 255, 136, 0.3);
    animation: avatarSeleccionado 0.5s ease;
}

@keyframes avatarSeleccionado {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1.2) rotate(0deg); }
}

/* Link texto */
.link-texto {
    color: var(--neon-azul);
    cursor: pointer;
    margin-top: 20px;
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.link-texto::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--neon-azul);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.link-texto:hover {
    background: rgba(0, 210, 255, 0.1);
    text-shadow: 0 0 10px var(--neon-azul);
}

.link-texto:hover::after {
    width: 80%;
}

/* Animaciones */
@keyframes flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

/* Logo/Título especial para la tarjeta de login */
#card-login h1 {
    background: linear-gradient(135deg, #00d2ff, #fff, #ff0099);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .contenedor-login {
        width: 95%;
    }
    
    .tarjeta {
        padding: 30px 25px;
        border-radius: 25px;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    h2 {
        font-size: 1.4em;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        padding: 14px 18px;
        font-size: 1em;
    }
    
    button.btn-accion {
        padding: 16px 25px;
        font-size: 1.1em;
    }
    
    .grid-avatares {
        gap: 10px;
    }
    
    .avatar-opcion label {
        width: 55px;
        height: 55px;
        font-size: 2.2em;
    }
}

/* Efecto de carga */
.tarjeta.cargando {
    pointer-events: none;
    opacity: 0.7;
}

.tarjeta.cargando button.btn-accion {
    background: #94a3b8;
    box-shadow: 0 4px 0 #64748b;
}

/* Mensaje de error/éxito */
.mensaje-feedback {
    padding: 12px 20px;
    border-radius: 15px;
    margin: 15px 0;
    font-weight: 600;
    animation: aparecer 0.3s ease;
}

.mensaje-feedback.error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #fecaca;
}

.mensaje-feedback.exito {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid #22c55e;
    color: #bbf7d0;
}

/* ============================================
   ESTILOS PARA LOGIN SIMPLE (login_simple_view)
   ============================================ */

.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
}

.login-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 40px 35px;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
    animation: aparecer 0.5s ease-out forwards;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Icono grande de bienvenida */
.login-icon-grande {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s ease infinite;
}

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

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #00d2ff, #fff, #ff0099);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

.login-header p {
    opacity: 0.9;
    font-size: 1em;
}

/* Iconos de labels más grandes */
.label-icon {
    font-size: 1.3rem;
    margin-right: 0.3rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95em;
    color: rgba(255,255,255,0.9);
}

.login-form .form-group label span {
    margin-right: 5px;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    background: rgba(255,255,255,0.95);
    font-size: 1.05em;
    outline: none;
    transition: all 0.3s ease;
    color: #1e293b;
    font-weight: 500;
}

.login-form input:focus {
    border-color: var(--neon-azul);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4), 0 0 40px rgba(0, 210, 255, 0.2);
    transform: scale(1.02);
}

/* Botón Login Mejorado */
.btn-login {
    width: 100%;
    padding: 18px 30px;
    margin-top: 10px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 50%, #667eea 100%);
    background-size: 200% 200%;
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 
        0 6px 0 #1a5276,
        0 8px 25px rgba(0, 210, 255, 0.4);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.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.5s ease;
}

.btn-login:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-3px);
    box-shadow: 
        0 9px 0 #1a5276,
        0 12px 35px rgba(0, 210, 255, 0.5);
}

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

.btn-login:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #1a5276,
        0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: 0 4px 0 #475569;
}

.btn-login .btn-text,
.btn-login .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Mensaje de respuesta */
.mensaje {
    padding: 12px 20px;
    border-radius: 15px;
    margin-top: 15px;
    font-weight: 600;
    text-align: center;
    animation: aparecer 0.3s ease;
    display: none;
}

.mensaje.success {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid #22c55e;
    color: #bbf7d0;
    display: block;
}

.mensaje.error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #fecaca;
    display: block;
}

/* Footer del login */
.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.login-footer p {
    color: rgba(255,255,255,0.8);
}

.login-footer a {
    color: var(--neon-azul);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-footer a:hover {
    text-shadow: 0 0 10px var(--neon-azul);
}

/* Botón Volver */
.btn-volver {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.btn-volver:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(-5px);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

/* Responsive para login simple */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 25px;
    }
    
    .login-header h1 {
        font-size: 1.5em;
    }
    
    .btn-login {
        padding: 16px 25px;
        font-size: 1.1em;
    }
}
