/* ══════════════════════════════════════════════════════════════
   Flow Performance — Design System
   Tokens + Components compartidos entre todas las herramientas.
   Basado en: flowperformance.es
   ══════════════════════════════════════════════════════════════ */

/* ── Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,700;1,800;1,900&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Colors */
  --bg: #F1F0EC;
  --bg2: #e7e5de;
  --card-bg: #FFFFFF;
  --input-bg: #FFFEFE;
  --text: hsl(240, 3%, 18%);
  --text-h: #000000;
  --text2: #71717A;
  --accent: #EF522B;
  --accent-hover: #d4431f;
  --green: #11742e;
  --green-bg: #CBDBCC;
  --border: #e4e4e7;
  --border-input: #e4e4e7;
  --shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.15);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --radius: 8px;
  --radius-sm: 6px;
  --max-width: 680px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background-color: var(--bg);
  background-image: url('https://flowperformance.es/wp-content/uploads/2026/01/nnnoise.svg');
  background-size: auto;
}

body {
  background: none;
  font-family: var(--font);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.02em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: var(--text-h);
  line-height: 1.1;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }

p { line-height: 1.6; }

a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* ── Layout ───────────────────────────────────────────────── */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  flex: 1;
}

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  color: var(--text-h);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}
.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
  margin-bottom: 1.5rem;
}
.nav-back:hover { color: var(--accent); }

/* ── Eyebrow / Badge ─────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-bg);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 0.8rem;
}

/* ── Section Label ────────────────────────────────────────── */
.section { margin-bottom: 2rem; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

/* ── Forms: Inputs & Selects ──────────────────────────────── */
.field-grid { display: grid; gap: 10px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 480px) {
  .g3 { grid-template-columns: 1fr 1fr; }
  .g2 { grid-template-columns: 1fr 1fr; }
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}
.field-label span {
  color: var(--text2);
  font-weight: 400;
  opacity: 0.7;
}

input[type=number],
input[type=text],
input[type=email],
select {
  width: 100%;
  height: 44px;
  background: var(--input-bg);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 0 12px;
  outline: none;
  font-family: var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number]:focus,
input[type=text]:focus,
input[type=email]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(239, 82, 43, 0.1);
}
select option { background: var(--card-bg); }
input::placeholder { color: #c4c4c9; }

/* ── Forms: Radio Pills ───────────────────────────────────── */
.pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}
.pill:hover { border-color: var(--text2); }
.pill.sel {
  border-color: var(--accent);
  background: rgba(239, 82, 43, 0.05);
}
.pill input { display: none; }
.pill-sub {
  font-size: 12px;
  color: var(--text2);
  margin-left: auto;
}

/* Radio circles */
.radio-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}
.pill.sel .radio-circle { border-color: var(--accent); }
.radio-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
}
.pill.sel .radio-inner { display: block; }

/* ── Forms: Train Cards (sport inputs) ────────────────────── */
.train-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.train-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.train-icon { font-size: 20px; line-height: 1; }
.train-name {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}
.train-card input {
  height: 36px;
  background: var(--bg);
  border-color: var(--border);
}

/* ── Buttons ──────────────────────────────────────────────── */
.cta-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  line-height: 1;
}
.cta-btn:hover {
  background: var(--text-h);
  border-color: var(--text-h);
  box-shadow: var(--shadow);
}
.cta-btn:active { transform: scale(0.99); }

.btn-secondary {
  width: 100%;
  padding: 12px 24px;
  background: transparent;
  color: var(--text2);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.btn-secondary:hover {
  border-color: var(--text);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ── Results: Hero ────────────────────────────────────────── */
.res-hero { margin-bottom: 2rem; text-align: center; }
.res-obj-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 1rem;
}
.res-kcal {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  color: var(--text-h);
  font-style: italic;
}
.res-kcal-sub {
  font-size: 14px;
  color: var(--text2);
  margin-top: 4px;
}

/* ── Results: Macro Cards ─────────────────────────────────── */
.macro-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 1.5rem 0;
}
.mc {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.mc-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.mc-prot .mc-icon { background: rgba(55, 138, 221, 0.15); color: #378ADD; }
.mc-fat .mc-icon  { background: rgba(216, 90, 48, 0.15);  color: #D85A30; }
.mc-carb .mc-icon { background: rgba(239, 82, 43, 0.1);   color: var(--accent); }
.mc-g {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-h);
}
.mc-name {
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}
.mc-kcal {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}

/* ── Results: Macro Bar ───────────────────────────────────── */
.bar-wrap { margin: 1.25rem 0; }
.bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg2);
  display: flex;
  overflow: hidden;
  gap: 2px;
}
.seg {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.seg-p { background: #378ADD; }
.seg-f { background: #D85A30; }
.seg-c { background: var(--accent); }
.bar-leg {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text2);
}
.leg-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Results: Breakdown Box ───────────────────────────────── */
.breakdown-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.breakdown-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 0.8rem;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row b { color: var(--text-h); font-weight: 600; }

/* ── Warning / Info Box ───────────────────────────────────── */
.warn {
  font-size: 13px;
  color: var(--text2);
  margin-top: 1.25rem;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(239, 82, 43, 0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}

/* ── Steps indicator ──────────────────────────────────────── */
.steps { display: flex; gap: 4px; margin-bottom: 2.5rem; }
.step-dot { height: 3px; flex: 1; background: var(--border); border-radius: 2px; }
.step-dot.active { background: var(--accent); }

/* ── Tools Grid (landing page) ────────────────────────────── */
.hero { text-align: center; margin-bottom: 2.5rem; }
.hero h1 { margin-bottom: 0.5rem; }
.subtitle {
  color: var(--text2);
  font-size: 15px;
  font-weight: 400;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.tool-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}
.tool-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-style: normal;
  text-transform: none;
}
.tool-card p {
  color: var(--text2);
  font-size: 0.9rem;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text2);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .tools-grid { grid-template-columns: 1fr; }
  .macro-cards { grid-template-columns: 1fr; }
  .res-kcal { font-size: 56px; }
}
