/* ═══════════════════════════════════════════════════════════════
 *  5BAR DESIGN SYSTEM — STANDALONE PAGES
 *  Styles hoisted out of per-page <style> blocks so every design
 *  decision lives in /css. Sections are scoped by a body class.
 *  Requires styles.css (which pulls tokens.css + utilities.css).
 * ═══════════════════════════════════════════════════════════════ */

/* ─── Shared: centered single-column page (privacy, legal) ────── */
body.page-centered {
  justify-content: center;
  padding: var(--space-6) var(--space-3);
}

.legal-agree {
  border-top: var(--rule);
  padding-top: var(--space-3);
  margin-top: var(--space-4);
}

/* ─── OAuth consent + callback (oauth-*.html) ─────────────────── */
body.oauth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: var(--space-4) var(--space-3);
}

.oauth-container { max-width: 480px; width: 100%; }

.oauth-card {
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--space-5);
  text-align: center;
}

.oauth-logo   { font-size: 48px; margin-bottom: var(--space-3); }
.oauth-title  { font-size: 24px; font-weight: 600; margin-bottom: var(--space-2); color: var(--text); }
.oauth-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: var(--space-5); }

.oauth-app-info {
  background: var(--bg);
  border: var(--rule);
  border-radius: var(--radius-sm);
  padding: var(--space-4) 20px;
  margin-bottom: var(--space-4);
  text-align: left;
}

.oauth-app-name { font-weight: 600; font-size: 16px; color: var(--text); margin-bottom: 12px; }

.oauth-permissions { list-style: none; padding: 0; margin: 0; }
.oauth-permissions li {
  padding: var(--space-2) 0;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.oauth-permissions li::before { content: "✓"; color: var(--success); font-weight: bold; }

.oauth-actions { display: flex; gap: 12px; margin-top: var(--space-4); }
.oauth-actions button { flex: 1; padding: 12px; font-size: 15px; font-weight: 500; }

.oauth-signin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: var(--space-2);
  text-decoration: none;
}

.oauth-error {
  background: var(--error-bg);
  border: var(--border-w) solid var(--error);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: var(--space-3);
  color: var(--error);
  font-size: 14px;
}

.oauth-loading { margin: var(--space-4) 0; }
.oauth-loading-note { margin-top: 12px; color: var(--text-muted); font-size: 14px; }

.oauth-user-email { margin-top: var(--space-2); color: var(--text); font-size: 14px; }

.oauth-fine {
  margin-top: var(--space-4);
  font-size: 12px;
  color: var(--text-muted);
}

body.oauth-page .spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Callback interstitial (oauth-google-callback.html) */
body.oauth-page .msg { text-align: center; color: var(--text-muted); font-size: 15px; }
body.oauth-page .msg .spinner { width: 36px; height: 36px; margin: 0 auto var(--space-3); }

.oauth-callback-note {
  font-family: var(--font-body);
  text-align: center;
  padding: var(--space-6) var(--space-3);
  color: var(--text-muted);
}

/* ─── 5bar.club app pages (club/*.html) ───────────────────────────
 * Shared template for every coach-facing club page — login, signup,
 * and the clients dashboard. Mirrors the club-landing brand (aged
 * paper + forest accent) so all club pages read as one product.
 * Mobile-first: nothing overflows the viewport, header never collides.
 * ───────────────────────────────────────────────────────────────── */
