/* oCloc — Sistema de logueo de la página del tenant (M1).
   Control de cuenta (Entrar / avatar) en hero + topbar, modal de login
   (email-first: cliente OTP / staff password) y drawer (burger). Vanilla,
   reutiliza los tokens de ocloc-tenant.css (cargado antes). */

/* ── Contenedores de acciones (derecha del header) ───────────────────────────── */
.otp-hero__actions,
.otp-topbar__actions { display: flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.otp-topbar__actions { gap: 8px; }

/* ── Control de cuenta ───────────────────────────────────────────────────────── */
.otp-acct { display: flex; align-items: center; }
.otp-acct__entrar {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: .82rem;
  color: #fff; padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 3px 12px rgba(0,0,0,.28); transition: transform .15s ease, background .2s ease;
}
.otp-acct__entrar:hover { transform: translateY(-2px); background: rgba(255,255,255,.30); }
.otp-acct__avatar {
  appearance: none; cursor: pointer; padding: 0; width: 37px; height: 37px; border-radius: 50%;
  position: relative;
  font: inherit; font-weight: 800; font-size: .82rem; color: #fff;
  border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.20);
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 3px 12px rgba(0,0,0,.30); transition: transform .15s ease;
}
/* Igual que .otp-soc: el avatar dibuja 37px (32 en la topbar) pero la zona sensible llega a 44+.
   Es el ÚNICO acceso a la cuenta desde el móvil, así que fallarlo cuesta caro. */
.otp-acct__avatar::before { content: ""; position: absolute; inset: -6px -4px; }
.otp-acct__avatar:hover { transform: translateY(-2px); }
.otp-topbar__actions .otp-acct__entrar { padding: 6px 14px; font-size: .8rem; }
.otp-topbar__actions .otp-acct__avatar { width: 32px; height: 32px; font-size: .78rem; }
.otp-acct[hidden], .otp-acct__avatar[hidden] { display: none; }

