/* ==========================================================================
   LOGIN — Luxury Glassmorphism & Fast Tactile PIN Engine
   Proyecto: Catálogo Táctil POS Interno
   Responsabilidad: SOLO apariencia premium de la pantalla de acceso táctil.
   Última actualización: 2026-08-23
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* --- Fondo Ambiental con Orbes Neón Brillantes --- */
.login-ambient-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    animation: orbFloat 14s ease-in-out infinite alternate;
}
.orb-1 {
    width: 480px;
    height: 480px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    top: -10%;
    left: -10%;
}
.orb-2 {
    width: 420px;
    height: 420px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}
.orb-3 {
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    top: 40%;
    left: 60%;
    animation-delay: -9s;
}
@keyframes orbFloat {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, -40px) scale(1.08); }
    100% { transform: translate(-30px, 30px) scale(0.95); }
}

/* --- Contenedor Principal --- */
.login-page {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
}

/* --- Tarjeta Glassmorphism Ultra-Lujo --- */
.login-card {
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 32px 30px 28px;
    width: 410px;
    max-width: 95vw;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    animation: cardEntrance 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(24px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Header / Logo --- */
.login-card__logo {
    text-align: center;
    margin-bottom: 22px;
}
.login-logo-badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.35));
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}
.logo-emoji {
    font-size: 26px;
}
.login-card__logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 21px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}
.login-card__logo p {
    font-size: 12.5px;
    color: #94a3b8;
    font-weight: 500;
}

/* --- Selector de Roles (Tarjetas Táctiles de Perfil) --- */
.login-role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.login-role-card {
    position: relative;
    background: rgba(15, 23, 42, 0.45);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}
.login-role-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Estado Activo */
.login-role-card.active {
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.28), rgba(79, 70, 229, 0.45));
    border-color: #818cf8;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.02);
}

/* Iconos de Rol */
.role-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 250ms;
}
.vendor-box {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.4);
}
.admin-box {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.login-role-card.active .vendor-box {
    background: #6366f1;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}
.login-role-card.active .admin-box {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.role-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.role-name {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}
.role-desc {
    font-size: 10.5px;
    color: #94a3b8;
    font-weight: 600;
}
.login-role-card.active .role-desc {
    color: #e0e7ff;
}

/* Check flotante */
.role-check-indicator {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.5);
}
.login-role-card.active .role-check-indicator {
    display: flex;
    animation: checkPop 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes checkPop {
    0%   { transform: scale(0); }
    100% { transform: scale(1); }
}

/* --- PIN Display Section --- */
.login-pin-wrapper {
    margin-bottom: 18px;
    text-align: center;
}
.login-pin-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}
.pin-display {
    display: flex;
    justify-content: center;
    gap: 14px;
}
.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pin-dot.filled {
    background: #ffffff;
    border-color: #ffffff;
    transform: scale(1.25);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.9),
                0 0 25px rgba(99, 102, 241, 0.6);
}
.pin-dot.error {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.8) !important;
    animation: pinShake 350ms ease-in-out;
}
@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* --- Keypad Numérico Glassmorphism --- */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}
.keypad-btn {
    height: 52px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 120ms ease-out;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.keypad-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}
.keypad-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.28);
}
.keypad-btn.empty {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: default;
}
.keypad-btn.delete {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.keypad-btn.delete:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
}

/* --- Botón Ingresar --- */
.login-submit {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.4);
    transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}
.login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5);
    filter: brightness(1.08);
}
.login-submit:active:not(:disabled) {
    transform: scale(0.96);
}
.login-submit:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.35);
    box-shadow: none;
    cursor: not-allowed;
}

/* --- Mensaje de Error --- */
.login-error {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #fca5a5;
    min-height: 18px;
    transition: all 200ms;
}
