/* === Sistema de diseño del prototipo «Gym App» — copiado VERBATIM (s142). NO editar a mano salvo tokens. === */
/* Componentes: topbar, bottomnav/rail, stepper, sheet, toast, confetti, onboarding, swatches */
/* ════════════════════════════════════════════════════════════
   GYM · estilos de componentes y pantallas
   ════════════════════════════════════════════════════════════ */

/* ── Top bar ────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px 8px; gap: 12px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-pill);
  display: grid; place-items: center; background: var(--surface-2);
  color: var(--text-2); border: 1px solid var(--line); transition: all .15s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn:active { transform: scale(.92); }

/* ── Bottom nav ─────────────────────────────────────────────── */
.bottomnav {
  display: flex; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  gap: 4px;
}
.navbtn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 0; color: var(--text-3); border-radius: var(--r-md);
  font-size: 11px; font-weight: 500; transition: color .15s;
}
.navbtn[data-on="true"] { color: var(--accent); }
.navbtn:active { transform: scale(.94); }
.navbtn .fab {
  width: 58px; height: 58px; margin-top: -26px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  box-shadow: 0 10px 26px -8px var(--accent), 0 0 0 5px var(--bg);
  transition: transform .15s var(--ease-bounce);
}
.navbtn .fab:active { transform: scale(.9); }
.nav-settings { display: none; } /* solo visible en el rail lateral (tablet/PC/TV) */
.rail-brand { display: none; } /* rótulo de marca: solo en el rail lateral */

/* ── Stepper ────────────────────────────────────────────────── */
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper-btn {
  width: 52px; height: 52px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text); display: grid; place-items: center;
  border: 1px solid var(--line-2); transition: all .12s var(--ease); flex-shrink: 0;
  /* El paso se confirma en click (ya no hay preventDefault en pointerdown):
     evitar selección del glifo en long-press y el retardo de doble tap. */
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.stepper-btn:hover { background: var(--surface-3); }
.stepper-btn:active { transform: scale(.88); background: var(--accent); color: var(--accent-ink); }
.stepper-big .stepper-btn { width: 66px; height: 66px; }
.stepper-val { flex: 1; text-align: center; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.stepper-val .display { font-size: 46px; }
.stepper-big .stepper-val .display { font-size: 64px; }
.stepper-suffix { font-size: 16px; color: var(--text-3); }

/* ── Bottom sheet ───────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center;
  animation: fadeUp .25s var(--ease);
}
.sheet-backdrop .sheet {
  max-width: min(460px, 100%);
}
.sheet {
  width: 100%; max-height: 86%; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line-2); display: flex; flex-direction: column;
  animation: sheetUp .34s var(--ease); box-shadow: var(--shadow-pop);
}
.sheet-full { max-height: 94%; height: 94%; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 10px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 8px; }
.sheet-title { font-size: 19px; font-weight: 600; }
.sheet-body { padding: 6px 22px 26px; overflow-y: auto; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: absolute; left: 50%; top: 78px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow-pop);
  animation: toastIn .4s var(--ease-bounce);
  width: max-content; max-width: min(calc(100% - 32px), 420px); box-sizing: border-box;
  white-space: normal; text-align: center; line-height: 1.4; overflow-wrap: anywhere; word-break: break-word;
}
@keyframes toastIn { from { transform: translate(-50%, -16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ── Confetti ───────────────────────────────────────────────── */
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti span { position: absolute; top: -20px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(120vh) rotate(540deg); opacity: .2; } }

/* ════════════════════════════════════════════════════════════
   ONBOARDING
   ════════════════════════════════════════════════════════════ */
.ob { height: 100%; display: flex; flex-direction: column; padding: 0 26px; }
.ob-top { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 30px; }
.ob-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.ob-title { font-family: var(--font-display); font-size: clamp(54px, 16vw, 78px); line-height: .86; margin-bottom: 18px; }
.ob-sub { color: var(--text-2); font-size: 16px; line-height: 1.5; max-width: 30ch; }
.ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.ob-opt {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; transition: all .18s var(--ease); position: relative;
}
.ob-opt:active { transform: scale(.97); }
.ob-opt[data-on="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ob-opt-emoji { font-size: 28px; display: block; margin-bottom: 10px; }
.ob-opt-t { font-weight: 600; font-size: 15px; margin-bottom: 3px; }

/* Valoración esfuerzo (estrellas) */
.star-rating { display: flex; flex-direction: column; gap: 8px; }
.star-rating-row {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
}
.star-rating-btn {
  width: 48px; height: 48px; border: none; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-3);
  font-size: 28px; line-height: 1; cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s, color 0.15s;
}
.star-rating-btn:hover { background: var(--surface-3); }
.star-rating-btn:active { transform: scale(0.92); }
.star-rating-btn[data-on="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  text-shadow: 0 0 12px color-mix(in oklab, var(--accent) 50%, transparent);
}
.star-rating-hint {
  text-align: center; font-size: 13px; color: var(--text-3); min-height: 1.2em;
}

.motiv-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.motiv-chip {
  padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-2); font-size: 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.motiv-chip[data-on="true"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--text);
}
.motiv-chip:active { transform: scale(0.97); }
.ob-motiv-actions { margin-top: 12px; }
.ob-motiv-hint { font-size: 13px; color: var(--text-3); margin-bottom: 10px; line-height: 1.45; }

.ob-opt-d { font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.ob-opt-check {
  position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  opacity: 0; transform: scale(.5); transition: all .2s var(--ease-bounce);
}
.ob-opt[data-on="true"] .ob-opt-check { opacity: 1; transform: scale(1); }
.ob-foot { padding: 16px 0 calc(24px + env(safe-area-inset-bottom)); }
.ob-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 16px; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: all .3s var(--ease); }
.ob-dot[data-on="true"] { background: var(--accent); width: 22px; border-radius: 4px; }

/* swatches de tema/acento */
.swatch-row { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch {
  width: 56px; height: 56px; border-radius: var(--r-md); border: 2px solid var(--line-2);
  position: relative; transition: transform .15s var(--ease); overflow: hidden;
}
.swatch:active { transform: scale(.9); }
.swatch[data-on="true"] { border-color: var(--accent); }
.swatch-dot { width: 30px; height: 30px; border-radius: 50%; }
.theme-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--surface-2); width: 100%; text-align: left;
  transition: all .15s var(--ease);
}
.theme-card[data-on="true"] { border-color: var(--accent); }
.theme-card:active { transform: scale(.98); }
.theme-prev { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; border: 1px solid var(--line); }
