/* ================================================================
   GymSoft — login.css
   Estilos del login. Los valores de --acento-* se inyectan
   desde PHP con los colores configurados en la BD.
   ================================================================ */

/* Variables del login (PHP las sobreescribe en <style> inline) */
:root {
    --acento:       #10B981;
    --acento-hover: #34d399;
    --acento-rgb:   16, 185, 129;
    --acento-10:    rgba(16, 185, 129, 0.10);
    --acento-20:    rgba(16, 185, 129, 0.20);
    --acento-25:    rgba(16, 185, 129, 0.25);
    --acento-40:    rgba(16, 185, 129, 0.40);
    --glow-color:   rgba(52,  211, 153, 0.40);

    --zinc-950:  #09090b;
    --zinc-900:  #18181b;
    --zinc-800:  #27272a;
    --zinc-700:  #3f3f46;
    --zinc-600:  #52525b;
    --zinc-500:  #71717a;
    --zinc-400:  #a1a1aa;
    --zinc-300:  #d4d4d8;
    --zinc-200:  #e4e4e7;
    --zinc-50:   #ecfdf5;
}

/* ── Wrapper principal ── */
.login-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 1rem;
    font-family: var(--font-body);
    overflow: hidden;
}

@media (min-width: 640px)  { .login-wrapper { padding: 2rem; } }
@media (min-width: 1024px) { .login-wrapper { padding: 4rem; } }

/* ── Fondo ── */
.login-fondo {
    position: absolute;
    inset: 0;
    background: var(--login-bg, url('https://images.unsplash.com/photo-1571019614242-c5c5dee9f50b?q=80&w=2070') center/cover no-repeat);
    transition: background 0.8s ease;
}

/* Sin overlay global — la imagen se ve completa.
   El oscurecimiento solo ocurre alrededor del formulario (.login-sombra). */

/* ── Contenedor de la tarjeta (alineación configurable) ── */
.login-contenedor {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    justify-content: var(--card-posicion, flex-end);
    animation: fadeIn 0.6s ease;
}

/* ── Wrapper de ancho limitado: confina la sombra al área del formulario ── */
.login-tarjeta-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
}

/* ── Sombra difuminada SOLO alrededor de la tarjeta ── */
.login-sombra {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    filter: blur(130px);
    transform: scale(1.6);
    border-radius: 4rem;
    pointer-events: none;
}

/* ── Tarjeta principal ── */
.login-tarjeta {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid rgba(63, 63, 70, 0.5);
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: fadeUp 0.5s ease 0.1s both;
}

/* Efecto de luz interna en la tarjeta */
.login-tarjeta::before {
    content: '';
    position: absolute;
    top: -6rem;
    right: -6rem;
    width: 12rem;
    height: 12rem;
    background: var(--acento-20);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

/* ── Header: logo + título ── */
.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.login-icono-logo {
    background: var(--acento-10);
    border: 1px solid rgba(var(--acento-rgb), 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(var(--acento-rgb), 0.15);
    color: var(--acento-hover);
}

.login-icono-logo svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-titulo {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #fff;
}

.login-titulo .gym-nombre-acento { color: var(--acento); }

.login-subtitulo {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--zinc-500);
    margin-top: 0.25rem;
}

/* ── Pestañas de método ── */
.login-tabs {
    display: flex;
    gap: 0.125rem;
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid rgba(39, 39, 42, 0.5);
    border-radius: 0.75rem;
    padding: 0.25rem;
    margin-bottom: 2rem;
}

.login-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.5rem;
    border-radius: 0.6rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--zinc-500);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}

.login-tab svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-tab:hover { color: var(--zinc-300); }

.login-tab.activo {
    background: var(--zinc-800);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.login-tab.activo.tab-bio { color: var(--acento-hover); }

/* ── Formulario de credenciales ── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: fadeIn 0.4s ease;
}

.login-campos { display: flex; flex-direction: column; gap: 1.25rem; }

/* Decoración lateral "tech" */
.login-deco-lateral {
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    bottom: 4rem;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(var(--acento-rgb), 0.2), transparent);
    pointer-events: none;
}

/* ── Input group ── */
.login-input-group {
    position: relative;
}

/* Aura neón en focus */
.login-input-aura {
    position: absolute;
    inset: -1px;
    background: linear-gradient(90deg, var(--acento), #06b6d4);
    border-radius: 0.8rem;
    opacity: 0;
    filter: blur(2px);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.login-input-group:focus-within .login-input-aura { opacity: 0.25; }

.login-input-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(9, 9, 11, 0.92);
    border: 1px solid var(--zinc-800);
    border-radius: 0.75rem;
    padding: 0.375rem;
    transition: border-color 0.3s ease;
    overflow: hidden;
}

.login-input-group:focus-within .login-input-inner {
    border-color: rgba(var(--acento-rgb), 0.5);
}

.login-input-icono {
    padding: 0.625rem;
    background: rgba(39, 39, 42, 0.5);
    border-radius: 0.5rem;
    transition: background 0.3s ease, color 0.3s ease;
    color: var(--zinc-500);
    flex-shrink: 0;
}

.login-input-icono svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.login-input-group:focus-within .login-input-icono {
    background: var(--acento-10);
    color: var(--acento-hover);
}

.login-input-inner input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.625rem 1rem;
    color: #ecfdf5;
    font-family: monospace;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
}

