/* =====================================================================
   app/app.css — La app del atleta (usa los tokens de assets/css/gym.css)
   Una columna, navegación inferior, números grandes, una acción por pantalla.
   ===================================================================== */

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* que .boton (inline-flex) no le gane al atributo hidden */
html, body { margin: 0; min-height: 100%; }
body { font-size: 16px; line-height: 1.5; overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 96px); }
.app.sin-barra { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }

/* ---------- Encabezado de cada vista ---------- */
.cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.cabeza .fecha { color: var(--gym-tenue); font-size: .82rem; }
.cabeza h1 { font-size: 1.9rem; line-height: 1.08; margin: 2px 0 0; }

/* ---------- Bloques ---------- */
.bloque { background: var(--gym-superficie); border-radius: 22px; padding: 18px; margin-bottom: 12px; border: 1px solid var(--gym-linea); }
[data-bs-theme="dark"] .bloque { border-color: transparent; }
.bloque .etq { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gym-tenue); font-weight: 600; margin-bottom: 6px; }
.grande { font-family: var(--gym-fuente-num); font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--gym-acento-texto); }
.mediano { font-family: var(--gym-fuente-num); font-size: 1.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lista > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gym-linea); }
.lista > div:last-child { border-bottom: 0; padding-bottom: 0; }
.lista > div:first-child { padding-top: 4px; }
.sub { color: var(--gym-tenue); font-size: .85rem; }
.enlace { background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; min-height: 32px; }
.rejilla2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Botones ---------- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 20px; font-weight: 600; cursor: pointer; background: var(--gym-acento); color: var(--gym-sobre-acento); text-decoration: none; transition: transform .12s ease; white-space: nowrap; min-height: 48px; }
.boton:active { transform: scale(.97); }
.boton[disabled] { opacity: .5; pointer-events: none; }
.boton.ancho { width: 100%; }
.boton.fantasma { background: transparent; color: var(--gym-tinta); border: 1px solid var(--gym-linea); }
.boton.chico { padding: 8px 14px; min-height: 36px; font-size: .85rem; }
.boton.peligro { background: transparent; color: var(--gym-peligro); border: 1px solid color-mix(in srgb, var(--gym-peligro) 35%, transparent); }

/* ---------- Formularios ---------- */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: .82rem; color: var(--gym-tenue); font-weight: 500; margin-bottom: 6px; }
.campo input, .campo select { width: 100%; background: var(--gym-superficie-2); border: 1px solid var(--gym-linea); border-radius: 14px; padding: 13px 14px; outline: none; min-height: 48px; }
.campo input:focus { border-color: var(--gym-acento); }
.segmentos { display: flex; background: var(--gym-superficie-2); border-radius: 999px; padding: 4px; gap: 4px; }
.segmentos button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 9px 10px; font-weight: 600; font-size: .88rem; color: var(--gym-tenue); cursor: pointer; min-height: 40px; }
.segmentos button.on { background: var(--gym-acento); color: var(--gym-sobre-acento); }
/* Muchas opciones (porcentajes): botones angostos para que quepan en un celular de 320 px */
.segmentos.compacto { gap: 2px; }
.segmentos.compacto button { flex: 1 1 0; min-width: 0; padding: 9px 0; font-size: .8rem; }

/* ---------- Ingreso ---------- */
.ingreso { min-height: calc(100dvh - 80px); display: flex; flex-direction: column; justify-content: center; }
.ingreso h1 { font-size: 2.6rem; line-height: 1.02; margin: 28px 0 10px; }
.ingreso .marca-icono { width: 44px; height: 44px; border-radius: 14px; font-size: 1.3rem; }

/* ---------- Estado vacío ---------- */
.vacio { text-align: center; padding: 36px 18px; }
.vacio i { font-size: 2rem; color: var(--gym-acento-texto); }
.vacio h2 { font-size: 1.25rem; margin: 12px 0 6px; }
.vacio p { color: var(--gym-tenue); margin: 0 auto; max-width: 300px; font-size: .92rem; }

