/*
los estilos del login
*/

:root {
    --morado_principal: #6a11cb;
    --morado_secundario: #8f94fb;
    --azul_principal: #2575fc;
    --blanco_puro: #ffffff;

    --fondo_cristal: rgba(255, 255, 255, 0.1);
    --borde_cristal: rgba(255, 255, 255, 0.2);

    --borde_focus: rgba(255, 255, 255, 0.9);
    --sombra_suave: 0 10px 20px rgba(0,0,0,0.15);
    --sombra_fuerte: 0 15px 25px rgba(0,0,0,0.25);
}

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

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(-45deg, var(--morado_principal), var(--morado_secundario), var(--azul_principal), #4a00e0);
    background-size: 400% 400%;
    animation: fondo_animado 15s ease infinite;
    color: var(--blanco_puro);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

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

/*
  1) Fondo de iconos flotantes
*/
#animacion_fondo {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
}

#animacion_fondo ul { width: 100%; height: 100%; position: relative; list-style: none; }

#animacion_fondo li {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.1);
    animation: animar_iconos 25s linear infinite;
    bottom: -150px;
}

#animacion_fondo li:nth-child(1) { left: 15%; font-size: 80px; animation-delay: 0s; }
#animacion_fondo li:nth-child(2) { left: 85%; font-size: 40px; animation-delay: 2s; animation-duration: 12s; }
#animacion_fondo li:nth-child(3) { left: 50%; font-size: 60px; animation-delay: 4s; }
#animacion_fondo li:nth-child(4) { left: 25%; font-size: 100px; animation-delay: 0s; animation-duration: 18s; }
#animacion_fondo li:nth-child(5) { left: 75%; font-size: 50px; animation-delay: 0s; }

@keyframes animar_iconos {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-1200px) rotate(720deg); opacity: 0; }
}

/*
  2) Contenedor principal (glassmorphism)
*/
#contenedor_app {
    width: 100%;
    max-width: 450px;
    min-height: 100vh;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid var(--borde_cristal);
    border-right: 1px solid var(--borde_cristal);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0,0,0,0.2);
}

/*
  3) Barra superior
*/
#navegacion_superior {
    padding: 20px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: transparent;
    z-index: 10;
}

#btn_volver {
    color: var(--blanco_puro);
    font-size: 1.5rem;
    text-decoration: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0.95;
}

#btn_volver:hover { transform: translateY(-2px) scale(1.05); opacity: 1; }

#btn_volver:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
    border-radius: 10px;
}

#btn_volver:active { transform: translateY(0) scale(0.98); }

/*
  4) Contenido del login
*/
#contenido_login {
    flex: 1;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;

    /* Entrada suave */
    opacity: 0;
    transform: translateY(24px);
    animation: aparecer_contenido 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes aparecer_contenido {
    to { opacity: 1; transform: translateY(0); }
}

#cabecera_titulos { text-align: left; margin-bottom: 24px; }

#logo_acceso { width: 56px; height: 56px; margin-bottom: 10px; opacity: 0.92; }

#titulo_principal {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#subtitulo_principal {
    font-size: 1rem;
    opacity: 0.82;
    margin-bottom: 8px;
    font-weight: 300;
}

/*
  5) Inputs con iconos
*/
#grupo_correo,
#grupo_clave {
    position: relative;
    margin-bottom: 18px;
}

#icono_correo,
#icono_clave {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 1.2rem;
    z-index: 5;
}

#entrada_correo,
#entrada_clave {
    width: 100%;
    background: var(--fondo_cristal);
    border: 1px solid var(--borde_cristal);
    color: var(--blanco_puro);
    border-radius: 15px;
    padding: 15px 48px 15px 45px;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}

#entrada_correo::placeholder,
#entrada_clave::placeholder {
    color: rgba(255,255,255,0.6);
}

#entrada_correo:focus,
#entrada_clave:focus {
    background: rgba(255,255,255,0.2);
    border-color: var(--blanco_puro);
    box-shadow: 0 0 20px rgba(255,255,255,0.18);
    outline: none;
    transform: translateY(-1px);
}

