/* ============================================================
   Yousuli Performance Hub — Shared Design System
   ============================================================
   Mirrors yousuli.co (the marketing site) so the platform can adopt
   the brand tokens incrementally without a big-bang rewrite.

   Phase 1: this file is loaded but no platform template uses these
   classes yet. Subsequent phases (CSS calculator port, calc hub,
   dashboard re-skin) will pull from here so the visuals converge.

   Source of truth for tokens: /CODING/yousuli main/site/assets/yousuli.css
   Keep the variable names matching that file so HTML pages work
   verbatim across both repos.
   ============================================================ */

:root {
  /* ── Brand palette (yousuli.co) ─────────────────────────────── */
  --ys-navy: #2F2D56;
  --ys-navy-deep: #272561;
  --ys-orange: #FA773C;
  --ys-amber: #F9B233;
  --ys-brown: #8B6755;
  --ys-ink: #1a1830;
  --ys-muted: #595959;
  --ys-line: #EDEDED;
  --ys-bg: #FFFFFF;
  --ys-bg-soft: #F7F6F2;

  /* ── Sport accent colours (Improvement #11) ──────────────────
        Single source of truth for sport stripes on calendar pills,
        rail cards, plan grid entries, and analytics charts. */
  --ys-sport-swim:     #38bdf8;
  --ys-sport-bike:     #fa773c;
  --ys-sport-run:      #22c55e;
  --ys-sport-strength: #8b5cf6;
  --ys-sport-other:    var(--ys-line);

  /* ── Status colours ────────────────────────────────────────── */
  --ys-status-completed: #10b981;
  --ys-status-completed-bg: #ecfdf5;
  --ys-status-missed: #ef4444;
  --ys-status-missed-bg: #fef2f2;
  --ys-status-partial: #f59e0b;
  --ys-status-partial-bg: #fffbeb;
  --ys-status-over: #0284c7;
  --ys-status-over-bg: #f0f9ff;

  /* ── Page palette aliases (kept from earlier scaffolding so
        marketing-site HTML can be pasted in verbatim) ───────── */
  --wf-navy: #2F2D56;
  --wf-navy-2: #272561;
  --wf-teal: #9966FF;          /* yousuli.co button purple */
  --wf-teal-deep: #6059D4;
  --wf-coral: #FA773C;         /* yousuli.co accent orange */
  --wf-coral-deep: #E5512F;
  --wf-mist: #F7F6F2;

  /* ── Type, radii, shadows ───────────────────────────────────── */
  --ys-font-display: 'Futura', 'Trebuchet MS', 'Avenir Next', system-ui, sans-serif;
  --ys-font-body: -apple-system, BlinkMacSystemFont, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;
  --ys-radius: 4px;
  --ys-radius-lg: 10px;
  --ys-shadow: 0 4px 18px rgba(47, 45, 86, 0.08);
  --ys-shadow-lg: 0 12px 40px rgba(47, 45, 86, 0.14);
  --ys-maxw: 1120px;
}

/* ============================================================
   Reset + body defaults
   Scoped under .ys-page so adopting the design system is opt-in
   per template. Existing platform pages stay unaffected until
   they add the .ys-page class on <body> or a wrapper <div>.
   ============================================================ */

.ys-page,
.ys-page * { box-sizing: border-box; }

.ys-page {
  background: var(--ys-bg);
  color: var(--ys-ink);
  font-family: var(--ys-font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.ys-page img { max-width: 100%; height: auto; display: block; }

.ys-page a { color: var(--ys-orange); text-decoration: none; }
.ys-page a:hover { text-decoration: underline; }

.ys-page h1,
.ys-page h2,
.ys-page h3,
.ys-page h4 {
  font-family: var(--ys-font-display);
  color: var(--ys-navy);
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
  font-weight: 600;
}

.ys-page h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: 0.04em; text-transform: uppercase; }
.ys-page h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); text-transform: uppercase; letter-spacing: 0.06em; }
.ys-page h3 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.08em; }

.ys-page p { margin: 0 0 1em; }

/* ============================================================
   Layout — container + section + section-head
   ============================================================ */

.ys-container { max-width: var(--ys-maxw); margin: 0 auto; padding: 0 24px; }

.ys-section { padding: 64px 0; }
.ys-section.alt { background: var(--ys-bg-soft); }

.ys-section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.ys-section-head h2 { color: var(--ys-navy); }
.ys-section-head .ys-rule {
  width: 56px; height: 3px; background: var(--ys-orange);
  margin: 14px auto 18px;
}
.ys-section-head p { color: var(--ys-muted); }

/* Grids */
.ys-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ============================================================
   Hero (used at the top of calculator pages)
   ============================================================ */