body.club-page,
body.club-login-page {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: var(--leading-body);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ── Coach dock (reuses the athlete app shell: .sidebar / .content /
 *    .menu-toggle / .sidebar-overlay from styles.css). We only adjust the
 *    brand block at the top so it carries the 5bar.club wordmark. ──────── */
.club-page .logo {
  height: auto;
  gap: 0.55rem;
  padding: var(--space-3);
}
.club-dock-brand { text-decoration: none; color: var(--color-ink); }
.club-page .logo .sidebar-logo-img { width: 42px; height: 42px; }
.club-dock-wordmark {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: 0.5px;
}
.club-dock-wordmark span { color: var(--color-strength); }

/* ── Clients dashboard content (center column inside .content) ───────── */
.club-clients {
  width: 100%;
  max-width: 760px;
  min-width: 0; /* flex context; permit shrink so cards ellipsize */
}

/* Responsive client list — cards that never overflow mobile width */
.client-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.client-card {
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--wash-border-10);
  border-radius: var(--radius);
  transition: background 160ms ease, border-color 160ms ease;
}
.client-card:hover {
  background: var(--surface-hover);
  border-color: var(--wash-border-20);
}
.client-card-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.client-name {
  font-weight: 600;
  color: var(--color-ink);
  font-size: 0.95rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-email {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-linked {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.client-card-flags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.club-clients .empty-state,
.club-clients .error-state,
.club-clients .loading {
  text-align: center;
  padding: var(--space-6) 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.club-clients .error-state { color: var(--danger); }

/* ── Login / signup card ─────────────────────────────────────────── */
body.club-login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
}
.club-login-card {
  background: var(--surface);
  border: 1px solid var(--wash-border-18);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 30px var(--wash-border-06);
}
.club-login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-ink);
  text-decoration: none;
}
.club-login-brand img { width: 34px; height: 34px; display: block; }
.club-login-brand .club { color: var(--color-strength); }
.club-login-card .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.club-login-card .google-signin-slot {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.club-login-card .divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.club-login-card .divider::before,
.club-login-card .divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--wash-border-18);
}
.club-otp-form { text-align: left; }
.club-otp-form label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.club-otp-form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--wash-border-20);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem; /* >=16px keeps iOS from zooming on focus */
  background: var(--bg);
  color: var(--text);
  margin-bottom: 0.75rem;
}
.club-otp-form input:focus {
  outline: none;
  border-color: var(--color-strength);
}
.club-otp-form button {
  width: 100%;
  padding: 0.7rem;
  background: var(--accent);
  color: var(--color-paper);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.club-otp-form button:hover { background: var(--accent-hover); }
.club-otp-form button:disabled { opacity: 0.5; cursor: not-allowed; }
.club-verify-group { margin-top: 0.75rem; }
.club-login-status {
  margin-top: 0.75rem;
  font-size: var(--fs-sm);
  color: var(--danger);
  min-height: 1.2rem;
}
.club-login-status--info { color: var(--text-muted); }
.club-back-link {
  display: block;
  margin-top: 1.25rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
}
.club-back-link:hover { color: var(--text); }

/* ─── Athlete detail page (club/client-detail.html) #584 ─────── */
.wf-page { padding: 4px 0 40px; max-width: 1120px; font-family: var(--font-body); color: var(--color-ink); }
.wf-row { display: grid; gap: 16px; margin-bottom: 16px; }
.wf-g2 { grid-template-columns: 1fr 1fr; }
.wf-span-2 { grid-column: 1 / -1; }
.wf-g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
  .wf-g2, .wf-g3 { grid-template-columns: 1fr; }
}
.wf-idhead { display: flex; gap: 18px; margin-bottom: 22px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--wash-border-10); border-radius: var(--radius); }
.wf-avatar { width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--color-strength); color: var(--color-paper); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 24px; flex: none; }
.wf-idhead h2 { font-family: var(--font-heading); font-size: 24px; margin: 0 0 4px; font-weight: 400; }
.wf-meta { color: var(--text-muted); font-size: var(--fs-sm); }
.wf-meta .dot { margin: 0 8px; color: var(--dot-sep); }
.wf-idhead-body { flex: 1; min-width: 0; }
.wf-idhead-sub { margin-top: 4px; }
/* Card base — every panel gets a consistent surface */
.wf-card {
  background: var(--surface);
  border: 1px solid var(--wash-border-10);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.wf-lbl { font-family: var(--font-heading); font-size: var(--fs-sm); font-weight: 400; color: var(--text-muted); margin: 0 0 10px; }
.wf-card .wf-stat-unit { font-size: 16px; color: var(--text-muted); }
.wf-card .wf-stat-sub { font-size: var(--fs-sm); color: var(--text-muted); }
.wf-card .wf-adh-detail { margin-top: var(--space-2); font-size: var(--fs-sm); }
.wf-card .wf-adh-last { margin-top: 4px; font-size: var(--fs-sm); }
.wf-card-flag { border-color: var(--chip-bad-border); }
.wf-lbl-flag { color: var(--color-error); }
.wf-flag-item { margin-bottom: 6px; }
.wf-flag-empty { font-size: var(--fs-sm); }
.wf-meter { height: 10px; border-radius: 6px; background: var(--color-paper-warm); overflow: hidden; margin: 12px 0 6px; }
.wf-meter i { display: block; height: 100%; background: var(--meter-fill); width: var(--w, 0%); }
.wf-chip { display: inline-block; font-size: var(--fs-xs); padding: 3px 9px; border-radius: var(--radius-pill); border: 1px solid var(--dot-sep); color: var(--text-muted); }
.wf-chip-ok { background: var(--acwr-sweet-bg); border-color: var(--chip-ok-border); color: var(--chip-ok-text); }
.wf-chip-warn { background: var(--cal-low-bg); border-color: var(--chip-warn-border); color: var(--cal-low-text); }
.wf-chip-bad { background: var(--cal-verylow-bg); border-color: var(--chip-bad-border); color: var(--color-error); }
.wf-bars { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; }
.wf-bars .name { font-size: 12px; color: var(--text-muted); text-align: right; }
.wf-track { position: relative; height: 14px; border-radius: 5px; background: var(--color-paper-warm); overflow: hidden; }
.wf-track .cap { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cap-bar); width: var(--w, 0%); }
.wf-track .fat { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, var(--fat-bar), var(--fat-bar) 4px, transparent 4px, transparent 8px); width: var(--w, 0%); }
.wf-legend { display: flex; gap: 16px; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 12px; }
.wf-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.wf-sw-cap { background: var(--cap-bar); }
.wf-sw-fat { background: var(--fat-bar); }
.wf-bars-title { margin-top: 20px; }
.wf-spark { height: 60px; }
.wf-spark-note { font-size: 11px; margin-top: 4px; }
.wf-list .item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--list-rule); }
.wf-list .item:last-child { border-bottom: 0; }
.wf-item .t { font-size: var(--fs-sm); }
.wf-item .s { font-size: 12px; color: var(--text-muted); }
.wf-sectiontitle { font-family: var(--font-heading); font-size: 15px; margin: 28px 0 10px; font-weight: 400; color: var(--text-muted); letter-spacing: 0.03em; text-transform: uppercase; }

