/*  ─── Design Tokens ─────────────────────────────────────────
 *  Change a color once here → every page updates.
 *  Pages can still override with local <style> blocks.
 *  ──────────────────────────────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg-body:      #0e1420;
  --bg-card:      #151e2d;
  --bg-nav:       #0a0f1a;
  --bg-input:     #0e1420;
  --bg-hover:     #1e293b;

  /* Borders */
  --border:       #2a3546;
  --border-light: #1a2433;
  --border-hover: #4a5568;

  /* Text */
  --text:         #e2e8f0;
  --text-sec:     #cbd5e0;
  --text-muted:   #7b8699;
  --text-dim:     #4a5568;
  --text-faint:   #3a4255;

  /* Accent */
  --accent:       #63b3ed;
  --accent-hover: #4299e1;
  --accent-bg:    rgba(99,179,237,0.08);

  /* Status */
  --success:      #68d391;
  --success-hover:#48bb78;
  --success-bg:   rgba(104,211,145,0.08);
  --warning:      #f6ad55;
  --warning-bg:   rgba(246,173,85,0.08);
  --danger:       #fc8181;
  --danger-bg:    rgba(252,129,129,0.08);

  /* Brand */
  --strava:       #FC4C02;

  /* Typography */
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'SF Mono', Monaco, Consolas, monospace;

  /* Radii */
  --radius-sm:    6px;
  --radius:       8px;
  --radius-md:    10px;
  --radius-lg:    12px;
  --radius-xl:    14px;
  --radius-2xl:   16px;
}


/*  ─── Shared Reset ──────────────────────────────────────────  */

*, *::before, *::after { box-sizing: border-box }
body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}


/*  ─── Navigation ────────────────────────────────────────────  */

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav .nav-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
}
.site-nav .nav-breadcrumb .nav-current {
  color: var(--text-sec);
}
.site-nav .nav-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.site-nav .nav-athletes {
  display: flex;
  gap: 8px;
}
.site-nav .nav-btn {
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hover);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  color: var(--text-sec);
  transition: all 0.15s;
}
.site-nav .nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.site-nav .nav-btn.active {
  background: #fff;
  color: var(--bg-body);
  border-color: #fff;
}


/*  ─── Footer ────────────────────────────────────────────────  */

.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  padding: 30px 0 12px;
  border-top: 1px solid var(--border);
  margin-top: 30px;
}
.site-footer .disclaimer {
  margin-top: 12px;
  font-size: 10px;
  color: var(--text-faint);
  line-height: 1.5;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}


/*  ─── Shared Form Elements ──────────────────────────────────  */

.site-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.site-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.site-input,
.site-select,
.site-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.site-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237b8699' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.site-input:focus,
.site-select:focus,
.site-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.site-textarea {
  resize: vertical;
  min-height: 100px;
}


/*  ─── Badge ─────────────────────────────────────────────────  */

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.badge-new {
  background: var(--success);
  color: var(--bg-body);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-left: 8px;
  vertical-align: middle;
}
.badge-red    { background: rgba(252,129,129,0.15); color: var(--danger);  border: 1px solid rgba(252,129,129,0.3); }
.badge-amber  { background: rgba(246,173,85,0.15);  color: var(--warning); border: 1px solid rgba(246,173,85,0.3);  }
.badge-green  { background: rgba(104,211,145,0.15); color: var(--success); border: 1px solid rgba(104,211,145,0.3); }


/*  ─── Cards ─────────────────────────────────────────────────  */

.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.site-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.site-card .desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}


/*  ─── Privacy Notice Banner ─────────────────────────────────  */

.privacy-notice {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.privacy-notice strong {
  color: var(--text-sec);
}


/*  ─── Feeling Scale ─────────────────────────────────────────  */

.feeling-scale {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.feeling-btn {
  flex: 1;
  padding: 10px 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.feeling-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-sec);
}
.feeling-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.feeling-btn .emoji {
  font-size: 20px;
  display: block;
  margin-bottom: 2px;
}


/*  ─── Choice / Toggle Buttons ───────────────────────────────  */

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.choice-btn {
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  flex: 1;
  min-width: calc(50% - 4px);
}
.choice-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-sec);
}
.choice-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.choice-btn.small {
  padding: 8px 12px;
  min-width: auto;
  flex: 0 1 auto;
}
.choice-btn .icon {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}


/*  ─── Option Cards ──────────────────────────────────────────  */

.option-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.option-card {
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.option-card:hover { border-color: var(--border-hover); }
.option-card.selected {
  border-color: var(--accent);
  background: rgba(99,179,237,0.06);
}
.option-card .oc-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.option-card .oc-text h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
}
.option-card .oc-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}
.option-card.selected .oc-text h3 { color: var(--accent); }


/*  ─── Check Grid (multi-select) ─────────────────────────────  */

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.check-item {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.check-item:hover {
  border-color: var(--border-hover);
  color: var(--text-sec);
}
.check-item.checked {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
}


/*  ─── Race Cards (Landing Page) ─────────────────────────────  */

.race-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (min-width: 768px) {
  .race-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

.race-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: transform 0.15s, border-color 0.15s;
}
.race-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.race-card-empty {
  opacity: 0.6;
}
.race-card-empty:hover {
  opacity: 0.8;
}

.rc-header { margin-bottom: 16px; }
.rc-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.rc-meta {
  font-size: 13px;
  color: var(--text-muted);
}
.rc-countdown {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
  padding: 3px 10px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
}
.rc-countdown.rc-past {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
}

/* Athlete chips inside race card */
.rc-athletes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.rc-athlete-link,
.rc-athlete-nolink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s;
}
.rc-athlete-link:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.rc-athlete-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.rc-athlete-link:hover .rc-athlete-name {
  color: var(--accent);
}
.rc-athlete-distance {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

.rc-empty-msg {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 14px;
}

/* Distance tags */
.rc-distances {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rc-dist-tag {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}


/*  ─── Responsive ────────────────────────────────────────────  */

@media (max-width: 480px) {
  .choices { flex-direction: column; }
  .choice-btn { min-width: 100%; }
  .feeling-scale { flex-wrap: wrap; }
  .feeling-btn { min-width: calc(33% - 4px); }
}