.ys-hero {
  background: linear-gradient(135deg, var(--ys-navy) 0%, var(--ys-navy-deep) 100%);
  color: #fff;
  padding: 56px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ys-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(250,119,60,0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(249,178,51,0.12), transparent 45%);
  pointer-events: none;
}
.ys-hero h1 { color: #fff; position: relative; }
.ys-hero .ys-eyebrow {
  display: inline-block;
  font-family: var(--ys-font-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--ys-orange);
  background: rgba(250, 119, 60, 0.12);
  border: 1px solid rgba(250, 119, 60, 0.4);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
  position: relative;
}
.ys-hero p.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 680px; margin: 16px auto 32px;
  color: rgba(255,255,255,0.86);
  position: relative;
}

/* ============================================================
   Buttons
   ============================================================ */

.ys-btn {
  display: inline-block;
  padding: 14px 28px;
  font-family: var(--ys-font-display);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--ys-radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
}
/* Specificity boost: .ys-page a sets a default anchor color, so we need
   .ys-page .ys-btn-* to beat it when buttons are rendered as <a> tags. */
.ys-page .ys-btn-primary,
.ys-page .ys-btn-coral,
.ys-btn-primary,
.ys-btn-coral {
  background: var(--ys-orange);
  color: #fff;
  box-shadow: 0 4px 14px rgba(250, 119, 60, 0.35);
}
.ys-page .ys-btn-primary:hover,
.ys-page .ys-btn-coral:hover,
.ys-btn-primary:hover,
.ys-btn-coral:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(250, 119, 60, 0.45);
  color: #fff;
  text-decoration: none;
}
.ys-page .ys-btn-ghost,
.ys-btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
.ys-page .ys-btn-ghost:hover,
.ys-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.ys-page .ys-btn-dark,
.ys-btn-dark {
  background: var(--ys-navy);
  color: #fff;
}
.ys-page .ys-btn-dark:hover,
.ys-btn-dark:hover { background: var(--ys-navy-deep); color: #fff; text-decoration: none; }

.ys-btn-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; position: relative; }

/* ============================================================
   Cards — generic + numbered step + featured + simple coach card
   ============================================================ */

