/* =============================================================================
 * auth.css — Chip de sesión + ventana (modal) de login/registro
 * Combina con la marca (morado #8A2BE2) usando las variables de la app.
 * ========================================================================== */

:root {
  --auth-purple: var(--brand-purple, #8A2BE2);
  --auth-good:   var(--good, #16A34A);
  --auth-bad:    var(--bad, #DC2626);
}

/* --- Chip de sesión (esquina superior derecha) --------------------------- */
.auth-chip {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: var(--auth-purple);
  color: #fff;
  font: 600 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(138, 43, 226, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.auth-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(138,43,226,.45); }
.auth-chip__avatar {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; background: rgba(255,255,255,.25);
}
.auth-chip--in { background: #fff; color: #222; box-shadow: 0 4px 14px rgba(0,0,0,.15); }

/* --- Fondo oscuro del modal --------------------------------------------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(10, 12, 20, .55);
  backdrop-filter: blur(4px);
  padding: 16px;
}
.auth-overlay.is-open { display: flex; }

/* --- Tarjeta del modal --------------------------------------------------- */
.auth-modal {
  position: relative;   /* ancla de la ✕ (si no, flota en la esquina de la PANTALLA) */
  width: 100%; max-width: 380px;
  background: #fff; color: #1a1d24;
  border-radius: 20px;
  padding: 26px 24px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  animation: auth-sheet .4s cubic-bezier(.22, 1.2, .36, 1);
}
@keyframes auth-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* Hoja nativa: el modal sube desde abajo con un rebote suave */
@keyframes auth-sheet { from { transform: translateY(48px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .auth-modal { animation: none; }
}

.auth-modal__close {
  position: absolute; top: 14px; right: 16px;
  border: none; background: none; font-size: 26px; line-height: 1;
  color: #9aa0aa; cursor: pointer;
}
.auth-modal__title { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.auth-modal__sub   { margin: 0 0 18px; font-size: 14px; color: #6b7280; }

/* --- Pestañas Entrar / Crear cuenta ------------------------------------- */
.auth-tabs { display: flex; gap: 6px; background: #f1f2f6; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; border: none; background: none; padding: 9px 0;
  border-radius: 9px; font-weight: 700; font-size: 14px; color: #6b7280; cursor: pointer;
}
.auth-tab.is-active { background: #fff; color: var(--auth-purple); box-shadow: 0 2px 6px rgba(0,0,0,.08); }

/* --- Botón de Google ----------------------------------------------------- */
.auth-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border: 1.5px solid #e2e5ea; border-radius: 12px;
  background: #fff; color: #1a1d24; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: background .15s ease;
}
.auth-google:hover { background: #f7f8fa; }
.auth-google svg { width: 20px; height: 20px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #9aa0aa; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #e6e8ec; }

/* --- Campos -------------------------------------------------------------- */
.auth-field { margin-bottom: 12px; }
.auth-field input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1.5px solid #e2e5ea; border-radius: 12px; font-size: 15px; outline: none;
  transition: border-color .15s ease;
}
.auth-field input:focus { border-color: var(--auth-purple); }
.auth-field[hidden] { display: none; }

.auth-submit {
  width: 100%; padding: 13px; border: none; border-radius: 12px;
  background: var(--auth-purple); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer;
  margin-top: 4px; transition: filter .15s ease;
}
.auth-submit:hover { filter: brightness(1.05); }
.auth-submit:disabled { opacity: .6; cursor: default; }

.auth-link { display: block; margin-top: 12px; text-align: center; font-size: 13px; color: var(--auth-purple); background: none; border: none; cursor: pointer; }
.auth-msg  { margin: 12px 0 0; font-size: 13.5px; text-align: center; min-height: 18px; }
.auth-msg.is-error { color: var(--auth-bad); }
.auth-msg.is-ok    { color: var(--auth-good); }

/* --- Modo obligatorio (login gate): fondo más sólido, sin salida ---------- */
.auth-overlay--forced { background: rgba(10, 12, 20, .78); }

/* VELO MORADO INSTANTÁNEO por CSS puro: el body trae "auth-checking" desde el
   HTML, pero el cover de verdad (Trufa+Freddye) lo crea auth-gate.js y los
   scripts tardan unos ms en despertar — ese hueco era el FOGONAZO BLANCO al
   volver a la pantalla principal (cazado por Axel, 16-jul). Este ::before pinta
   el morado desde el PRIMER píxel; el cover con los perros se pone encima. */
body.auth-checking::before {
  content: "";
  position: fixed; inset: 0; z-index: 9399;
  background:
    radial-gradient(80% 55% at 50% 32%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(160deg, #A85AF0 0%, #8A2BE2 52%, #5E17A0 100%);
}
/* Y se funde a la vez que el cover cuando el splash se despide. */
body.auth-checking.auth-splash-out::before {
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

/* --- Portada de carga / bloqueo mientras se comprueba la sesión ----------- */
.auth-gate-cover {
  position: fixed; inset: 0; z-index: 9400;
  display: none; align-items: center; justify-content: center;
  overflow: hidden;
  /* Foco de luz suave arriba-centro + degradado morado con más cuerpo. */
  background:
    radial-gradient(80% 55% at 50% 32%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(160deg, #A85AF0 0%, #8A2BE2 52%, #5E17A0 100%);
}
body.auth-checking .auth-gate-cover,
body.auth-locked   .auth-gate-cover { display: flex; }

/* FUNDIDO DE SALIDA del splash: auth-gate.js pone body.auth-splash-out y
   espera 450ms antes de retirar la portada. Esta clase existía en el JS pero
   el CSS no estaba (cazado con el QA de Luna, 16-jul): el velo se esfumaba de
   un frame a otro. Ahora se funde suave y, mientras se va, NO captura toques
   (pointer-events) — nadie puede "atravesarlo" ni quedarse con un toque muerto. */
body.auth-splash-out .auth-gate-cover {
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

/* Textura de huellas de perro, muy suave, sobre el morado. */
.auth-gate-cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><g fill='%23FFFFFF' fill-opacity='0.06'><ellipse cx='38' cy='42' rx='7.2' ry='6'/><ellipse cx='29.2' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='34.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='41.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='46.8' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='150' cy='120' rx='7.2' ry='6'/><ellipse cx='141.2' cy='111.2' rx='2.7' ry='3.5'/><ellipse cx='146.5' cy='107.2' rx='2.4' ry='3.2'/><ellipse cx='153.5' cy='107.2' rx='2.4' ry='3.2'/><ellipse cx='158.8' cy='111.2' rx='2.7' ry='3.5'/><ellipse cx='40' cy='165' rx='7.2' ry='6'/><ellipse cx='31.2' cy='156.2' rx='2.7' ry='3.5'/><ellipse cx='36.5' cy='152.2' rx='2.4' ry='3.2'/><ellipse cx='43.5' cy='152.2' rx='2.4' ry='3.2'/><ellipse cx='48.8' cy='156.2' rx='2.7' ry='3.5'/></g></svg>");
  background-size: 200px 200px;
}

/* Viñeteado: oscurece los bordes para que el centro (Trufa) destaque. */
.auth-gate-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(50,10,90,.45) 100%);
}

/* Burbujas translúcidas que flotan hacia arriba. */
.auth-gate-cover__bubbles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.auth-gate-cover__bubbles span {
  position: absolute; bottom: -60px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.30), rgba(255,255,255,.05));
  animation: auth-float linear infinite;
}
.auth-gate-cover__bubbles span:nth-child(1){ left:12%; width:46px; height:46px; animation-duration:11s; }
.auth-gate-cover__bubbles span:nth-child(2){ left:28%; width:26px; height:26px; animation-duration:8s;  animation-delay:1.5s; }
.auth-gate-cover__bubbles span:nth-child(3){ left:62%; width:60px; height:60px; animation-duration:13s; animation-delay:.8s; }
.auth-gate-cover__bubbles span:nth-child(4){ left:78%; width:32px; height:32px; animation-duration:9s;  animation-delay:2.2s; }
.auth-gate-cover__bubbles span:nth-child(5){ left:88%; width:20px; height:20px; animation-duration:10s; animation-delay:.4s; }
@keyframes auth-float {
  0%   { transform: translateY(0)        scale(1);   opacity: 0; }
  15%  { opacity: .8; }
  85%  { opacity: .8; }
  100% { transform: translateY(-112vh)   scale(1.1); opacity: 0; }
}

.auth-gate-cover__inner { position: relative; z-index: 2; text-align: center; }

/* Halo brillante que late detrás de Trufa. */
.auth-gate-cover__halo {
  position: absolute; left: 50%; top: 58px;
  width: 230px; height: 230px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 68%);
  filter: blur(6px); z-index: -1;
  animation: auth-halo 2.4s ease-in-out infinite;
}
@keyframes auth-halo {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: .9;  transform: translate(-50%, -50%) scale(1.12); }
}

/* Trufa + Freddye, lado a lado, saltando en turnos (estilo Duolingo). */
/* DÚO PROTAGONISTA: Freddye entra GRANDE con un "pop" (rebote), y Trufa se une
   medio segundo después. Los dos grandes. Luego respiran turnándose y aparece
   la marca. Los dos son la cara de Path Accent. */
.auth-gate-cover__hero {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 6px; margin-bottom: 20px;
}
.auth-gate-cover__dog {
  width: 220px; max-width: 46vw; height: auto;
  filter: drop-shadow(0 16px 22px rgba(0,0,0,.34));
  transform-origin: center bottom;
}
/* Los dos aparecen A LA VEZ (mismo pop). Respiran turnándose para que tengan
   vidilla, pero entran juntos. */
.auth-gate-cover__dog--trufa,
.auth-gate-cover__dog--freddye {
  animation:
    auth-hero-pop .7s cubic-bezier(.2,1.3,.4,1) both,
    auth-hero-breathe 2.6s ease-in-out .7s infinite;
}
/* Solo el respiro va desfasado (se turnan al botar), pero la entrada es igual. */
.auth-gate-cover__dog--freddye { animation-delay: 0s, 1.3s; }
@keyframes auth-hero-pop {
  0%   { transform: scale(.3) translateY(30px); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes auth-hero-breathe {
  0%, 100% { transform: translateY(0)    scale(1, 1); }
  50%      { transform: translateY(-8px) scale(1.02, .99); }
}

.auth-gate-cover__logo {
  color: #fff; font: 900 30px/1 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .4px; margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0,0,0,.28);
  /* Aparece DESPUÉS de que Freddye entre (se desvanece hacia arriba). */
  animation: auth-logo-in .6s ease-out .55s both;
}
@keyframes auth-logo-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-gate-cover__dog { animation: none; }
  .auth-gate-cover__logo { animation: none; }
}

/* Puntitos de carga que rebotan. */
.auth-gate-cover__dots { display: flex; gap: 9px; justify-content: center; }
.auth-gate-cover__dots span {
  width: 11px; height: 11px; border-radius: 50%; background: #fff;
  animation: auth-dot 1s ease-in-out infinite;
}
.auth-gate-cover__dots span:nth-child(2) { animation-delay: .16s; }
.auth-gate-cover__dots span:nth-child(3) { animation-delay: .32s; }
@keyframes auth-dot {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-6px); }
}

/* Mientras carga (splash), fondo morado inmediato y contenido oculto: así el
   splash cubre desde el primer píxel y NUNCA se ve el menú antes de tiempo. */
body.auth-checking {
  background: linear-gradient(160deg, #A85AF0 0%, #8A2BE2 52%, #5E17A0 100%) !important;
}
body.auth-checking #app-main,
body.auth-checking #app-header { visibility: hidden; }

/* --- Cuenta dentro del menú lateral -------------------------------------- */
.side-menu-account { display: inline-flex; flex-direction: column; line-height: 1.2; }
.side-menu-account__name { font-weight: 700; }
.side-menu-account__sub  { font-size: 12px; opacity: .7; }

/* =============================================================================
   "¿CÓMO TE LLAMAMOS?" 🐕 (js/name-fix.js) — cuando el nombre de la cuenta
   no pasa la aduana, se pregunta con cariño en vez de castigar sin saludo
   ========================================================================== */
.name-fix {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    background: rgba(10, 8, 20, 0.6);
    backdrop-filter: blur(3px);
}
.name-fix__panel {
    width: min(88vw, 360px);
    padding: 22px;
    border-radius: 22px;
    background: #fff;
    color: #2b2440;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    animation: name-fix-in 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes name-fix-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
.name-fix__panel strong { font-size: 1.15rem; font-weight: 900; }
.name-fix__panel p { margin: 8px 0 12px; font-size: 0.88rem; color: #6b6480; line-height: 1.45; }
.name-fix__panel input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e4defa;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
}
.name-fix__panel input:focus { outline: none; border-color: #8A2BE2; }
.name-fix__err { color: #d94848 !important; font-weight: 700; }
.name-fix__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
.name-fix__skip {
    border: none; background: none; cursor: pointer;
    padding: 10px 12px; font-weight: 700; color: #8a8499;
}
.name-fix__save {
    border: none; cursor: pointer;
    padding: 10px 22px;
    border-radius: 999px;
    background: #8A2BE2;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}
.name-fix__save:active { transform: translateY(3px); box-shadow: none; }

/* =============================================================================
   LOGIN CON ALMA 💜🐾 — fondo morado de marca + paseo de huellas animado
   + el nombre de la app presidiendo la puerta (regla de Axel: que huela a
   Path Accent desde el primer segundo)
   ========================================================================== */
.auth-overlay {
  flex-direction: column;
  gap: 22px;
  background:
      url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><g fill='%23B85EFF' fill-opacity='0.07'><ellipse cx='38' cy='42' rx='7.2' ry='6'/><ellipse cx='29.2' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='34.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='41.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='46.8' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='150' cy='118' rx='7.2' ry='6'/><ellipse cx='141.2' cy='109.2' rx='2.7' ry='3.5'/><ellipse cx='146.5' cy='105.2' rx='2.4' ry='3.2'/><ellipse cx='153.5' cy='105.2' rx='2.4' ry='3.2'/><ellipse cx='158.8' cy='109.2' rx='2.7' ry='3.5'/><ellipse cx='70' cy='168' rx='7.2' ry='6'/><ellipse cx='61.2' cy='159.2' rx='2.7' ry='3.5'/><ellipse cx='66.5' cy='155.2' rx='2.4' ry='3.2'/><ellipse cx='73.5' cy='155.2' rx='2.4' ry='3.2'/><ellipse cx='78.8' cy='159.2' rx='2.7' ry='3.5'/></g></svg>"),
      linear-gradient(165deg, #2a1a4d 0%, #3b2168 55%, #241242 100%);
  background-size: 200px 200px, cover;
}

/* Marca sobre la tarjeta: insignia + wordmark */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  animation: auth-brand-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.auth-brand__logo {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #B85EFF, #8A2BE2);
  box-shadow: 0 4px 16px rgba(138, 43, 226, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.auth-brand__logo svg { width: 25px; height: 25px; color: #fff; }
.auth-brand__text {
  font-family: 'Inter', 'Nunito', system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #ffffff, #d9c2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes auth-brand-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}

/* PASEO DE HUELLAS 🐾: un perrito invisible cruza en diagonal — cada pisada
   aparece, respira y se desvanece, alternando pata izquierda/derecha. */
.auth-paws { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-paw {
  position: absolute;
  width: 34px; height: 34px;
  color: #c9a1ff;
  opacity: 0;
  animation: auth-paw-step 7s ease-in-out infinite;
}
.auth-paw svg { width: 100%; height: 100%; display: block; }
.auth-paw:nth-child(1) { left: 8%;  bottom: 6%;  transform: rotate(18deg);  animation-delay: 0s; }
.auth-paw:nth-child(2) { left: 20%; bottom: 16%; transform: rotate(-12deg); animation-delay: 0.9s; }
.auth-paw:nth-child(3) { left: 33%; bottom: 25%; transform: rotate(20deg);  animation-delay: 1.8s; }
.auth-paw:nth-child(4) { left: 60%; top: 30%;    transform: rotate(-14deg); animation-delay: 2.7s; }
.auth-paw:nth-child(5) { left: 74%; top: 20%;    transform: rotate(16deg);  animation-delay: 3.6s; }
.auth-paw:nth-child(6) { left: 87%; top: 10%;    transform: rotate(-10deg); animation-delay: 4.5s; }
@keyframes auth-paw-step {
  0%        { opacity: 0; scale: 0.7; }
  6%, 30%   { opacity: 0.42; scale: 1; }
  48%, 100% { opacity: 0; scale: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-paw { animation: none; opacity: 0.18; }
  .auth-brand { animation: none; }
}
body.pa-battery-saver .auth-paw { animation: none; opacity: 0.15; }

/* =============================================================================
   PORTERO DE ACTUALIZACIONES 📲 (js/update-gate.js — app nativa)
   ========================================================================== */
.update-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;              /* por encima de TODO: no se puede seguir sin actualizar */
  display: grid;
  place-items: center;
  padding: 20px;
  /* MISMO fondo que la portada del login (auth-gate-cover): foco de luz
     arriba + degradado morado, con las huellas blancas ESTÁTICAS encima. */
  background:
      url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><g fill='%23FFFFFF' fill-opacity='0.06'><ellipse cx='38' cy='42' rx='7.2' ry='6'/><ellipse cx='29.2' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='34.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='41.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='46.8' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='150' cy='120' rx='7.2' ry='6'/><ellipse cx='141.2' cy='111.2' rx='2.7' ry='3.5'/><ellipse cx='146.5' cy='107.2' rx='2.4' ry='3.2'/><ellipse cx='153.5' cy='107.2' rx='2.4' ry='3.2'/><ellipse cx='158.8' cy='111.2' rx='2.7' ry='3.5'/><ellipse cx='40' cy='165' rx='7.2' ry='6'/><ellipse cx='31.2' cy='156.2' rx='2.7' ry='3.5'/><ellipse cx='36.5' cy='152.2' rx='2.4' ry='3.2'/><ellipse cx='43.5' cy='152.2' rx='2.4' ry='3.2'/><ellipse cx='48.8' cy='156.2' rx='2.7' ry='3.5'/></g></svg>"),
      radial-gradient(80% 55% at 50% 32%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 60%),
      linear-gradient(160deg, #A85AF0 0%, #8A2BE2 52%, #5E17A0 100%);
  background-size: 200px 200px, cover, cover;
}
/* El paseo de huellas 🐾 pisa el morado; la tarjeta queda por encima. */
.update-gate .auth-paws { z-index: 1; }
.update-gate__panel {
  position: relative;
  z-index: 2;
  width: min(90vw, 380px);
  padding: 26px 24px;
  border-radius: 24px;
  background: #fff;
  color: #2b2440;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: auth-pop 0.25s ease;
}
.update-gate__dogs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}
.update-gate__dogs img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  animation: update-dogs-hop 1.6s ease-in-out infinite;
}
.update-gate__dogs img:last-child { animation-delay: 0.35s; }
@keyframes update-dogs-hop {
  0%, 100% { transform: translateY(0); }
  30%      { transform: translateY(-8px); }
}
.update-gate__panel strong { font-size: 1.2rem; font-weight: 900; display: block; }
/* El titular entra con su propia animación, un pelín después del panel. */
.update-gate__title { animation: update-title-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.2s both; }
@keyframes update-title-in {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}
.update-gate__panel p { margin: 8px 0 16px; font-size: 0.9rem; color: #6b6480; line-height: 1.5; }
.update-gate__btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  background: #8A2BE2;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}
.update-gate__btn:active { transform: translateY(3px); box-shadow: none; }

/* Aviso amable (versión nueva disponible, sin bloquear) */
.update-notice {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 9000;
  max-width: 88vw;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(30, 20, 50, 0.95);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  animation: update-notice-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.update-notice.is-going { opacity: 0; transition: opacity 0.6s ease; }
@keyframes update-notice-in {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .update-gate__dogs img { animation: none; }
}

/* =============================================================================
   LOGIN CON GOOGLE — estados "conectando" y "despedida" (premium 16-jul)
   ========================================================================== */
/* Mientras Google trabaja: el modal baja la luz y respira, con aviso claro. */
.auth-overlay--connecting .auth-modal {
  opacity: 0.75;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.auth-overlay--connecting .auth-google {
  position: relative;
  animation: authGooglePulse 1.1s ease-in-out infinite;
}
.auth-overlay--connecting .auth-google span { visibility: hidden; }
.auth-overlay--connecting .auth-google::after {
  content: "Conectando con Google…";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
@keyframes authGooglePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
/* Éxito: el modal entero se despide con un fundido en vez de esfumarse. */
.auth-overlay--bye {
  opacity: 0;
  transition: opacity 240ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .auth-overlay--connecting .auth-google { animation: none; }
}

/* =============================================================================
   🎯 ASISTENTE DE META (goal-setup.js) — mismo vestido que el login
   ========================================================================== */
.goal-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 14px;
}
.goal-pills--col { grid-template-columns: 1fr; }
.goal-pill {
  padding: 13px 10px;
  border: 1.5px solid #e2e5ea;
  border-radius: 12px;
  background: #fff;
  font-weight: 800; font-size: 15px;
  color: #1a1d24;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.goal-pill small { display: block; font-weight: 600; font-size: 12px; color: #6b7280; }
.goal-pill:active { transform: scale(0.96); }
.goal-pill.is-on {
  border-color: var(--auth-purple);
  background: rgba(138, 43, 226, 0.08);
  color: var(--auth-purple);
}
.goal-pill.is-on small { color: var(--auth-purple); opacity: 0.8; }
.goal-math {
  margin: 0 0 14px;
  text-align: center;
  font-size: 13.5px; color: #6b7280;
}
.goal-math b { color: var(--auth-purple); }
.goal-time {
  width: 100%; box-sizing: border-box;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1.5px solid #e2e5ea; border-radius: 12px;
  font-size: 15px;
}

/* Marcador de hora exacta − / + (goal-setup "Otra hora…") */
.goal-stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  margin: 4px 0 14px;
}
.goal-stepper__btn {
  position: relative;
  width: 48px; height: 48px;
  border: 1.5px solid #e2e5ea; border-radius: 50%;
  background: #fff;
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.goal-stepper__btn:active { transform: scale(0.9); background: rgba(138,43,226,.08); }
/* Las HUELLAS mandan (pedido de Axel): la patita es el botón, y un −/+
   pequeñito en la esquina chiva la dirección. */
.goal-stepper__btn i {
  position: absolute; top: -4px; right: -2px;
  width: 19px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--auth-purple);
  color: #fff;
  font-style: normal; font-weight: 900; font-size: 0.8rem;
  box-shadow: 0 2px 5px rgba(138, 43, 226, 0.4);
}
.goal-stepper__hora {
  min-width: 92px;
  text-align: center;
  font-size: 1.7rem; font-weight: 900;
  color: var(--auth-purple);
  font-variant-numeric: tabular-nums;
}

/* FONDO ÚNICO DEL ONBOARDING = el del login de Gmail (Axel, 17-jul): morado
   oscuro + brillo arriba + huellas ESTÁTICAS (textura) + huellas CAMINANDO.
   Meta y bienvenida comparten fondo para que el flujo no cambie de color.
   Fuera del onboarding (meta desde el menú de ajustes) conservan su gradiente. */
.goal-setup,
.wc-overlay {
  background:
    radial-gradient(80% 55% at 50% 30%, rgba(168,90,240,.55) 0%, rgba(168,90,240,0) 60%),
    linear-gradient(160deg, #2b1e46 0%, #1d1435 55%, #120c22 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.goal-setup .auth-paws,
.wc-overlay .auth-paws { z-index: 1; }
.goal-setup .auth-modal,
.wc-overlay .wc-card { position: relative; z-index: 2; }

/* FONDO FIJO del onboarding (body.pa-onboarding): un lienzo OPACO que se queda
   puesto TODO el flujo, DEBAJO de las pantallas. Mata el "flash del menú" en
   los cruces (cuando meta y bienvenida se funden, el menú ya no asoma) y trae
   la textura de HUELLAS ESTÁTICAS que faltaba (cazado por Axel, 17-jul). */
/* CAPA CLAVE: por ENCIMA del menú (header z100, contenido z1) pero por DEBAJO
   de TODOS los modales del onboarding (avatar 300, meta 9500, bienvenida 9800).
   Con z alto tapaba el selector de avatar y el flujo se quedaba en morado
   (cazado por Axel, 17-jul). */
body.pa-onboarding::before {
  content: "";
  position: fixed; inset: 0; z-index: 240; pointer-events: none;
  background:
    radial-gradient(80% 55% at 50% 30%, rgba(168,90,240,.55) 0%, rgba(168,90,240,0) 60%),
    linear-gradient(160deg, #2b1e46 0%, #1d1435 55%, #120c22 100%);
}
/* La textura de huellas estáticas (misma tesela y opacidad que el login). */
body.pa-onboarding::after {
  content: ""; position: fixed; inset: 0; z-index: 241; pointer-events: none;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><g fill='%23FFFFFF' fill-opacity='0.06'><ellipse cx='38' cy='42' rx='7.2' ry='6'/><ellipse cx='29.2' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='34.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='41.5' cy='29.2' rx='2.4' ry='3.2'/><ellipse cx='46.8' cy='33.2' rx='2.7' ry='3.5'/><ellipse cx='150' cy='120' rx='7.2' ry='6'/><ellipse cx='141.2' cy='111.2' rx='2.7' ry='3.5'/><ellipse cx='146.5' cy='107.2' rx='2.4' ry='3.2'/><ellipse cx='153.5' cy='107.2' rx='2.4' ry='3.2'/><ellipse cx='158.8' cy='111.2' rx='2.7' ry='3.5'/><ellipse cx='40' cy='165' rx='7.2' ry='6'/><ellipse cx='31.2' cy='156.2' rx='2.7' ry='3.5'/><ellipse cx='36.5' cy='152.2' rx='2.4' ry='3.2'/><ellipse cx='43.5' cy='152.2' rx='2.4' ry='3.2'/><ellipse cx='48.8' cy='156.2' rx='2.7' ry='3.5'/></g></svg>");
  background-size: 200px 200px;
}
/* Con el lienzo fijo puesto, las pantallas van TRANSPARENTES (flotan sobre él):
   así el fondo es idéntico en todas y los cruces no dejan ver el menú. */
body.pa-onboarding .goal-setup,
body.pa-onboarding .wc-overlay {
  background: transparent !important;
}
