/* Pantalla de inicio de sesión */

.lg-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }

.lg-shell {
    width: min(980px, 100%);
    min-height: min(640px, calc(100vh - 40px));
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    border-radius: 24px;
    overflow: hidden;
    background: var(--color-panel);
    border: 1px solid rgba(159, 177, 200, 0.16);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

/* ---------- Panel de marca ---------- */
.lg-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background:
        radial-gradient(circle at 20% 0%, rgba(74, 161, 255, 0.35), transparent 55%),
        linear-gradient(160deg, #1d5fc0, #0f2a4a 70%);
}
.lg-brand > :not(.lg-collage) { position: relative; z-index: 2; }

/* Collage de fotos (carpeta frontend/img/collage) bajo un velo azul */
.lg-collage { position: absolute; inset: 0; z-index: 0; display: grid; gap: 3px; opacity: 0; transition: opacity 0.8s ease; }
.lg-brand.con-fotos .lg-collage { opacity: 1; }
.lg-brand.con-fotos::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background:
        linear-gradient(180deg, rgba(15, 42, 74, 0.88) 0%, rgba(29, 95, 192, 0.58) 45%, rgba(15, 42, 74, 0.92) 100%);
}
.lg-collage.n1 { grid-template: 1fr / 1fr; grid-template-areas: 't0'; }
.lg-collage.n2 { grid-template: 1fr 1fr / 1fr; grid-template-areas: 't0' 't1'; }
.lg-collage.n3 { grid-template: 1fr 1fr / 1.3fr 1fr; grid-template-areas: 't0 t1' 't0 t2'; }
.lg-collage.n4 { grid-template: 1fr 1fr / 1fr 1fr; grid-template-areas: 't0 t1' 't2 t3'; }
.lg-collage.n5 { grid-template: 1fr 1fr 1fr / 1.2fr 1fr; grid-template-areas: 't0 t1' 't0 t2' 't3 t4'; }
.lg-tile { position: relative; overflow: hidden; min-height: 0; min-width: 0; background: #0f2a4a; }
.lg-tile img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 1.4s ease;
}
.lg-tile img.visible { opacity: 1; animation: lg-zoom 14s ease-out forwards; }
@keyframes lg-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .lg-tile img.visible { animation: none; } }
.lg-brand-mark {
    width: 64px; height: 64px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
}
.lg-brand h1 { margin: 12px 0 0; font-size: 2rem; line-height: 1.1; }
.lg-tagline { margin: 0; color: rgba(237, 243, 251, 0.78); line-height: 1.5; max-width: 30ch; }
.lg-clock { margin-top: auto; }
.lg-time { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 2.6rem; letter-spacing: -0.04em; }
.lg-date { color: rgba(237, 243, 251, 0.72); }
.lg-date::first-letter { text-transform: uppercase; }

/* ---------- Panel de acceso ---------- */
.lg-panel { padding: 32px 40px; display: flex; flex-direction: column; min-width: 0; }
.lg-panel h2 { margin: 18px 0 4px; font-size: 1.6rem; }
.lg-sub { margin: 0 0 18px; color: var(--color-text-muted); }

.lg-steps { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; color: var(--color-text-muted); font-size: 0.85rem; font-weight: 600; }
.lg-steps li { display: flex; align-items: center; gap: 8px; }
.lg-steps li span {
    width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-panel-alt); font-size: 0.78rem;
}
.lg-steps li.activo { color: var(--color-text); }
.lg-steps li.activo span { background: var(--color-primary); }

.lg-error { color: var(--color-danger); min-height: 24px; font-weight: 600; text-align: center; margin: 6px 0; }
#restaurantesError { text-align: left; }

/* Restaurantes */
.lg-rest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lg-rest {
    display: flex; align-items: center; gap: 14px; text-align: left;
    min-height: 76px; padding: 12px 14px;
    background: var(--color-panel-alt);
    border: 1px solid rgba(159, 177, 200, 0.14);
    position: relative;
}
.lg-rest:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.lg-rest .lg-nombre { display: block; font-weight: 700; }
.lg-rest .lg-sucursal { display: block; font-size: 0.82rem; font-weight: 500; color: var(--color-text-muted); }
.lg-rest .lg-chevron { margin-left: auto; color: var(--color-text-muted); font-size: 1.4rem; }
.lg-rest .lg-ultimo {
    position: absolute; top: 8px; right: 10px;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--color-primary); background: rgba(47, 128, 237, 0.14); border-radius: 20px; padding: 2px 8px;
}
.lg-rest.reciente .lg-chevron { display: none; }

.lg-avatar {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
    font-family: 'Poppins', sans-serif; font-weight: 700; color: #fff;
}
.lg-avatar img { width: 100%; height: 100%; object-fit: contain; background: rgba(255, 255, 255, 0.06); }