/* Botón ojo (es button real para accesibilidad) */
#btn_alternar_clave {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 12px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 6;
}

#btn_alternar_clave:hover {
    background: rgba(255,255,255,0.12);
    color: var(--blanco_puro);
    transform: translateY(-50%) scale(1.05);
}

#btn_alternar_clave:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 3px;
}

#btn_alternar_clave:active {
    transform: translateY(-50%) scale(0.98);
}

/*
  6) Recuperación y botón principal
*/
#caja_recuperacion {
    text-align: right;
    margin-top: -6px;
    margin-bottom: 18px;
}

#enlace_olvido {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

#enlace_olvido:hover {
    color: var(--blanco_puro);
    text-decoration: underline;
}

#enlace_olvido:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
    border-radius: 10px;
}

/* Botón submit */
#btn_ingresar {
    width: 100%;
    border-radius: 50px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    background: var(--blanco_puro);
    color: var(--morado_principal);
    box-shadow: var(--sombra_suave);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    font-family: inherit;
}

#btn_ingresar:hover {
    transform: translateY(-3px);
    box-shadow: var(--sombra_fuerte);
    background-color: #f8f9fa;
}

#btn_ingresar:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
}

#btn_ingresar:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

/* Mensaje estado */
#mensaje_estado {
    margin-top: 12px;
    min-height: 20px;
    font-size: 0.9rem;
    opacity: 0.92;
}

/*
  7) Separador social
*/
#separador_social {
    display: flex;
    align-items: center;
    margin: 1.8rem 0 1.2rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

#separador_social::before,
#separador_social::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#separador_social::before { margin-right: 15px; }
#separador_social::after { margin-left: 15px; }

/*
  8) Botones sociales
*/
#redes_sociales {
    display: flex;
    justify-content: center;
    gap: 20px;
}

#btn_google,
#btn_apple,
#btn_facebook {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--blanco_puro);
    text-decoration: none;
    transition: transform 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease, color 0.35s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#btn_google:hover,
#btn_apple:hover,
#btn_facebook:hover {
    background: var(--blanco_puro);
    transform: translateY(-6px) rotate(360deg);
    box-shadow: 0 10px 20px rgba(255,255,255,0.3);
}

#btn_google:hover { color: #db4437; }
#btn_apple:hover { color: #000000; }
#btn_facebook:hover { color: #4267B2; }

#btn_google:focus-visible,
#btn_apple:focus-visible,
#btn_facebook:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
}

/*
  9) Pie: registro + enlaces del sitio (para evaluador)
*/
#pie_registro {
    text-align: center;
    margin-top: 22px;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.82);
}

#enlace_nuevo {
    color: var(--blanco_puro);
    font-weight: 900;
    text-decoration: none;
    margin-left: 5px;
    transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}

#enlace_nuevo:hover { text-decoration: underline; }

#enlace_nuevo:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
    border-radius: 10px;
}

/* Links extra del sitio (discretos, no rompen el diseño) */
#enlaces_sitio {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    opacity: 0.9;
}

#enlaces_sitio a {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.22);
    padding: 7px 12px;
    border-radius: 999px;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

#enlaces_sitio a:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
    transform: translateY(-2px);
}

#enlaces_sitio a:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
    border-radius: 999px;
}

#enlaces_sitio a:active { transform: translateY(0); }

/*
  10) Responsividad extra
*/
@media (max-width: 360px) {
    #contenido_login { padding: 18px 18px; }
    #titulo_principal { font-size: 2.1rem; }
}

@media (max-width: 640px) {
    #contenedor_app { max-width: 480px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #contenedor_app { max-width: 520px; }
}

/* Accesibilidad: reduce motion */
@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
    #animacion_fondo li { animation: none; opacity: 0.12; }
    #contenido_login { animation: none; opacity: 1; transform: none; }
}