/* Pantallas de entrada (inicio de sesión, huella, verificación). */
/* Fondo grafito con brillo dorado, tarjetas de vidrio oscuro, Archivo en títulos e Inter en textos. */

.auth {
  --a-bg: #0B0C0E;
  --a-line: rgba(255, 255, 255, .09);
  --a-line-2: rgba(255, 255, 255, .16);
  --a-text: #F4F5F7;
  --a-muted: #A3A9B3;
  --a-gold: #FDB207;
  --a-ease: cubic-bezier(.2, .8, .2, 1);
  position: relative; isolation: isolate; color: var(--a-text); background: var(--a-bg); color-scheme: dark;
  min-height: 100vh; min-height: 100dvh;
}

/* Panel de marca (computadora) */
.auth .auth-brand {
  border-right: 1px solid var(--a-line);
  background: #0F1013;
}
.auth .auth-point span.ic svg { width: 20px; height: 20px; }
.auth .auth-main { padding: 40px 24px; }

/* Encabezado en el celular */
.auth .wordmark { color: #fff; }

/* Tarjeta */
.auth .auth-card {
  width: min(440px, 100%); color: var(--a-text); gap: 20px; padding: 34px 32px; border-radius: 28px;
  background: #16171B;
  border: 1px solid var(--a-line);
  box-shadow: none;
  animation: auth-rise .5s var(--a-ease) both;
}
.auth .auth-card h2 { font-family: var(--titulo); font-weight: 800; font-size: 1.75rem; line-height: 1.12; letter-spacing: -.02em; color: #fff; }
.auth .auth-card .lead { color: var(--a-muted); margin-top: 8px; font-size: 0.9688rem; line-height: 1.5; }
.auth .muted { color: var(--a-muted); }
.auth .auth-note { text-align: center; color: rgba(255, 255, 255, .45); }

/* Campos */
.auth .field { gap: 8px; }
.auth .field > label, .auth .field-label { color: #E6E8EC; font-weight: 600; font-size: 0.875rem; }
.auth .field .hint { color: var(--a-muted); }
.auth .field .err { color: #FCA5A5; }
.auth .input {
  min-height: 54px; border-radius: 14px; color: #fff; background: rgba(255, 255, 255, .05); border-color: var(--a-line-2);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth .input::placeholder { color: rgba(255, 255, 255, .36); }
.auth .input:hover { border-color: rgba(255, 255, 255, .26); }
.auth .input:focus { border-color: var(--a-gold); background: rgba(255, 255, 255, .07); box-shadow: none; }
.auth .input[aria-invalid="true"] { border-color: #F87171; }
.auth .input:-webkit-autofill, .auth .input:-webkit-autofill:hover, .auth .input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff; caret-color: #fff; box-shadow: 0 0 0 1000px #1A1C20 inset; transition: background-color 9999s;
}
.auth .input-wrap > svg.lead { color: rgba(255, 255, 255, .42); transition: color .2s; }
.auth .input-wrap:focus-within > svg.lead { color: var(--a-gold); }
.auth .trail-btn { color: rgba(255, 255, 255, .55); width: 44px; height: 44px; }
.auth .trail-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.auth .check { color: #D5D9E0; min-height: 44px; }
.auth .check input { accent-color: var(--a-gold); }
.auth .caps { color: #FBBF24; }
.auth .link-btn { color: var(--a-gold); min-height: 44px; }
.auth .link-btn:hover { color: #FFD466; }
.auth .auth-actions { gap: 4px 12px; }

/* Botones */
.auth .btn-lg { min-height: 56px; font-size: 1.0313rem; padding: 0 26px; }
.auth .btn-primary {
  color: #0B0C0E; background: #FDB207;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(120, 70, 0, .25);
  transition: transform .15s var(--a-ease), box-shadow .2s, filter .2s;
}
.auth .btn-primary:hover:not(:disabled) { background: #FDB207; filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.auth .btn-primary:disabled:not([aria-busy="true"]) { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .42); box-shadow: none; opacity: 1; }
.auth .btn-dark, .auth .btn-outline { background: rgba(255, 255, 255, .06); color: #fff; border-color: var(--a-line-2); }
.auth .btn-dark:hover:not(:disabled), .auth .btn-outline:hover:not(:disabled) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.auth .btn-huella.btn-dark { border-color: rgba(253, 178, 7, .45); box-shadow: 0 10px 26px rgba(0, 0, 0, .3); }
.auth .btn-huella svg { color: var(--a-gold); width: 20px; height: 20px; }
.auth .auth-or { display: flex; align-items: center; gap: 12px; color: var(--a-muted); font-size: 0.8125rem; }
.auth .auth-or::before, .auth .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--a-line); }

/* Avisos sobre fondo oscuro */
.auth .alert { border: 1px solid transparent; }
.auth .alert-error { background: rgba(239, 68, 68, .12); color: #FECACA; border-color: rgba(239, 68, 68, .28); }
.auth .alert-ok { background: rgba(34, 197, 94, .1); color: #BBF7D0; border-color: rgba(34, 197, 94, .26); }
.auth .alert-aviso { background: rgba(253, 178, 7, .1); color: #FDE68A; border-color: rgba(253, 178, 7, .26); }
.auth .alert-info { background: rgba(59, 130, 246, .12); color: #BFDBFE; border-color: rgba(59, 130, 246, .28); }

/* Verificación: ubicación + selfie */
.auth .who { padding: 14px; gap: 14px; border-radius: 18px; background: rgba(253, 178, 7, .12); border: 1px solid rgba(253, 178, 7, .2); }
.auth .who-name { font-family: var(--titulo); font-weight: 800; font-size: 1.1875rem; color: #fff; }
.auth .who-ok { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #0B0C0E; background: var(--a-gold); flex: none; }
.auth .avatar.dark { background: #1B1D22; color: var(--a-gold); box-shadow: none; }
.auth .steps { gap: 12px; }
.auth .step { border: 1px solid var(--a-line); background: rgba(255, 255, 255, .03); border-radius: 18px; padding: 16px; transition: border-color .25s, background .25s; }
.auth .step.done { border-color: rgba(34, 197, 94, .38); background: rgba(34, 197, 94, .06); }
.auth .step.bad { border-color: rgba(239, 68, 68, .38); background: rgba(239, 68, 68, .06); }
.auth .step-head { flex-wrap: wrap; }
.auth .step-head > .btn { flex: 1 0 100%; min-height: 46px; }
.auth .step-num { width: 34px; height: 34px; background: rgba(255, 255, 255, .08); color: #fff; }
.auth .step.done .step-num { background: #22C55E; color: #0B0C0E; }
.auth .step.bad .step-num { background: #EF4444; color: #fff; }
.auth .step-title { color: #fff; }
.auth .step-sub { color: var(--a-muted); }
.auth .spinner { border-color: rgba(255, 255, 255, .14); border-top-color: var(--a-gold); }
.auth .cam { background: #15171B; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.auth .cam .cam-msg { color: var(--a-muted); }
.auth .rules li { color: var(--a-muted); }
.auth .rules li.ok { color: #4ADE80; }
.auth .success-ic { background: rgba(34, 197, 94, .14); color: #4ADE80; }
.auth-offer { text-align: center; }
.auth-offer-ic { display: grid; place-items: center; margin: 0 auto; filter: none; }

/* ───────── Entrar con huella (pantalla centrada) ───────── */
.auth-focus { grid-template-columns: minmax(0, 1fr); }
.auth-focus .auth-main {
  margin: 0; min-height: 100vh; min-height: 100dvh; place-items: center; align-items: center;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
}
.fp { width: min(400px, 100%); display: grid; justify-items: center; text-align: center; gap: 22px; color: var(--a-text); }
.fp > * { animation: auth-rise .6s var(--a-ease) both; }
.fp > :nth-child(2) { animation-delay: .06s; }
.fp > :nth-child(3) { animation-delay: .12s; }
.fp > :nth-child(4) { animation-delay: .18s; }
.fp > :nth-child(5) { animation-delay: .24s; }
.fp-brand { display: grid; justify-items: center; gap: 14px; }
.fp-logo { width: 76px; height: auto; filter: none; }
.fp-word { font-family: var(--titulo); font-weight: 800; font-size: 1.3125rem; line-height: 1; letter-spacing: .3em; padding-left: .3em; color: #fff; }
.fp-word span { display: block; margin-top: 8px; font-family: var(--texto); font-weight: 600; font-size: 0.7188rem; letter-spacing: .38em; text-transform: uppercase; color: var(--a-gold); }
.fp-hello h2 { font-family: var(--titulo); font-weight: 800; font-size: clamp(28px, 7.6vw, 34px); line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.fp-hello p { margin-top: 10px; color: var(--a-muted); font-size: 1rem; }
.fp .alert { width: 100%; text-align: left; }
.fp-orb {
  position: relative; width: 176px; height: 176px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; margin: 4px 0;
  background: rgba(253, 178, 7, .04);
  box-shadow: none; -webkit-tap-highlight-color: transparent;
}
.fp-orb .i3d { position: relative; filter: none; transition: transform .25s var(--a-ease); }
.fp-orb:hover .i3d { transform: translateY(-2px) scale(1.03); }
.fp-orb:active .i3d { transform: scale(.95); }
.fp-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(253, 178, 7, .5); animation: fp-pulse 2.8s cubic-bezier(.2, .6, .3, 1) infinite; pointer-events: none; }
.fp-ring.r2 { animation-delay: 1.4s; }
.fp-orb.is-busy .fp-ring { animation-duration: 1.3s; }
.fp-actions { width: 100%; display: grid; gap: 8px; }
.fp-actions .btn-lg { min-height: 60px; font-size: 1.0625rem; }
.fp-actions .btn-lg svg { width: 22px; height: 22px; }
.fp-alt {
  justify-self: center; min-height: 52px; padding: 0 22px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  color: #E6E8EC; font: inherit; font-weight: 600; font-size: 0.9688rem; transition: background .2s, color .2s;
}
.fp-alt:hover:not(:disabled) { background: rgba(255, 255, 255, .07); color: #fff; }
.fp-alt:disabled { opacity: .5; cursor: default; }

/* «Entrando…» */
.fp-load { position: relative; width: 136px; height: 136px; display: grid; place-items: center; }
.fp-load img { position: relative; width: 64px; height: auto; filter: none; animation: fp-breathe 1.8s ease-in-out infinite; }
.fp-track, .fp-spin { position: absolute; inset: 0; border-radius: 50%; }
.fp-track { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .07); }
.fp-spin {
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(253, 178, 7, .85) 86%, #FFE38F 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  animation: fp-turn 1.1s linear infinite;
}
.fp-check {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 0.8438rem; font-weight: 600;
  color: #FDE7A8; background: rgba(253, 178, 7, .1); border: 1px solid rgba(253, 178, 7, .24);
}
.fp-check svg { color: var(--a-gold); }

@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fp-pulse { 0% { transform: scale(.7); opacity: .95; } 100% { transform: scale(1.2); opacity: 0; } }
@keyframes fp-breathe { 50% { transform: scale(1.06); } }
@keyframes fp-turn { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth .auth-mobile-head {
    background: none; border-radius: 0; gap: 10px;
    padding: calc(26px + env(safe-area-inset-top, 0px)) 20px 20px;
  }
  .auth .auth-mobile-head img { width: 54px; filter: none; }
  .auth .auth-mobile-head .wordmark { font-size: 1.375rem; }
  .auth .auth-mobile-head .wordmark-sub { margin-top: 6px; }
  .auth .auth-main { margin-top: 0; align-items: start; padding: 0 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .auth .auth-card { padding: 28px 20px; border-radius: 26px; }
  .auth .auth-card h2 { font-size: 1.625rem; }
  .auth.auth-focus .auth-main { align-items: center; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .auth .auth-card, .fp > *, .fp-load img { animation: none; }
  .fp-ring { animation: none; opacity: .45; transform: scale(.94); }
  .fp-ring.r2 { display: none; }
  .fp-spin { animation-duration: 3s; }
  .fp-orb .i3d, .auth .btn-primary { transition: none; }
}

/* ───────── Accesos: con qué entró cada persona ───────── */
.login-badges { display: grid; gap: 4px; justify-items: end; flex: none; }
.method-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 0.75rem; font-weight: 700; letter-spacing: .01em; line-height: 1.4;
}
.method-badge svg { width: 13px; height: 13px; flex: none; }
.method-badge.is-huella { background: #0B0C0E; color: #FDB207; }
.method-badge.is-clave { background: var(--acero-100, #E9ECF0); color: var(--acero-700, #3D434D); }
@media (max-width: 520px) {
  /* En celular la fila no alcanza: el método queda como ícono y la selfie como pastilla corta */
  .login-badges { gap: 3px; }
  .login-badges .method-badge { padding: 4px; }
  .login-badges .method-badge .mb-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .login-badges .pill { font-size: 0.6875rem; padding: 2px 8px; }
}

/* ───────── Accesos → Llegadas: lejos de la tienda (con la foto de la fachada), hora del celular y HAMMY ───────── */
.vis-filter { padding: 10px 18px 0; }
.vis-row { align-items: flex-start; }
.vis-row > .avatar, .vis-row > .ck-thumb { margin-top: 2px; }
.vis-row.is-far { box-shadow: inset 3px 0 0 var(--error); }
.vis-row.is-sel { background: var(--acero-50, #F5F6F8); }
.vis-sel { display: grid; gap: 2px; width: 100%; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.vis-sel:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 6px; }
.vis-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.vis-phone { color: var(--aviso); font-weight: 600; }
.vis-hammy { font-weight: 700; }

/* ───────── Logos de cliente (Merza…) ───────── */
.client-logo {
  display: inline-flex; align-items: center; justify-content: center; flex: none; vertical-align: middle;
  background: #fff; border: 1px solid var(--acero-100, #E9ECF0); border-radius: 8px; padding: 3px 7px;
}
.client-logo img { display: block; max-width: none; }
.client-chip {
  display: inline-flex; align-items: center; flex: none; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 8px; border-radius: 7px; font-size: 0.7188rem; font-weight: 700; letter-spacing: .02em;
  background: var(--acero-100, #E9ECF0); color: var(--acero-700, #3D434D);
}

/* ───────── Directorio de tiendas al dar de alta un HAMMY ───────── */
.sp { display: grid; gap: 0; border: 1px solid var(--acero-200, #D5D9E0); border-radius: 16px; background: var(--papel, #fff); overflow: hidden; }
.sp-search { position: sticky; top: 0; z-index: 3; padding: 12px 12px 10px; background: var(--papel, #fff); border-bottom: 1px solid var(--acero-100, #E9ECF0); display: grid; gap: 8px; }
.sp-search .field { gap: 6px; }
.sp-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.7813rem; color: var(--acero-500, #6B7280); }
.sp-meta strong { color: var(--grafito, #0B0C0E); font-weight: 700; }
.sp-keys { display: inline-flex; gap: 4px; align-items: center; }
.sp-keys kbd { font: 600 0.6875rem/1 var(--texto); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--acero-200, #D5D9E0); background: var(--acero-50, #F3F4F6); color: var(--acero-600, #565D68); }
.sp-list { max-height: min(56vh, 460px); overflow: auto; overscroll-behavior: contain; scroll-padding-top: 40px; }
.sp-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 14px; font-family: var(--titulo); font-weight: 700; font-size: 0.75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--acero-600, #565D68); background: rgba(246, 246, 243, .94);
  border-bottom: 1px solid var(--acero-100, #E9ECF0);
}
.sp-head .n { font-family: var(--texto); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--acero-500, #6B7280); }
.sp-head.recent { color: var(--oro-texto, #8A5A00); background: rgba(255, 248, 227, .96); }
.sp-item {
  content-visibility: auto; contain-intrinsic-size: auto 60px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 60px;
  padding: 10px 14px; border: 0; border-top: 1px solid var(--acero-50, #F3F4F6); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.sp-head + .sp-item { border-top: 0; }
.sp-item:hover { background: var(--acero-50, #F3F4F6); }
.sp-item.active { background: var(--oro-50, #FFF8E3); box-shadow: inset 3px 0 0 var(--oro, #FDB207); }
.sp-item[aria-selected="true"] .sp-name::after { content: ' · elegida'; color: var(--oro-texto, #8A5A00); font-weight: 600; font-size: 0.7813rem; }
.sp-num { min-width: 52px; text-align: center; }
.sp-text { min-width: 0; display: grid; gap: 2px; }
.sp-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-addr { font-size: 0.7813rem; color: var(--acero-500, #6B7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp mark { background: rgba(253, 178, 7, .32); color: inherit; border-radius: 3px; padding: 0 1px; }
.sp-empty { padding: 28px 16px; text-align: center; color: var(--acero-500, #6B7280); font-size: 0.875rem; }
.picked-store { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.picked-store .client-logo { margin-top: 4px; }
@media (max-width: 640px) {
  .sp-keys { display: none; }
  .sp-list { max-height: 60vh; }
  .sp-search { padding: 10px 10px 8px; }
  .sp-item { gap: 10px; padding: 10px 12px; align-items: start; }
  .sp-num { min-width: 0; margin-top: 2px; }
  .sp-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
  .sp-item .client-logo { margin-top: 2px; padding: 2px 5px; }
}