/* ── Modal de login (sheet en móvil, card centrada en desktop) ────────────────── */
.otp-acctmodal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.otp-acctmodal[hidden] { display: none; }
@media (min-width: 560px) { .otp-acctmodal { align-items: center; } }
.otp-acctmodal__backdrop { position: absolute; inset: 0; background: rgba(8,18,32,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.otp-acctmodal__sheet {
  position: relative; z-index: 1; width: 100%; max-width: 420px; background: #fbf8f7; color: #1f2a37;
  border-radius: 22px 22px 0 0; padding: 26px 22px 30px; box-shadow: 0 -10px 40px rgba(0,0,0,.4);
  animation: otp-sheet-up .3s cubic-bezier(.22,1,.36,1);
}
@media (min-width: 560px) { .otp-acctmodal__sheet { border-radius: 22px; animation: otp-sheet-pop .25s ease; } }
@keyframes otp-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes otp-sheet-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.otp-acctmodal__x {
  position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.06); color: #5b6b7d; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.otp-acctmodal__title { margin: 2px 0 4px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.otp-acctmodal__sub { margin: 0 0 16px; color: #5b6b7d; font-size: .92rem; }
.otp-acctstep[hidden] { display: none; }

.otp-fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.otp-fld span { font-size: .82rem; font-weight: 600; color: #46566a; }
.otp-fld input,
.otp-codeinput { font: inherit; border: 1.5px solid #e0dcd9; border-radius: 12px; background: #fff; color: #1f2a37; }
.otp-fld input { font-size: 1rem; padding: 12px 14px; }
.otp-fld input:focus,
.otp-codeinput:focus { outline: none; border-color: var(--otp-blue, #1c5193); box-shadow: 0 0 0 3px rgba(28,81,147,.14); }
.otp-codeinput { width: 100%; font-size: 1.6rem; font-weight: 700; letter-spacing: .5em; text-align: center; padding: 14px; margin-bottom: 12px; }

.otp-btn { display: block; width: 100%; font: inherit; font-weight: 700; font-size: .98rem; padding: 13px; border: none; border-radius: 12px; cursor: pointer; }
.otp-btn--primary { background: var(--otp-blue, #1c5193); color: #fff; transition: background .2s ease, transform .12s ease; }
.otp-btn--primary:hover { background: #16447e; }
.otp-btn--primary:active { transform: scale(.99); }
.otp-btn[disabled] { opacity: .55; cursor: default; }
.otp-acctlink { display: block; width: 100%; margin-top: 12px; background: none; border: none; cursor: pointer;
  color: var(--otp-blue, #1c5193); font: inherit; font-size: .88rem; font-weight: 600; text-align: center; }
.otp-acctlink--back { color: #7a8a9b; margin-top: 14px; }
.otp-accterr { margin: -4px 0 12px; color: #c0392b; font-size: .85rem; }
.otp-accterr[hidden] { display: none; }

/* ── Acceso con Google (parte inferior del paso de login) ─────────────────────── */
.otp-acctgoog { margin-top: 18px; }
.otp-acctgoog[hidden] { display: none; }
.otp-acctor { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; color: #9aa7b5;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.otp-acctor::before, .otp-acctor::after { content: ""; flex: 1; height: 1px; background: #e7e2de; }
.otp-acctgoogbtn {
  display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%;
  font: inherit; font-weight: 700; font-size: .95rem; color: #2b3645; padding: 12px 14px;
  background: #fff; border: 1.5px solid #e6e2df; border-radius: 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: background .18s ease, border-color .18s ease, box-shadow .2s ease, transform .12s ease;
}
.otp-acctgoogbtn:hover { background: #fbfbfb; border-color: #d6d0cb; box-shadow: 0 6px 18px rgba(16,24,40,.12); transform: translateY(-1px); }
.otp-acctgoogbtn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.otp-acctgoogbtn:focus-visible { outline: none; border-color: var(--otp-blue, #1c5193); box-shadow: 0 0 0 3px rgba(28,81,147,.16); }
.otp-acctgoogbtn__g { width: 18px; height: 18px; flex: 0 0 auto; }

/* ── Drawer (burger, desliza por la derecha) ─────────────────────────────────── */
.otp-drawer { position: fixed; inset: 0; z-index: 1000; }
.otp-drawer[hidden] { display: none; }
.otp-drawer__backdrop { position: absolute; inset: 0; background: rgba(8,18,32,.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.otp-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); background: #fbf8f7; color: #1f2a37;
  box-shadow: -12px 0 40px rgba(0,0,0,.4); padding: 22px 20px; display: flex; flex-direction: column; overflow-y: auto;
  animation: otp-drawer-in .28s cubic-bezier(.22,1,.36,1);
}
@keyframes otp-drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.otp-drawer__x {
  position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.06); color: #5b6b7d; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.otp-drawer__head { display: flex; align-items: center; gap: 12px; padding: 6px 0 18px; margin-bottom: 8px; border-bottom: 1px solid #ece8e5; }
.otp-drawer__avatar { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: var(--otp-blue, #1c5193); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; }
.otp-drawer__who { display: flex; flex-direction: column; min-width: 0; }
.otp-drawer__who strong { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otp-drawer__who small { color: #7a8a9b; font-size: .82rem; }
.otp-drawer__nav { display: flex; flex-direction: column; gap: 4px; }
.otp-drawer__nav[hidden] { display: none; }   /* el display:flex pisa el [hidden] de UA → reponer */
.otp-drawer__item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; font-size: .98rem; font-weight: 600;
  color: #1f2a37; background: none; border: none; border-radius: 12px; padding: 13px 12px; cursor: pointer; transition: background .15s ease; }
.otp-drawer__item:hover { background: rgba(28,81,147,.08); }
.otp-drawer__item[hidden] { display: none; }
.otp-drawer__ic { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: rgba(28,81,147,.12); color: var(--otp-blue, #1c5193);
  display: flex; align-items: center; justify-content: center; }
.otp-drawer__ic svg { width: 17px; height: 17px; }
.otp-drawer__item--logout { margin-top: 8px; color: #c0392b; justify-content: flex-start; padding-left: 12px; }
.otp-drawer__item--logout:hover { background: rgba(192,57,43,.08); }
.otp-drawer__group { padding: 12px 12px 4px; }
.otp-drawer__group[hidden] { display: none; }
.otp-drawer__grouphead { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #9aa7b5; margin-bottom: 8px; }
.otp-drawer__other { display: flex; flex-direction: column; gap: 8px; }
.otp-drawer__othermuted { color: #9aa7b5; font-size: .88rem; font-style: italic; }
.otp-otht { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; background: rgba(28,81,147,.06); border-radius: 10px; }
.otp-otht strong { font-size: .9rem; font-weight: 700; }
.otp-otht span { font-size: .8rem; color: #5b6b7d; }
.otp-drawer__otheritem { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; padding: 8px 10px; background: rgba(28,81,147,.06); border-radius: 10px; }

/* ── Vista "Mis reservas y compras" (sub-panel del drawer) ───────────────────── */
.otp-drawer__view { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.otp-drawer__view[hidden] { display: none; }
.otp-drawer__viewtitle { margin: 2px 0 6px; font-size: 1.05rem; font-weight: 700; }
.otp-drawer__list { display: flex; flex-direction: column; gap: 8px; }
.otp-bk { display: flex; flex-direction: column; gap: 2px; padding: 11px 12px; background: rgba(28,81,147,.06); border-radius: 12px; }
.otp-bk strong { font-size: .95rem; font-weight: 700; }
.otp-bk__when { font-size: .85rem; color: #5b6b7d; }
.otp-bk__status { font-size: .78rem; font-weight: 600; color: var(--otp-blue, #1c5193); }

/* Control de acceso (módulo oculto): botón «Ver QR de acceso» + panel EN LÍNEA (sin fetch). */
.otp-bk__qrbtn {
  align-self: flex-start; margin-top: 4px; appearance: none; cursor: pointer; font: inherit;
  font-size: .78rem; font-weight: 600; color: var(--otp-blue, #1c5193); background: none; border: none; padding: 0;
}
.otp-bk__qrbtn:hover { text-decoration: underline; }
.otp-bk__qrpanel { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; padding: 12px; background: #fff; border-radius: 10px; }
.otp-bk__qrpanel[hidden] { display: none; }
.otp-bk__qrpanel svg { width: 160px; height: 160px; }
.otp-bk__qrhint { margin: 0; font-size: .78rem; color: #5b6b7d; text-align: center; }

/* ── Toast minimal ───────────────────────────────────────────────────────────── */
.otp-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 1100;
  background: rgba(20,32,48,.94); color: #fff; font-size: .9rem; font-weight: 600; padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.4); opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.otp-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

body.otp-noscroll { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .otp-acctmodal__sheet, .otp-drawer__panel { animation: none; }
  .otp-acct__entrar, .otp-acct__avatar { transition: none; }
}