.login-input-inner input::placeholder { color: var(--zinc-600); }

/* Punto parpadeante de "encriptación" en campo password */
.login-encrypt-dot {
    position: absolute;
    right: 1rem;
    width: 6px;
    height: 6px;
    background: var(--acento);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: pulsar 1s infinite;
}

.login-input-group:focus-within .login-encrypt-dot { opacity: 1; }

/* Línea de progreso inferior */
.login-input-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: transparent;
    width: 100%;
}

.login-input-progress-bar {
    height: 100%;
    width: 0;
    background: var(--acento-hover);
    box-shadow: 0 0 10px var(--acento-hover);
    transition: width 1.2s ease-out;
}

.login-input-group:focus-within .login-input-progress-bar { width: 100%; }

/* ── Barras de datos decorativas ── */
.login-barras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4px;
    gap: 2px;
    opacity: 0.35;
    margin: 0.5rem 0.5rem 0;
}

.login-barras span {
    flex: 1;
    height: 100%;
    background: var(--acento);
    border-radius: 99px;
    animation: barrasDatos 0.8s ease-in-out infinite alternate;
}

/* Retrasos de animación para cada barra */
.login-barras span:nth-child(1)  { animation-delay: 0.00s; }
.login-barras span:nth-child(2)  { animation-delay: 0.07s; }
.login-barras span:nth-child(3)  { animation-delay: 0.14s; }
.login-barras span:nth-child(4)  { animation-delay: 0.21s; }
.login-barras span:nth-child(5)  { animation-delay: 0.28s; }
.login-barras span:nth-child(6)  { animation-delay: 0.35s; }
.login-barras span:nth-child(7)  { animation-delay: 0.42s; }
.login-barras span:nth-child(8)  { animation-delay: 0.49s; }
.login-barras span:nth-child(9)  { animation-delay: 0.56s; }
.login-barras span:nth-child(10) { animation-delay: 0.63s; }
.login-barras span:nth-child(11) { animation-delay: 0.70s; }
.login-barras span:nth-child(12) { animation-delay: 0.77s; }

/* ── Botón de login ── */
.login-btn-wrapper { padding-top: 1.5rem; margin-top: 1rem; }

.login-btn {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #fff;
    color: #000;
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
    cursor: pointer;
    border: none;
}

.login-btn:hover:not(:disabled) {
    background: var(--acento-hover);
    box-shadow: 0 0 25px rgba(var(--acento-rgb), 0.5);
    transform: translateY(-1px);
}

.login-btn:active { transform: translateY(0); }

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Shimmer sobre el botón */
.login-btn-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    transform: translateX(-100%) skewX(-12deg);
    pointer-events: none;
}

.login-btn:hover .login-btn-shimmer {
    animation: shimmer 1.4s ease-in-out infinite;
}

.login-btn-texto { position: relative; z-index: 1; }

.login-btn-icono {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.login-btn:hover:not(:disabled) .login-btn-icono { transform: translateX(3px); }
.login-btn-icono.spin { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Vista biométrica ── */
.login-bio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    animation: fadeIn 0.4s ease;
}

.login-bio.oculto { display: none; }

.login-huella-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.login-huella-anillo {
    position: absolute;
    inset: -4px;
    background: var(--acento-20);
    border-radius: 50%;
    filter: blur(20px);
    animation: pulsarAnillo 2s ease-in-out infinite;
    pointer-events: none;
}

.login-huella-circulo {
    position: relative;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    border: 1px solid rgba(var(--acento-rgb), 0.3);
    background: var(--zinc-950);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Línea de escaneo */
.login-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--acento-hover);
    box-shadow: 0 0 12px var(--acento-hover);
    animation: scanLine 2s ease-in-out infinite alternate;
}

.login-huella-svg {
    width: 4rem;
    height: 4rem;
    stroke: rgba(var(--acento-rgb), 0.8);
    fill: none;
    stroke-width: 1;
    stroke-linecap: round;
}

.login-bio-texto {
    color: var(--zinc-400);
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.login-bio-texto strong { color: var(--zinc-200); }

/* Indicadores de estado (conectividad) */
.login-bio-indicadores {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid rgba(39, 39, 42, 0.5);
}

.login-bio-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(24, 24, 27, 0.5);
    border: 1px solid var(--zinc-800);
    border-radius: 0.5rem;
    color: var(--zinc-400);
}

.login-bio-item svg {
    width: 14px;
    height: 14px;
    stroke: var(--acento);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-bio-item span:last-child {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Mensaje de error ── */
.login-error {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.35);
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    color: #fc8181;
    font-size: 0.8125rem;
    text-align: center;
    margin-bottom: 1.25rem;
    animation: shakeTarjeta 0.5s ease;
}

/* ── Barra de estado inferior ── */
.login-estado {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: monospace;
    font-size: 0.625rem;
    letter-spacing: 0.05em;
    color: var(--zinc-500);
}

.login-dot-wrapper {
    position: relative;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
}

.login-dot-ping {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--acento);
    opacity: 0.75;
    animation: ping 1.2s ease-in-out infinite;
}

.login-dot-inner {
    position: absolute;
    inset: 1px;
    border-radius: 50%;
    background: var(--acento);
}

.login-estado-texto { animation: pulsar 2.5s ease-in-out infinite; }