.lg-skeleton {
    height: 76px; border-radius: var(--radius);
    background: linear-gradient(90deg, var(--color-panel-alt) 25%, var(--color-surface) 50%, var(--color-panel-alt) 75%);
    background-size: 200% 100%; animation: lg-brillo 1.3s infinite linear;
}
@keyframes lg-brillo { to { background-position: -200% 0; } }

/* PIN */
.lg-back { align-self: flex-start; min-height: 40px; padding: 8px 14px; margin-top: 14px; }
.lg-rest-chip { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.3rem; }
.lg-rest-chip .lg-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 0.95rem; }

.lg-dots { display: flex; justify-content: center; gap: 14px; min-height: 22px; margin: 6px 0 2px; }
.lg-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(159, 177, 200, 0.45); transition: background 0.12s, border-color 0.12s, transform 0.12s; }
.lg-dots i.lleno { background: var(--color-primary); border-color: var(--color-primary); transform: scale(1.1); }
.lg-dots.lg-shake { animation: lg-shake 0.4s; }
.lg-dots.lg-shake i { border-color: var(--color-danger); }
@keyframes lg-shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

.lg-pad { grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(320px, 100%); margin: 0 auto; }
.lg-pad button { width: 100%; height: 68px; border-radius: 18px; font-size: 1.5rem; background: var(--color-panel-alt); }
.lg-pad button:hover { background: var(--color-surface); }
.lg-pad .lg-key-aux { background: transparent; border: 1px solid rgba(159, 177, 200, 0.3); box-shadow: none; }
.lg-pad .lg-key-enter { font-size: 1rem; background: linear-gradient(135deg, var(--color-primary), #4aa1ff); }
.lg-pad.cargando { opacity: 0.6; pointer-events: none; }

.lg-help { margin: 18px 0 0; text-align: center; color: var(--color-text-muted); font-size: 0.82rem; }

/* ---------- Tablet / móvil ---------- */
@media (max-width: 800px) {
    .lg-body { padding: 0; align-items: stretch; }
    .lg-shell { grid-template-columns: 1fr; border-radius: 0; min-height: 100vh; border: none; }
    .lg-brand { padding: 22px 24px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; }
    .lg-brand-mark { width: 48px; height: 48px; border-radius: 14px; }
    .lg-brand h1 { margin: 0; font-size: 1.4rem; }
    .lg-tagline { display: none; }
    .lg-clock { margin: 0 0 0 auto; text-align: right; }
    .lg-time { font-size: 1.5rem; }
    .lg-date { font-size: 0.75rem; }
    .lg-panel { padding: 24px 20px; }
}

/* Pantallas bajas (tablet horizontal): teclado más compacto para que quepa sin scroll */
@media (max-height: 720px) {
    .lg-panel { padding-top: 20px; padding-bottom: 16px; }
    .lg-pad button { height: 54px; font-size: 1.3rem; }
    .lg-pad { gap: 9px; }
    .lg-sub { margin-bottom: 8px; }
    .lg-help { margin-top: 10px; }
    .lg-back { margin-top: 8px; min-height: 36px; }
}

.lg-brand.con-fotos > :not(.lg-collage) { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45); }

/* Recordar restaurante */
.lg-recordar {
    display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 12px 14px;
    background: var(--color-panel-alt); border: 1px solid rgba(159, 177, 200, 0.14); border-radius: var(--radius);
    cursor: pointer; font-weight: 600; font-size: 0.92rem;
}
.lg-recordar input {
    -webkit-appearance: checkbox; appearance: auto; background: none;
    flex: 0 0 auto; width: 20px; height: 20px; min-height: 0; padding: 0; margin: 2px 0 0; accent-color: var(--color-primary);
}
.lg-recordar small { display: block; margin-top: 2px; font-weight: 400; color: var(--color-text-muted); font-size: 0.8rem; }
.lg-fijado { margin: 14px 0 0; text-align: center; font-size: 0.82rem; color: var(--color-text-muted); }
.lg-fijado strong { color: var(--color-text); }
.lg-link { background: none; border: none; box-shadow: none; min-height: 0; padding: 0; font-size: inherit; font-weight: 600; color: var(--color-primary); text-decoration: underline; }
.lg-link:hover { box-shadow: none; }

.lg-admin-link { margin-top: auto; padding-top: 18px; align-self: center; font-size: 0.78rem; color: var(--color-text-muted); text-decoration: none; opacity: 0.7; }
.lg-admin-link:hover { opacity: 1; text-decoration: underline; }

.lg-brand h1 .lg-go { color: #9fd0ff; }
