/* FitFlow Features — page-specific composition only.
   Shared navbar, typography foundation, buttons and global tokens live in header.css/design-system.css. */

:root {
  --features-ink: #102a2b;
  --features-text: #294344;
  --features-muted: #6b7f80;
  --features-primary: #0f9b8e;
  --features-primary-dark: #087f75;
  --features-soft: #e6faf7;
  --features-surface: #ffffff;
  --features-border: #dcebea;
  --features-shadow: 0 18px 50px rgba(16, 42, 43, .08);
}

/* Keep the legacy features header markup from creating its own navbar geometry. */
body > header .name {
  height: 52px !important;
  margin: 0 auto 0 0 !important;
  padding: 0 !important;
  justify-content: center !important;
  line-height: 1 !important;
}
body > header .name br { display: none !important; }
body > header .name h1 {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: clamp(1.08rem, 1.55vw, 1.45rem) !important;
  letter-spacing: .12em !important;
}
body > header .name p {
  margin: 4px 0 0 !important;
  padding: 0 !important;
  line-height: 1.15 !important;
  font-size: .72rem !important;
}

/* Hero */
.features-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  min-height: min(620px, calc(100vh - 76px));
  padding: clamp(64px, 8vw, 104px) max(5vw, 24px);
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 48%, rgba(52,211,153,.13), transparent 28%),
    linear-gradient(135deg, #f7fbfa 0%, #e6faf7 100%);
}
.features-hero::before,
.features-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}
.features-hero::before {
  width: 360px;
  height: 360px;
  right: -150px;
  top: -130px;
  background: rgba(15,155,142,.07);
}
.features-hero::after {
  width: 240px;
  height: 240px;
  left: -120px;
  bottom: -120px;
  background: rgba(52,211,153,.06);
}
.hero-content { width: min(680px, 100%); position: relative; z-index: 2; }
.hero-content h1 {
  margin: 0 0 22px;
  color: var(--features-ink);
  font-size: clamp(2.7rem, 5.2vw, 5.1rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 850;
  max-width: 760px;
}
.hero-content h1::after {
  content: "";
  display: block;
  width: 78px;
  height: 5px;
  margin-top: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--features-primary), #34d399);
}
.hero-content p {
  max-width: 680px;
  margin: 0 0 30px;
  color: var(--features-muted);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  line-height: 1.75;
}
.hero-image {
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: center;
}
.hero-image img {
  position: relative;
  z-index: 2;
  width: clamp(190px, 24vw, 270px);
  height: clamp(190px, 24vw, 270px);
  object-fit: cover;
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(16,42,43,.20);
  animation: featuresFloat 6s ease-in-out infinite;
}
.pulse-circle {
  position: absolute;
  width: clamp(290px, 34vw, 410px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(15,155,142,.08);
  box-shadow: 0 0 0 28px rgba(15,155,142,.035), 0 0 0 58px rgba(15,155,142,.02);
  animation: featuresPulse 4s ease-in-out infinite;
}
@keyframes featuresFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes featuresPulse { 0%,100% { transform: scale(.98); opacity: .9; } 50% { transform: scale(1.02); opacity: 1; } }

/* Feature overview */
.features-overview,
.how-it-works,
.cta-section { padding: clamp(72px, 8vw, 108px) max(5vw, 24px); }
.features-overview { background: #fff; text-align: center; }
.how-it-works { background: #f5faf9; text-align: center; }
.features-overview h2,
.how-it-works h2 {
  margin: 0 0 12px;
  color: var(--features-ink);
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.highlight { color: var(--features-primary); }
.section-description {
  width: min(760px, 100%);
  margin: 0 auto 38px;
  color: var(--features-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}
.features-tabs {
  width: min(1120px, 100%);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--features-border);
  border-radius: 24px;
  background: var(--features-surface);
  box-shadow: var(--features-shadow);
  text-align: left;
}
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #f5faf9;
  border-bottom: 1px solid var(--features-border);
}
.tab-btn {
  flex: 1 1 150px;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--features-muted);
  font-weight: 750;
  cursor: pointer;
  transition: 180ms ease;
}
.tab-btn:hover { color: var(--features-primary-dark); background: #fff; }
.tab-btn.active {
  color: #fff;
  background: var(--features-primary);
  border-color: var(--features-primary);
  box-shadow: 0 8px 18px rgba(15,155,142,.18);
}
.tab-content { min-height: 360px; }
.tab-pane { display: none; width: 100%; min-height: 360px; opacity: 0; }
.tab-pane.active {
  display: grid;
  grid-template-columns: minmax(260px,.8fr) minmax(0,1.2fr);
  align-items: center;
  opacity: 1;
  animation: tabReveal 240ms ease;
}
@keyframes tabReveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.tab-image {
  min-height: 300px;
  display: grid;
  place-items: center;
  margin: 24px;
  border-radius: 20px;
  background: linear-gradient(145deg, #e6faf7, #f7fbfa);
  border: 1px solid var(--features-border);
}
.feature-icon {
  font-size: clamp(5rem, 9vw, 8rem);
  color: var(--features-primary);
  filter: drop-shadow(0 12px 22px rgba(15,155,142,.15));
}
.tab-info { padding: 40px 42px 40px 20px; }
.tab-info h3 { margin: 0 0 12px; color: var(--features-ink); font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -.03em; }
.tab-info p { margin: 0 0 20px; color: var(--features-muted); line-height: 1.7; }
.feature-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.feature-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--features-text); line-height: 1.5; }
.feature-list li i { flex: 0 0 auto; margin-top: 3px; color: var(--features-primary); }

/* How it works */
.steps-container {
  width: min(1080px, 100%);
  margin: 52px auto 0;
  display: grid;
  grid-template-columns: 1fr 70px 1fr 70px 1fr;
  align-items: stretch;
}
.step {
  position: relative;
  padding: 34px 26px 28px;
  background: #fff;
  border: 1px solid var(--features-border);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(16,42,43,.055);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.step:hover { transform: translateY(-5px); box-shadow: var(--features-shadow); border-color: #bfe2dc; }
.step-number {
  position: absolute;
  top: -16px;
  left: 24px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: var(--features-primary);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15,155,142,.2);
}
.step-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 16px;
  color: var(--features-primary-dark);
  background: var(--features-soft);
  font-size: 1.35rem;
}
.step h3 { margin: 0 0 8px; color: var(--features-ink); font-size: 1.2rem; }
.step p { margin: 0; color: var(--features-muted); line-height: 1.65; }
.step-connector { align-self: center; height: 2px; margin-inline: 10px; background: linear-gradient(90deg, transparent, #9bd8cf, transparent); }

/* CTA */
.cta-section { position: relative; overflow: hidden; text-align: center; background: #0b4f4b; }
.cta-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(52,211,153,.20), transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(15,155,142,.35), transparent 32%),
    linear-gradient(135deg, #0b4f4b, #087f75);
}
.cta-content { position: relative; z-index: 1; width: min(800px,100%); margin-inline: auto; color: #fff; }
.cta-content h2 { margin: 0 0 14px; font-size: clamp(2rem,4vw,3.1rem); line-height: 1.05; letter-spacing: -.04em; }
.cta-content p { margin: 0 auto 28px; max-width: 640px; color: rgba(255,255,255,.78); line-height: 1.7; }
.cta-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.cta-button.primary { margin: 0; color: var(--features-primary-dark); background: #fff; border-color: transparent; }
.cta-button.primary:hover { background: #f2fffc; }
.cta-button.secondary { margin: 0; color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); }
.cta-button.secondary:hover { background: rgba(255,255,255,.15); }

/* Responsive */
@media (max-width: 1100px) {
  .features-hero { grid-template-columns: 1fr .75fr; gap: 30px; }
  .steps-container { grid-template-columns: 1fr; gap: 28px; max-width: 600px; }
  .step-connector { width: 2px; height: 28px; margin: 0 auto; background: linear-gradient(180deg, transparent, #9bd8cf, transparent); }
}
@media (max-width: 820px) {
  body > header .name { height: 46px !important; }
  body > header .name h1 { font-size: 1.05rem !important; }
  .features-hero { min-height: auto; grid-template-columns: 1fr; text-align: center; padding-block: 64px 72px; }
  .hero-content { margin-inline: auto; }
  .hero-content h1 { font-size: clamp(2.5rem, 9vw, 4rem); }
  .hero-content h1::after { margin-inline: auto; }
  .hero-content p { margin-inline: auto; }
  .hero-image { min-height: 300px; }
  .tab-pane.active { grid-template-columns: 1fr; }
  .tab-image { min-height: 220px; margin: 20px; }
  .tab-info { padding: 10px 28px 32px; }
}
@media (max-width: 600px) {
  .features-overview, .how-it-works, .cta-section { padding: 64px 16px; }
  .features-hero { padding-inline: 18px; }
  .hero-content h1 { font-size: clamp(2.15rem, 11vw, 3.2rem); }
  .hero-content p { font-size: 1rem; }
  .hero-image { min-height: 250px; }
  .hero-image img { width: 190px; height: 190px; border-radius: 24px; }
  .pulse-circle { width: 270px; }
  .tabs-nav { flex-direction: column; }
  .tab-btn { width: 100%; flex: 0 0 auto; }
  .tab-content, .tab-pane { min-height: 0; }
  .tab-image { min-height: 190px; }
  .tab-info { padding: 4px 22px 28px; }
  .feature-list li { font-size: .95rem; }
  .cta-buttons { flex-direction: column; align-items: stretch; }
  .cta-buttons .cta-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-image img, .pulse-circle { animation: none; }
  .tab-pane.active { animation: none; }
}