/* .detail-tabs' negative margins assume it's nested in a padded .card (its
   original usage, workout-detail). This page places it directly in .wf-page,
   which has no horizontal padding to bleed out of — reset so the tab bar
   stays flush with the identity header and cards above/below it. */
.wf-page .detail-tabs { margin: var(--space-3) 0; }
.wf-empty { font-size: var(--fs-sm); }
.wf-profile-body { font-size: var(--fs-sm); line-height: 1.7; }
.wf-notes-wrap { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.wf-coming-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wf-coming-title { margin: 0; }
.wf-coming-desc { font-size: var(--fs-sm); margin-top: var(--space-2); }
.wf-card.dashed { border-style: dashed; border-color: var(--wash-border-18); background: transparent; }
.wf-item-proposed { background: var(--wash-paper-30); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px; }
.wf-item-accepted { background: var(--acwr-sweet-bg); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px; }
.wf-chip-proposed { background: var(--wash-paper-40); border-color: var(--wash-border-20); color: var(--text-muted); }
.client-card-link { display: block; text-decoration: none; color: inherit; }

/* ─── Invite client section ──────────────────────────────────── */
.invite-section { margin-bottom: 16px; }
.invite-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-strength);
  color: var(--color-paper);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  cursor: pointer;
  letter-spacing: 0.3px;
}
.invite-btn:hover { opacity: 0.9; }
.invite-form {
  background: var(--surface);
  border: 1px solid var(--wash-border-10);
  border-radius: var(--radius);
  padding: 16px;
}
.invite-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wash-border-20);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
  box-sizing: border-box;
}
.invite-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-strength);
}
.invite-actions { display: flex; gap: 8px; }
.invite-send-btn {
  padding: 8px 16px;
  background: var(--color-strength);
  color: var(--color-paper);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.invite-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.invite-cancel-btn {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--wash-border-20);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.invite-status { margin-top: 10px; font-size: var(--fs-sm); min-height: 1.2em; }
.invite-status--ok { color: var(--success); }
.invite-status--error { color: var(--danger); }
