/* App pages: join, login, account, admin, waiver. */

.app main { padding: calc(var(--bar-h) + 32px) clamp(16px, 4vw, 40px) 80px; max-width: 1100px; margin: 0 auto; }
.app .demo-banner + main { padding-top: 32px; }
.app h1, .app h2, .app h3 { font-family: var(--sc-font-display); font-weight: 800; text-transform: uppercase; line-height: 0.98; margin: 0; letter-spacing: 0.005em; }
.app h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.app h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.app h3 { font-size: 1.35rem; }
.lede { color: var(--sc-ink-soft); font-size: 1.1rem; margin: 10px 0 0; max-width: 60ch; }
.gold { color: var(--gold); }

.panel { background: var(--sc-surface); border-radius: 10px; padding: clamp(18px, 3vw, 32px); box-shadow: 0 14px 34px rgba(5, 2, 3, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.spacer { height: 28px; }
.muted { color: var(--sc-ink-soft); }
.small { font-size: 0.88rem; }
hr.rule { border: 0; border-top: 1px solid rgba(246, 239, 230, 0.12); margin: 8px 0; }

/* steps */
.steps { display: flex; gap: 6px; margin: 22px 0 26px; padding: 0; list-style: none; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; font-family: var(--sc-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.95rem; color: var(--sc-ink-soft); padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(246, 239, 230, 0.05); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(246, 239, 230, 0.1); font-size: 0.9rem; }
.steps li.is-now { color: var(--sc-accent-ink); background: var(--gold); }
.steps li.is-now::before { background: rgba(23, 13, 14, 0.2); }
.steps li.is-done { color: var(--bone); }
.steps li.is-done::before { content: "✓"; background: var(--burgundy); }

/* plan picker */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plans label { position: relative; display: grid; gap: 4px; padding: 16px 16px 16px 48px; border-radius: 8px; border: 1px solid rgba(246, 239, 230, 0.2); cursor: pointer; transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out); }
.plans label:hover { border-color: rgba(212, 169, 79, 0.6); }
.plans input { position: absolute; left: 16px; top: 18px; width: 20px; height: 20px; accent-color: var(--gold); }
.plans label:has(input:checked) { border-color: var(--gold); background: rgba(212, 169, 79, 0.08); }
.plans b { font-family: var(--sc-font-display); font-size: 1.3rem; text-transform: uppercase; letter-spacing: 0.04em; }
.plans span { color: var(--sc-ink-soft); font-size: 0.9rem; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }

/* athlete cards */
.athletes { display: grid; gap: 14px; }
.ath { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px; border-radius: 10px; background: #160e10; border: 1px solid rgba(246, 239, 230, 0.08); }
.ath__name { font-weight: 700; font-size: 1.1rem; }
.ath__meta { color: var(--sc-ink-soft); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.ath__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .ath { grid-template-columns: auto 1fr; } .ath__actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* avatar */
.avatar { position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; background: linear-gradient(135deg, var(--burgundy), #2a0d14); display: grid; place-items: center; font-family: var(--sc-font-display); font-weight: 800; font-size: 1.5rem; color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 169, 79, 0.5); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 104px; height: 104px; font-size: 2.4rem; }
.avatar--sm { width: 40px; height: 40px; font-size: 1rem; }
.avatar-edit { position: relative; display: inline-block; }
.avatar-edit label { position: absolute; right: -4px; bottom: -4px; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--sc-accent-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); font-size: 16px; }
.avatar-edit label:hover { background: #e2bb64; }
.avatar-edit input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-edit input:focus-visible + label { outline: 2px solid var(--bone); outline-offset: 2px; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: rgba(246, 239, 230, 0.08); color: var(--bone); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--active, .pill--preregistered { color: #8fe0b0; background: rgba(79, 176, 122, 0.14); }
.pill--past_due { color: #ffb4a0; background: rgba(226, 56, 47, 0.16); }
.pill--pending_payment { color: #f3dfaa; background: rgba(212, 169, 79, 0.14); }
.pill--canceled, .pill--paused { color: #c2b0a6; background: rgba(194, 176, 166, 0.12); }

/* waiver */
.waiver { max-height: 360px; overflow: auto; padding: 18px 20px; border-radius: 8px; background: #f6efe6; color: #1b1112; font-size: 0.95rem; line-height: 1.55; }
.waiver--full { max-height: none; padding: clamp(20px, 4vw, 48px); }
.waiver h2.waiver__title { font-family: var(--sc-font-text); text-transform: none; font-size: 1.15rem; font-weight: 800; color: #1b1112; line-height: 1.3; }
.waiver--full h2.waiver__title { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.waiver h3 { font-family: var(--sc-font-text); text-transform: none; font-size: 1rem; font-weight: 800; margin: 18px 0 4px; color: var(--burgundy); }
.waiver p { margin: 0 0 6px; }
.waiver__meta { color: #6a5a52; font-size: 0.85rem; }
.waiver__ack { font-weight: 800; margin-top: 18px !important; }
.sign { display: grid; gap: 14px; padding: 18px; border-radius: 10px; border: 1px solid rgba(212, 169, 79, 0.35); background: rgba(212, 169, 79, 0.04); }
.sign__sig input { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.5rem; }

/* tabs (admin) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(246, 239, 230, 0.12); margin: 22px 0 22px; overflow-x: auto; }
.tabs button { font-family: var(--sc-font-display); font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sc-ink-soft); background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--bone); }
.tabs button[aria-selected="true"] { color: var(--gold); border-color: var(--gold); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: 10px; background: var(--sc-surface); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.stat b { display: block; font-family: var(--sc-font-display); font-weight: 900; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--sc-ink-soft); font-size: 0.9rem; }
.stat--gold b { color: var(--gold); }
.stat--alert b { color: #ff8a80; }

.table-wrap { overflow-x: auto; border-radius: 10px; background: var(--sc-surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.t th { text-align: left; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sc-ink-soft); padding: 12px 14px; border-bottom: 1px solid rgba(246, 239, 230, 0.1); white-space: nowrap; }
.t td { padding: 10px 14px; border-bottom: 1px solid rgba(246, 239, 230, 0.06); vertical-align: middle; }
.t tbody tr { cursor: pointer; transition: background-color 120ms var(--ease-out); }
.t tbody tr:hover { background: rgba(212, 169, 79, 0.06); }
.t .who { display: flex; align-items: center; gap: 10px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .field { min-width: 160px; }
.filters .field:first-child { flex: 1; min-width: 220px; }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer.is-open { display: block; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(5, 2, 3, 0.6); }
.drawer__panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(480px, 100vw); overflow-y: auto; background: #170f11; padding: 24px; box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5); display: grid; align-content: start; gap: 16px; animation: drawerIn 260ms var(--ease-out); }
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } }
.drawer__close { justify-self: end; }

.announce { display: grid; gap: 12px; }
.announce article { padding: 14px 16px; border-radius: 8px; background: #160e10; border-left: 1px solid var(--gold); }
.announce h3 { font-size: 1.15rem; }
.announce p { margin: 6px 0 0; color: var(--sc-ink-soft); }
.announce time { font-size: 0.8rem; color: var(--sc-ink-soft); }

.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 90; background: var(--bone); color: #1b1112; padding: 12px 18px; border-radius: 8px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: drawerIn 220ms var(--ease-out); }
.center-card { max-width: 460px; margin: 0 auto; }
.success { text-align: center; display: grid; gap: 14px; justify-items: center; }
.success .big { font-family: var(--sc-font-display); font-weight: 900; font-size: 4rem; color: var(--gold); line-height: 1; }
