/* ==========================================================================
   DISFRICAL — Acceso Clientes (Clerk): menú, página de acceso y panel privado
   ========================================================================== */

[data-auth-loading][hidden], [data-auth-error][hidden], .q-empty[hidden] { display: none !important; }

/* ---- Botón en el menú ---- */
.nav__auth { display: flex; align-items: center; gap: 8px; }
.nav__auth-btn { --btn-bg: rgba(255, 255, 255, 0.12); --btn-ink: #fff; --btn-line: rgba(255, 255, 255, 0.28); width: 44px; min-height: 44px; padding: 0; }
.nav__auth-btn svg { width: 18px; height: 18px; }
.nav__auth-btn span { display: none; }
.nav.is-scrolled .nav__auth-btn { --btn-bg: transparent; --btn-ink: var(--ink); --btn-line: var(--line-2); }
.nav.is-open .nav__auth-btn { --btn-bg: rgba(255, 255, 255, 0.12); --btn-ink: #fff; --btn-line: rgba(255, 255, 255, 0.28); }
.nav__auth-btn:hover svg { transform: none; }
@media (min-width: 1180px) {
  .nav__auth-btn { width: auto; padding: 0 16px; }
  .nav__auth-btn span { display: inline; }
}
@media (min-width: 980px) and (max-width: 1279px) { .nav__cta { display: none !important; } }
.nav__user { display: grid; place-items: center; min-width: 36px; }
.nav__overlay-auth { margin-top: -8px; width: fit-content; }
.nav__overlay-auth svg { width: 18px; height: 18px; }

/* ---- Página de acceso ---- */
.auth-wrap {
  position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100svh;
  display: grid; align-items: center; padding: calc(var(--nav-h) + 56px) 0 64px;
  background: var(--frost-950); color: #fff;
}
.auth-wrap__media { position: absolute; inset: 0; z-index: -2; }
.auth-wrap__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.auth-wrap::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 60% at 75% 40%, rgba(29, 116, 216, 0.35), transparent 70%), linear-gradient(90deg, rgba(3, 12, 24, 0.95) 0%, rgba(3, 12, 24, 0.7) 100%);
}
.auth-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 980px) { .auth-grid { grid-template-columns: 1fr 460px; gap: 72px; } }
.auth-copy h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4rem); margin-top: 18px; max-width: 14ch; }
.auth-copy > p { margin-top: 18px; color: rgba(233, 241, 251, 0.78); max-width: 46ch; font-size: var(--fs-lg); }
.auth-perks { display: grid; gap: 12px; margin-top: 28px; }
.auth-perks li { display: flex; gap: 12px; align-items: center; font-weight: 500; color: rgba(233, 241, 251, 0.9); }
.auth-perks [data-icon] { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(75, 155, 240, 0.14); color: var(--frost-300); }
.auth-card { border-radius: var(--radius-lg); background: #fff; color: var(--frost-900); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7); overflow: hidden; }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 16px 16px 0; padding: 5px; border-radius: var(--radius-pill); background: #eef2f6; isolation: isolate; }
.auth-tabs button { position: relative; z-index: 1; min-height: 42px; border-radius: var(--radius-pill); font-weight: 600; font-size: 0.9rem; color: #475569; transition: color 0.3s; }
.auth-tabs button[aria-selected="true"] { color: #0a1a2e; }
.auth-tabs::before {
  content: ""; position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px);
  border-radius: var(--radius-pill); background: #fff;
  box-shadow: 0 1px 2px rgba(6, 24, 45, 0.08), 0 4px 12px -4px rgba(6, 24, 45, 0.2);
  transition: transform 0.45s var(--ease-out);
}
.auth-tabs[data-active="1"]::before { transform: translateX(100%); }
.auth-mount { min-height: 420px; display: grid; justify-items: center; padding: 8px 0 12px; }
.auth-mount .cl-rootBox, .auth-mount .cl-cardBox { width: 100%; max-width: 100%; }
.auth-loading { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 380px; color: #6b7c93; font-size: var(--fs-sm); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #dde4ec; border-top-color: var(--frost-500); animation: spin 0.9s linear infinite; }
.auth-error { margin: 16px; padding: 14px 16px; border-radius: 12px; background: var(--heat-100); color: var(--heat-700); font-size: 0.9rem; }

/* ---- Panel privado ---- */
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; }
.dash-head h2 { font-size: var(--fs-2xl); }
.dash-head p { color: var(--ink-2); margin-top: 6px; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-actions .btn svg { width: 18px; height: 18px; }
.dash-stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 36px 0 40px; }
@media (min-width: 900px) { .dash-stats { grid-template-columns: repeat(4, 1fr); } }
.dash-stat { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.dash-stat b { display: block; font-size: 2.2rem; letter-spacing: -0.04em; line-height: 1.1; }
.dash-stat span { font-size: var(--fs-sm); color: var(--ink-2); }
.dash-stat--open b { color: var(--accent); }
.dash-stat--active b { color: var(--heat); }
.dash-stat--done b { color: #1f9d6b; }

/* ---- Pago con Stripe (panel) ---- */
.pay-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: 24px; align-items: center; margin-bottom: 40px;
  padding: clamp(24px, 3.5vw, 40px); border-radius: var(--radius-lg);
  background: var(--frost-950); color: #fff;
}
@media (min-width: 900px) { .pay-card { grid-template-columns: 1.4fr 1fr; gap: 48px; } }
.pay-card::before { content: ""; position: absolute; z-index: -1; right: -20%; top: -60%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(29, 116, 216, 0.45), transparent 65%); }
.pay-card h3 { font-size: var(--fs-2xl); margin: 14px 0 10px; }
.pay-card__info > p { color: rgba(233, 241, 251, 0.78); max-width: 52ch; }
.pay-card__perks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; font-size: var(--fs-sm); color: rgba(233, 241, 251, 0.85); }
.pay-card__perks li { display: flex; align-items: center; gap: 8px; }
.pay-card__perks [data-icon] { width: 18px; height: 18px; color: var(--frost-300); }
.pay-card__action { display: grid; gap: 14px; padding: 22px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(140, 196, 255, 0.16); }
.pay-card__amount b { display: block; font-size: 2.6rem; letter-spacing: -0.04em; line-height: 1; }
.pay-card__amount small { color: rgba(233, 241, 251, 0.6); font-size: var(--fs-xs); }
.pay-card__test { font-size: 0.72rem; color: rgba(233, 241, 251, 0.55); font-family: var(--font-mono); line-height: 1.5; }
.pay-card .form__status.is-err { background: rgba(242, 98, 42, 0.16); color: var(--heat-300); }

/* ---- Página de pago completado ---- */
.success-card { max-width: 640px; margin-inline: auto; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); text-align: center; display: grid; gap: 18px; justify-items: center; }
.success-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: rgba(31, 157, 107, 0.12); color: #1f9d6b; animation: popIn 0.7s var(--ease-out) both; }
.success-icon svg { width: 38px; height: 38px; stroke-width: 2.2; }
.success-icon.is-wait { background: var(--bg-2); color: var(--ink-3); }
.success-icon.is-warn { background: color-mix(in srgb, var(--heat-500) 14%, transparent); color: var(--heat); }
@keyframes popIn { from { transform: scale(0.4); opacity: 0; } }
.success-card h2 { font-size: var(--fs-2xl); }
.success-card > p { color: var(--ink-2); max-width: 48ch; }
.receipt { width: 100%; display: grid; border-top: 1px solid var(--line); text-align: left; }
.receipt div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.receipt dt { color: var(--ink-3); }
.receipt dd { margin: 0; font-weight: 600; text-align: right; }
.receipt[hidden] { display: none; }

