/* ==========================================================================
   FitPulse 2025 redesign — loaded LAST so it overrides styles.css cleanly.
   Light mode only. Teal/green brand. Spacious, airy, card-based.

   Rolled out section by section. Active so far:
     - :root design tokens (new names; do not collide with styles.css)
     - Problem section (#problems)
   The hero and nav are intentionally NOT styled here.
   ========================================================================== */

:root {
  --brand-green: #44C4A4;
  --gradient-end: #30A69A;
  --primary-color: #33CC99;
  --secondary-color: #F05454;
  --accent-color: #F6BD60;

  --success-color: #38B248;
  --warning-color: #F6BD60;
  --error-color: #F05454;

  --text-primary: #1A202C;
  --text-secondary: #718096;
  --background-primary: #F8F9FA;
  --background-secondary: #FFFFFF;
  --card-background: #FFFFFF;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-soft: 0 12px 35px rgba(26, 32, 44, 0.08);
  --shadow-card: 0 18px 45px rgba(26, 32, 44, 0.10);
  --shadow-green: 0 18px 50px rgba(68, 196, 164, 0.24);

  --container: 1180px;
}

/* ==========================================================================
   PROBLEM SECTION (#problems) — minimal, centered, airy
   ========================================================================== */
.problems {
  background: var(--background-secondary);
  padding: 104px 0;
}

/* Slightly wider container so the four cards read wider */
.problems .container { max-width: 1240px; }

.problems .section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}
.problems .section-header h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.55rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.problems .section-header p {
  font-size: 1.06rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Tighter gap = wider cards; relative for the group shadow */
.problems .problems-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* One soft shadow behind the whole row, wider than the four cards */
.problems .problems-grid::before {
  content: "";
  position: absolute;
  inset: 6px -56px;
  border-radius: 30px;
  box-shadow: 0 40px 90px rgba(26, 32, 44, 0.12);
  z-index: -1;
  pointer-events: none;
}

/* Minimal, centered card — wider, flatter, no hover effect */
.problems .problem-card {
  background: #FFFFFF;
  border: 1px solid rgba(26, 32, 44, 0.06);
  border-radius: 20px;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Soft squircle icon tile */
.problems .problem-icon {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  font-size: 1.5rem;
  color: var(--brand-green);
  background: linear-gradient(135deg, rgba(68, 196, 164, 0.16), rgba(51, 204, 153, 0.08));
}

.problems .problem-card h3 {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.3;
}
.problems .problem-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  width: 100%;        /* same block width on every card (don't shrink-to-fit) */
  max-width: 26ch;
  margin: 0 auto;
  min-height: 3.1em;  /* reserve 2 lines so the stat sits at the same height */
}

/* Stat anchored a fixed distance below the (equal-height) description, so the
   numbers line up across all four cards regardless of label length. */
.problems .problem-stats {
  margin-top: 18px;
  padding-top: 20px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.problems .problem-card > .problem-stats { width: 100%; }
.problems .problem-stats::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: rgba(68, 196, 164, 0.35);
  margin-bottom: 14px;
}
.problems .problem-stats .stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--brand-green);
  line-height: 1;
}
.problems .problem-stats .stat-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Tablet: 2 x 2 */
@media (max-width: 1023px) {
  .problems .problems-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .problems .problems-grid::before { inset: 6px -28px; }
}
/* Mobile: single column — drop the wide group shadow, give each card its own */
@media (max-width: 767px) {
  .problems { padding: 64px 0; }
  .problems .problems-grid { grid-template-columns: 1fr; }
  .problems .problems-grid::before { display: none; }
  .problems .problem-card {
    padding: 30px 24px;
    box-shadow: 0 10px 30px rgba(26, 32, 44, 0.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .problems .problem-card { transition: none; }
}

/* ==========================================================================
   FEATURE SHOWCASE (#solutions) — "Everything You Need. Nothing You Don't."
   Left: intro. Right: central phone with 4 corner feature cards (orbit).
   ========================================================================== */
.solution-section {
  position: relative;
  padding: 115px 0;
  background:
    radial-gradient(circle at 78% 35%, rgba(68, 196, 164, .16), transparent 38%),
    linear-gradient(180deg, #F2FFFB 0%, #FFFFFF 100%);
  overflow: hidden;
}
/* faint orbital rings behind the phone */
.solution-section::before {
  content: "";
  position: absolute;
  width: 760px; height: 760px;
  right: 6%; top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(68, 196, 164, .18);
  border-radius: 50%;
  pointer-events: none;
}
.solution-section::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: 12%; top: 50%;
  transform: translateY(-50%);
  border: 1px dashed rgba(68, 196, 164, .14);
  border-radius: 50%;
  pointer-events: none;
}

.solution-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.34fr 0.66fr;
  gap: 56px;
  align-items: center;
}

.solution-intro .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-green);
  margin: 0 0 18px;
}
.solution-intro h2 {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  color: var(--text-primary);
}
.solution-underline {
  width: 64px; height: 4px;
  background: var(--brand-green);
  border-radius: 4px;
  margin-bottom: 22px;
}
.solution-intro p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 30em;
}