/* ---------- Discos (calculadora) ---------- */
.barra-discos { display: flex; align-items: center; justify-content: center; gap: 3px; height: 92px; margin: 14px 0 4px; }
.barra-discos .eje { width: 36px; height: 8px; background: var(--gym-tenue); border-radius: 2px; }
.barra-discos .disco { width: 12px; border-radius: 3px; background: var(--gym-acento); }
.barra-discos .disco.d2 { opacity: .8; } .barra-discos .disco.d3 { opacity: .65; } .barra-discos .disco.d4 { opacity: .5; }
.barra-discos .tope { width: 6px; height: 26px; background: var(--gym-tenue); border-radius: 2px; }

/* ---------- Reservar: días y clases ---------- */
.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px 4px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.dias::-webkit-scrollbar { display: none; }
.dia { flex: 0 0 auto; width: 54px; border: 1px solid var(--gym-linea); background: var(--gym-superficie); border-radius: 18px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; scroll-snap-align: start; color: var(--gym-tenue); }
.dia span { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.dia b { font-family: var(--gym-fuente-num); font-size: 1.25rem; color: var(--gym-tinta); }
.dia.on { background: var(--gym-acento); border-color: transparent; color: var(--gym-sobre-acento); }
.dia.on b { color: var(--gym-sobre-acento); }
.dia.cerrado b { text-decoration: line-through; opacity: .5; }
.clase.pasada { opacity: .55; }
.bloque.mia { border: 1px solid var(--gym-acento) !important; }
.cupo { height: 4px; border-radius: 4px; background: var(--gym-superficie-2); margin: 12px 0 8px; overflow: hidden; }
.cupo span { display: block; height: 100%; background: var(--gym-acento); border-radius: 4px; }
.boton-bloque { text-align: left; cursor: pointer; color: inherit; font: inherit; width: 100%; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '\F282'; font-family: bootstrap-icons; float: right; color: var(--gym-tenue); transition: transform .2s; }
details[open] summary::after { transform: rotate(180deg); }

/* ---------- QR de check-in (pantalla completa, fondo blanco para cualquier brillo) ---------- */
.capa-qr { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; animation: subir .2s ease; }
.capa-qr-caja { background: #fff; color: #0b0b0c; border-radius: 28px; padding: 28px 24px; width: 100%; max-width: 360px; text-align: center; }
.capa-qr-caja .qr svg { width: 100%; height: auto; display: block; }

/* ---------- Barra inferior ---------- */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--gym-bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--gym-linea); padding-bottom: env(safe-area-inset-bottom); }
.barra nav { max-width: 520px; margin: 0 auto; display: flex; }
.barra a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0 8px; font-size: .68rem; color: var(--gym-tenue); text-decoration: none; font-weight: 500; min-height: 56px; }
.barra a i { font-size: 1.25rem; line-height: 1; }
.barra a.on { color: var(--gym-tinta); }
.barra a.on i { color: var(--gym-acento-texto); }
[data-bs-theme="light"] .barra a.on i { color: var(--gym-tinta); }

/* ---------- Avisos flotantes ---------- */
.toast-caja { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 50; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast-gym { background: var(--gym-tinta); color: var(--gym-bg); border-radius: 16px; padding: 12px 16px; font-weight: 500; font-size: .92rem; box-shadow: 0 12px 32px rgba(0,0,0,.25); animation: subir .2s ease; margin-top: 8px; }
.toast-gym.error { background: var(--gym-peligro); color: #fff; }
@keyframes subir { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Carga ---------- */
.esqueleto { background: linear-gradient(90deg, var(--gym-superficie) 0%, var(--gym-superficie-2) 50%, var(--gym-superficie) 100%); background-size: 200% 100%; animation: brillo 1.2s infinite linear; border-radius: 22px; margin-bottom: 12px; }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.visible-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
