/* ================= ESPARTANOS · APP DE SOCIOS =================
   Misma paleta y tipografía que la web (styles.css + tipografia.css). */
:root {
  --black: #0a0a0a; --black-2: #141414; --black-3: #1d1d1d;
  --red: #d3141c; --red-2: #ec1a23; --red-deep: #9e0d13;
  --yellow: #ffc61a; --gold: #b68d57; --white: #fff;
  --muted: #a3a3a3; --line: rgba(255,255,255,.1);
  --ok: #2bb673; --warn: #ff9a1a; --bad: #ff4b4b;
  --font: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--black); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--black); color: var(--white); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 8px; }
.boot { text-align: center; color: var(--muted); padding-top: 42vh; margin: 0; }
.red { color: var(--red); }
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after { content: ""; position: absolute; left: -3px; right: -3px; bottom: .06em; height: .3em; background: var(--yellow); z-index: -1; transform: skewX(-12deg); }
.muted { color: var(--muted); }
.kicker { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--yellow); }

/* ---------- Botones (como la web) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 14px 24px; border-radius: 999px; border: 2px solid transparent; background: var(--red); color: var(--white); font-weight: 700; font-size: 13.5px; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .2s, transform .15s, box-shadow .2s; line-height: 1.2; text-align: center; }
.btn:hover { background: var(--red-2); box-shadow: 0 14px 34px -12px rgba(211,20,28,.75); }
.btn:active { transform: scale(.98); }
.btn--block { width: 100%; }
.btn--line { background: transparent; border-color: rgba(255,255,255,.28); }
.btn--line:hover { background: rgba(255,255,255,.06); box-shadow: none; }
.btn--wa { background: #1fae5b; }
.btn--wa:hover { background: #22c063; box-shadow: 0 14px 34px -12px rgba(31,174,91,.7); }
.btn--sm { min-height: 40px; padding: 9px 16px; font-size: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link { background: none; border: 0; padding: 6px 2px; color: var(--white); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link--muted { color: var(--muted); font-weight: 500; }

/* ---------- Pantallas de entrada ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(28px + var(--safe-top)) 16px calc(28px + var(--safe-bottom)); background: radial-gradient(90% 55% at 50% 0%, #3a0b0d, var(--black) 70%); }
.auth__card { width: 100%; max-width: 420px; }
.auth__logo { width: 150px; margin: 0 auto 22px; }
.auth h1 { font-size: 34px; text-align: center; margin-bottom: 8px; }
.auth .sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.auth__alt { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: 15px; }

.f { display: block; margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.f input { display: block; width: 100%; margin-top: 7px; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--black-3); font-size: 17px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--white); }
.f input:focus { outline: 2px solid var(--yellow); outline-offset: 1px; }
.f small { display: block; margin-top: 6px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; }
.pw { position: relative; }
.pw input { padding-right: 76px; }
.pw button { position: absolute; right: 8px; bottom: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.err { color: var(--bad); font-size: 14.5px; min-height: 1.4em; margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Selector de plan ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.plan { position: relative; text-align: left; padding: 16px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--black-2); cursor: pointer; transition: border-color .2s, background .2s; }
.plan b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.plan span { display: block; margin-top: 6px; font-weight: 600; font-size: 14.5px; }
.plan small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.plan.on { border-color: var(--red); background: linear-gradient(160deg, rgba(211,20,28,.22), var(--black-2) 70%); }
.plan.on::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.note { padding: 14px 16px; border-radius: 14px; background: rgba(255,198,26,.08); border: 1px solid rgba(255,198,26,.25); color: #f3e2b0; font-size: 14.5px; margin: 0 0 18px; }

/* ---------- App ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-top)) 16px 10px; background: rgba(10,10,10,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top img { width: 44px; }
.top__t { flex: 1; min-width: 0; }
.top__t b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__t span { display: block; font-size: 13px; color: var(--muted); }
.page { max-width: 520px; margin: 0 auto; padding: 18px 16px calc(40px + var(--safe-bottom)); }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 8px 0; background: none; border: 0; color: var(--muted); font-weight: 600; cursor: pointer; }

/* Tarjeta de membresía */
.card { position: relative; overflow: hidden; border-radius: 26px; padding: 22px 22px 20px; background: linear-gradient(150deg, #2a0a0c 0%, #141414 55%, #0e0e0e 100%); border: 1px solid rgba(211,20,28,.35); box-shadow: 0 30px 60px -30px rgba(211,20,28,.55); }
.card::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(211,20,28,.35), transparent 70%); pointer-events: none; }
.card__top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card__top img { width: 64px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.card__name { position: relative; margin: 16px 0 0; font-size: 22px; font-weight: 700; }
.card__id { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.days { position: relative; display: flex; align-items: flex-end; gap: 12px; margin: 22px 0 6px; }
.days b { font-size: 86px; font-weight: 800; line-height: .82; letter-spacing: -.05em; }
.days span { padding-bottom: 6px; font-size: 16px; font-weight: 600; line-height: 1.2; color: #e6e6e6; }
.days--word b { font-size: 46px; letter-spacing: -.03em; }
.vence { position: relative; margin: 0; color: #d6d6d6; }
.vence strong { color: var(--white); }
.bar { position: relative; height: 8px; margin: 16px 0 4px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--yellow)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.card.is-warn .days b { color: var(--yellow); }
.card.is-bad { border-color: rgba(255,75,75,.4); }
.card.is-bad .days b { color: var(--bad); }
.card.is-pending .days b { color: var(--yellow); }

.actions { display: grid; gap: 10px; margin: 18px 0 0; }

/* Aviso de solicitud */
.req { margin: 18px 0 0; padding: 18px; border-radius: 20px; background: var(--black-2); border: 1px solid rgba(255,198,26,.35); }
.req h3 { font-size: 18px; margin: 0 0 6px; }
.req p { margin: 0 0 14px; color: #d6d6d6; font-size: 15px; }
.req .row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* Bloques */
.sec { margin: 30px 0 12px; font-size: 20px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 16px; border-radius: 18px; background: var(--black-2); border: 1px solid var(--line); }
.stat b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; padding: 16px; border-radius: 18px; background: var(--black-2); border: 1px solid var(--line); }
.heat__lbl { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.heat__cell { aspect-ratio: 1; border-radius: 6px; background: rgba(255,255,255,.07); }
.heat__cell.on { background: var(--red); box-shadow: 0 0 12px rgba(211,20,28,.5); }
.heat__cell.today { outline: 2px solid var(--yellow); outline-offset: 1px; }
.heat__cell.off { opacity: .25; }
.list { list-style: none; margin: 10px 0 0; padding: 0; border-radius: 18px; background: var(--black-2); border: 1px solid var(--line); overflow: hidden; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.list li:first-child { border-top: 0; }
.list li span:last-child { color: var(--muted); }
.empty { padding: 18px; border-radius: 18px; background: var(--black-2); border: 1px dashed var(--line); color: var(--muted); text-align: center; margin: 10px 0 0; }
.acct { margin: 10px 0 0; padding: 6px 16px; border-radius: 18px; background: var(--black-2); border: 1px solid var(--line); }
.acct div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.acct div:first-child { border-top: 0; }
.acct div span { color: var(--muted); }
.acct div b { font-weight: 600; text-align: right; word-break: break-word; }

/* Instalar */
.install { display: flex; gap: 14px; align-items: center; margin: 18px 0 0; padding: 14px 16px; border-radius: 18px; background: linear-gradient(120deg, rgba(211,20,28,.18), var(--black-2)); border: 1px solid rgba(211,20,28,.3); }
.install img { width: 46px; border-radius: 12px; }
.install div { flex: 1; font-size: 14.5px; }
.install b { display: block; font-size: 15.5px; }
.install .x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; padding: 4px 6px; }

.foot { margin: 34px 0 0; text-align: center; color: #6f6f6f; font-size: 13px; }
.foot a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(22px + var(--safe-bottom)); z-index: 60; transform: translate(-50%, 30px); opacity: 0; visibility: hidden; pointer-events: none; max-width: calc(100% - 32px); padding: 13px 20px; border-radius: 999px; background: var(--white); color: var(--black); font-weight: 600; font-size: 15px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.6); transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s, visibility .3s; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