/* Orbit */
.feature-orbit { position: relative; min-height: 620px; }

.feature-phone {
  position: absolute;
  left: 50%; top: 56%;            /* sit a little lower than centre */
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.feature-screens {
  position: relative;
  width: 224px;
  height: 472px;
  border-radius: 40px;
  background: #fff;
  border: 6px solid #fff;
  box-shadow: 0 30px 70px rgba(26, 32, 44, .16);
  outline: 1px solid rgba(68, 196, 164, .16);
  overflow: hidden;
}
.feature-screen {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
}
.feature-screen.is-active { opacity: 1; }

/* Subtle autoplay progress bar (between screenshot and arrows) */
.feature-progress {
  width: 168px;
  height: 4px;
  border-radius: 4px;
  background: rgba(68, 196, 164, 0.16);
  overflow: hidden;
  margin-top: 18px;
}
.feature-progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 4px;
  background: var(--brand-green);
  transform: scaleX(0);
  transform-origin: left center;
}
@keyframes featureProgress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.feature-arrows { display: flex; gap: 14px; margin-top: 14px; }
.feature-arrow {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(68, 196, 164, .22);
  color: var(--brand-green);
  font-size: 1rem;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, background .2s ease;
}
.feature-arrow:hover { transform: translateY(-2px); background: rgba(68, 196, 164, .08); }

.feature-card {
  position: absolute;
  width: 212px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(68, 196, 164, .14);
  box-shadow: var(--shadow-soft);
  opacity: .42;
  transform: scale(.96);
  transition: opacity .35s ease, transform .35s ease, box-shadow .35s ease, border-color .35s ease;
  text-align: left;
  cursor: pointer;
  z-index: 5;
}
.feature-card.is-active {
  opacity: 1;
  transform: scale(1);
  border-color: rgba(68, 196, 164, .42);
  box-shadow: var(--shadow-card);
}
.feature-card-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(68, 196, 164, 0.16), rgba(51, 204, 153, 0.08));
  color: var(--brand-green);
  font-size: 1.15rem;
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 1.04rem; margin: 0 0 6px; color: var(--text-primary); }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.45; margin: 0; }

.feature-card--top-left     { top: 0;    left: 0; }
.feature-card--top-right    { top: 0;    right: 0; }
.feature-card--bottom-left  { bottom: 0; left: 0; }
.feature-card--bottom-right { bottom: 0; right: 0; }

/* Tablet/mobile: stack — heading above, phone centered, cards 2x2 below */
@media (max-width: 1023px) {
  .solution-section { padding: 80px 0; }
  .solution-section::before, .solution-section::after { display: none; }
  .solution-grid { grid-template-columns: 1fr; gap: 44px; }
  .solution-underline { margin-left: auto; margin-right: auto; }
  .solution-intro { text-align: center; }
  .solution-intro p { margin-left: auto; margin-right: auto; }

  .feature-orbit { min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
  .feature-phone { position: static; transform: none; }
  .feature-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    max-width: 520px;
  }
  .feature-card {
    position: static;
    width: auto;
    opacity: 1;
    transform: none;
  }
  .feature-card:not(.is-active) { opacity: .6; }
}

@media (max-width: 480px) {
  .feature-cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-screen, .feature-card, .feature-arrow { transition: none; }
  .feature-progress { display: none; }
}

/* ==========================================================================
   OUTCOME / RESULTS (#stories) — "Your Fitness Journey Starts Here"
   4 result cards (one per problem) with light CSS-only data visuals.
   ========================================================================== */
.stories {
  position: relative;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--background-primary) 100%);
  padding: 104px 0;
}
/* faint chart grid behind the section, faded at top & bottom */
.stories::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(68, 196, 164, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 196, 164, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
}
.stories .container { position: relative; z-index: 1; }