.q-list { display: grid; gap: 16px; }
@media (min-width: 980px) { .q-list { grid-template-columns: 1fr 1fr; } }
.q-card { display: grid; gap: 18px; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.q-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.q-id { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--ink-3); }
.q-card h3 { font-size: 1.3rem; margin-top: 4px; }
.q-card header p { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.q-badge { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.q-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.q-badge.is-pending { background: var(--bg-2); color: var(--ink-2); }
.q-badge.is-review { background: color-mix(in srgb, var(--frost-500) 12%, transparent); color: var(--accent); }
.q-badge.is-ok { background: color-mix(in srgb, var(--heat-500) 12%, transparent); color: var(--heat); }
.q-badge.is-done { background: rgba(31, 157, 107, 0.12); color: #138a5b; }
.q-badge.is-no { background: var(--bg-2); color: var(--ink-3); text-decoration: line-through; }
:root[data-theme="dark"] .q-badge.is-done { color: #57d6a2; }
.q-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.q-meta dt { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.q-meta dd { margin: 2px 0 0; font-weight: 600; }
.q-steps { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); list-style: none; margin: 4px 0 0; padding: 0; }
.q-steps::before, .q-steps::after { content: ""; position: absolute; top: 6px; left: 10%; height: 3px; border-radius: 3px; }
.q-steps::before { right: 10%; background: var(--line-2); }
.q-steps::after { width: calc(80% * var(--p)); background: var(--grad-thermal); }
.q-steps li { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; text-align: center; }
.q-steps i { width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-2); }
.q-steps li.done i { background: var(--frost-500); border-color: var(--frost-500); }
.q-steps li.now i { background: var(--surface); border-color: var(--heat-500); box-shadow: 0 0 0 5px color-mix(in srgb, var(--heat-500) 18%, transparent); }
.q-steps span { font-size: 0.68rem; line-height: 1.25; color: var(--ink-3); }
.q-steps li.now span { color: var(--ink); font-weight: 700; }
.q-note { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.q-empty { padding: 48px 24px; text-align: center; border-radius: var(--radius-lg); border: 1px dashed var(--line-2); display: grid; gap: 14px; justify-items: center; }
.q-empty [data-icon] { width: 44px; height: 44px; color: var(--accent); }
.q-empty p { color: var(--ink-2); max-width: 46ch; }
.q-empty[hidden] { display: none; }

.dash-guard { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 40vh; color: var(--ink-3); }
body:not(.is-authed) [data-dashboard-content] { display: none; }
body.is-authed .dash-guard { display: none; }