.ys-card {
  background: #fff;
  border: 1px solid var(--ys-line);
  border-radius: var(--ys-radius-lg);
  padding: 28px;
  box-shadow: var(--ys-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column;
}
.ys-card:hover { transform: translateY(-3px); box-shadow: var(--ys-shadow-lg); }
.ys-card h3 { color: var(--ys-navy); margin-top: 0; }
.ys-card .ys-meta {
  font-size: 0.85rem; color: var(--ys-muted); text-transform: uppercase;
  letter-spacing: 0.12em; margin-bottom: 8px;
}
.ys-card.featured {
  position: relative;
  border-color: var(--wf-coral);
  box-shadow: 0 12px 32px rgba(250, 119, 60, 0.12);
}
.ys-card ul.ys-card-bullets {
  padding-left: 18px;
  margin: 0 0 16px;
  color: var(--ys-muted);
  font-size: 0.95rem;
}
.ys-card ul.ys-card-bullets li { margin-bottom: 6px; }

/* Numbered step (How-to-test patterns) */
.ys-step {
  background: #fff;
  border: 1px solid var(--ys-line);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 6px 20px rgba(47, 45, 86, 0.05);
  position: relative;
}
.ys-step .ys-step-num {
  font-family: var(--ys-font-display);
  font-size: 2.4rem;
  color: var(--wf-coral);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.ys-step h3 { color: var(--ys-navy); font-size: 1.05rem; }
.ys-step p { color: var(--ys-muted); font-size: 0.95rem; margin: 0; }

/* Coach-note CTA card (deep navy with subtle radial accents) */
.ys-cta-card {
  background: linear-gradient(160deg, var(--wf-navy) 0%, var(--wf-navy-2) 100%);
  color: #fff;
  border-radius: 18px;
  padding: 44px 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.ys-cta-card::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(153,102,255,0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(250,119,60,0.16), transparent 45%);
  pointer-events: none;
}
.ys-cta-card > * { position: relative; z-index: 1; }
.ys-cta-card h2 { color: #fff; margin: 0 0 12px; }
.ys-cta-card p { color: rgba(255,255,255,0.82); margin: 0; }
.ys-cta-card .ys-btn { margin-top: 10px; }
@media (max-width: 820px) {
  .ys-cta-card { grid-template-columns: 1fr; padding: 32px 24px; }
}

/* ============================================================
   Calculator-tool widget (white card with form + results)
   This is the heart of every calculator page.
   ============================================================ */

.ys-tool {
  background: #fff;
  border: 1px solid var(--ys-line);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 8px 28px rgba(47, 45, 86, 0.06);
  margin: 0 auto;
  max-width: 860px;
}
.ys-tool h3 {
  color: var(--ys-navy);
  margin: 0 0 6px;
  font-size: 1.3rem;
}
.ys-tool .ys-tool-pre {
  font-size: 0.95rem;
  color: var(--ys-muted);
  margin: 0 0 20px;
}

.ys-tool-fields {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}
@media (max-width: 600px) { .ys-tool-fields { grid-template-columns: 1fr; } }
.ys-tool-fields .full { grid-column: 1 / -1; }

.ys-tool-fields label {
  display: block;
  font-family: var(--ys-font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--ys-navy);
  margin-bottom: 6px;
}
.ys-tool-fields input,
.ys-tool-fields select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--ys-line);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--ys-font-body);
  background: #fff;
  color: var(--ys-navy);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.ys-tool-fields input:focus,
.ys-tool-fields select:focus {
  outline: none;
  border-color: var(--wf-coral);
  box-shadow: 0 0 0 3px rgba(250, 119, 60, 0.18);
}

.ys-tool-error {
  color: #c93939;
  font-size: 0.92rem;
  margin: 8px 0;
  min-height: 1.2em;
}

.ys-tool-results {
  margin-top: 22px;
  overflow-x: auto;
}
.ys-tool-results table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #fff;
}
.ys-tool-results th,
.ys-tool-results td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid var(--ys-line);
}
.ys-tool-results th {
  background: var(--wf-navy);
  color: #fff;
  font-family: var(--ys-font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.74rem;
  border-bottom: 0;
}
.ys-tool-results tr:last-child td { border-bottom: 0; }
.ys-tool-results tr:nth-child(even) td { background: var(--ys-bg-soft); }
.ys-tool-results td small {
  display: block;
  color: var(--ys-muted);
  font-size: 0.78rem;
  margin-top: 5px;
  line-height: 1.45;
}
.ys-tool-results td:first-child {
  text-align: left;
  font-family: var(--ys-font-display);
  letter-spacing: 0.04em;
  color: var(--ys-navy);
  font-weight: 600;
}

/* ============================================================
   Calculator catalog cards (used on the calc-hub landing page)
   ============================================================ */

.ys-calc-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.ys-calc {
  background: #fff;
  border: 1px solid var(--ys-line);
  border-left: 4px solid var(--wf-coral);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-left-color 0.15s ease;
}
.ys-calc:nth-child(2n) { border-left-color: var(--wf-teal); }
.ys-calc:nth-child(3n) { border-left-color: var(--ys-navy); }
.ys-calc:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(47, 45, 86, 0.10);
  text-decoration: none;
  color: inherit;
}
.ys-calc h4 {
  font-family: var(--ys-font-display);
  color: var(--ys-navy);
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: none;
  margin: 0 0 2px;
}
.ys-calc p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ys-muted);
  line-height: 1.45;
}
.ys-calc-arrow {
  color: var(--wf-coral);
  font-size: 0.78rem;
  font-family: var(--ys-font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 4px;
}
.ys-calc-cat-head {
  font-family: var(--ys-font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  color: var(--wf-coral);
  margin: 32px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ys-line);
}
.ys-calc-cat-head:first-child { margin-top: 0; }

/* ============================================================
   Info row — quick at-a-glance metrics strip
   ============================================================ */

.ys-info-row {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: #fff; border: 1px solid var(--ys-line);
  border-radius: var(--ys-radius-lg);
  padding: 24px; margin: 24px 0;
}
.ys-info-row > div .ys-info-label {
  font-family: var(--ys-font-display);
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.75rem; color: var(--ys-muted);
}
.ys-info-row > div .ys-info-value {
  font-family: var(--ys-font-display);
  font-size: 1.05rem; color: var(--ys-navy); margin-top: 4px;
}

/* ============================================================
   Utility classes
   ============================================================ */

.ys-center { text-align: center; }
.ys-mt-0 { margin-top: 0; }
.ys-mt-2 { margin-top: 16px; }
.ys-mt-4 { margin-top: 32px; }
.ys-mb-0 { margin-bottom: 0; }
.ys-mb-2 { margin-bottom: 16px; }
.ys-divider { height: 1px; background: var(--ys-line); margin: 32px 0; }

/* ============================================================
   Wildflower-style hero (kept for marketing-page parity)
   ============================================================ */

.wf-section { padding: 64px 0; }
.wf-section.alt { background: var(--wf-mist); }
.wf-section .ys-section-head h2 { color: var(--wf-navy); }
.wf-section .ys-section-head .ys-rule { background: var(--wf-teal); }

.wf-hero {
  background: linear-gradient(135deg, var(--wf-navy) 0%, var(--wf-navy-2) 100%);
  color: #fff;
  padding: 72px 0 88px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.wf-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(153,102,255,0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(250,119,60,0.16), transparent 45%);
  pointer-events: none;
}
.wf-hero .wf-eyebrow {
  display: inline-block;
  font-family: var(--ys-font-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--wf-coral);
  background: rgba(250, 119, 60, 0.12);
  border: 1px solid rgba(250, 119, 60, 0.4);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
  position: relative;
}
.wf-hero h1 { color: #fff; position: relative; margin: 0 0 18px; }
.wf-hero p.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 680px; margin: 16px auto 32px;
  color: rgba(255,255,255,0.86);
  position: relative;
}