.stories .section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}
.stories .section-header h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.55rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.stories .section-header p {
  font-size: 1.06rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.stories .stories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.stories .story-card {
  background: #fff;
  border: 1px solid rgba(26, 32, 44, 0.06);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .25s ease;
  display: flex;
  flex-direction: column;
  min-height: 0;              /* override old redesign-styles.css 400px */
  transform: none;
}
/* Flat hover (no jump); neutralize old top gradient bar */
.stories .story-card:hover { box-shadow: var(--shadow-card); transform: none; }
.stories .story-card::before { display: none; }
/* Reserve two title lines so the descriptions start on the same line in
   every card (e.g. "Unbreakable Consistency" wraps to two lines). */
.stories .story-card h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.3;
  min-height: 2.6em;
}
.stories .story-card p {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  /* override old redesign-styles.css: flex:1 + min-height:120px stretched this */
  flex: 0 0 auto;
  min-height: 0;
  display: block;
}

/* Result stat — pinned to the bottom so the numbers line up across cards in
   every language (descriptions wrap to different line counts per language). */
.stories .story-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(26, 32, 44, 0.06);
}
.stories .story-metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand-green);
  line-height: 1;
}
.stories .story-metric-label {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Visual tile */
.stories .story-visual {
  height: 96px;
  border-radius: var(--radius-md);
  background: rgba(68, 196, 164, 0.06);
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
}
/* sparkline */
.stories .story-visual svg { width: 100%; height: 100%; display: block; }
.stories .story-spark { fill: none; stroke: var(--brand-green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.stories .story-spark-area { fill: rgba(68, 196, 164, 0.12); stroke: none; }
/* balance ring (donut) */
.stories .result-ring {
  width: 66px; height: 66px; border-radius: 50%;
  background: conic-gradient(var(--brand-green) 0 68%, rgba(68, 196, 164, 0.18) 68% 100%);
  display: grid; place-items: center;
}
.stories .result-ring::after { content: ""; width: 42px; height: 42px; border-radius: 50%; background: #fff; }
/* bar chart */
.stories .result-bars { display: flex; align-items: flex-end; gap: 8px; height: 100%; }
.stories .result-bars span { width: 11px; border-radius: 5px 5px 0 0; background: var(--brand-green); opacity: .85; }
.stories .result-bars span:nth-child(1) { height: 38%; opacity: .5; }
.stories .result-bars span:nth-child(2) { height: 52%; opacity: .6; }
.stories .result-bars span:nth-child(3) { height: 46%; opacity: .6; }
.stories .result-bars span:nth-child(4) { height: 68%; opacity: .75; }
.stories .result-bars span:nth-child(5) { height: 82%; opacity: .9; }
.stories .result-bars span:nth-child(6) { height: 100%; }
/* streak dots */
.stories .result-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.stories .result-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(68, 196, 164, 0.22); }
.stories .result-dots span.on { background: var(--brand-green); }

@media (max-width: 1023px) {
  .stories .stories-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .stories { padding: 64px 0; }
  .stories .stories-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .stories .story-card { transition: none; }
}

/* ==========================================================================
   FINAL CTA — "Ready to Transform Your Fitness?" gradient panel
   ========================================================================== */
.cta {
  background: var(--background-primary);
  padding: 96px 0;
}
.cta::before { display: none; } /* neutralize old full-bleed background */

.cta-panel {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 48px 52px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .28), transparent 34%),
    linear-gradient(135deg, var(--brand-green), var(--gradient-end));
  color: #fff;
  box-shadow: var(--shadow-green);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 44px;
  flex-wrap: wrap;
}
/* soft wave/glow rings */
.cta-panel::after {
  content: "";
  position: absolute;
  right: -90px; bottom: -130px;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 42px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.cta-panel-text { position: relative; z-index: 1; max-width: 560px; }
.cta-panel-text h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
}
.cta-panel-text p {
  font-size: 1.08rem;
  line-height: 1.55;
  opacity: .95;
  margin: 0 0 22px;
}
.cta-values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  list-style: none;
  padding: 0; margin: 0;
}
.cta-values li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.98rem;
}
.cta-values li i { color: #fff; }

.cta-panel-action {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.cta-icon-block {
  display: grid;
  place-items: center;
}
.cta-icon-block img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  border-radius: 22px; /* image already has its own color/shape; gentle rounding only */
}

.cta .cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--gradient-end);
  border-radius: var(--radius-md);
  padding: 15px 28px;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 14px 30px rgba(26, 32, 44, 0.18);
  transition: transform .2s ease;
}
.cta .cta-button:hover { transform: translateY(-2px); }

@media (max-width: 767px) {
  .cta { padding: 64px 0; }
  .cta-panel { padding: 34px 26px; gap: 28px; }
  .cta-panel-action { align-items: stretch; width: 100%; }
  .cta-panel-action .cta-button { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cta .cta-button { transition: none; }
}
