/* FitFormBuddy exercise library — shared styles (brand tokens from the app). */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2');
}

:root {
  --accent: #D4FF4F;
  --bg: #000000;
  --surface: #15171C;
  --surface-alt: #1D2026;
  --stroke: #2A2E36;
  --text-dim: #9AA0AB;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 20px)
           calc(env(safe-area-inset-right) + 20px)
           calc(env(safe-area-inset-bottom) + 28px)
           calc(env(safe-area-inset-left) + 20px);
  -webkit-tap-highlight-color: transparent;
}

.top { width: 100%; display: flex; justify-content: center; }
.top .logo { width: 92px; height: auto; display: block; }
.top .home { display: block; }

main { width: 100%; max-width: 560px; }

h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.2px; margin-top: 18px; }
.library h1, .exercise h1 { text-align: center; }
.tagline { margin-top: 8px; font-size: 14px; color: var(--text-dim); text-align: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 20px;
  margin-top: 16px;
}
.card h2 {
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 12px;
}

/* ---------- CTA + footer ---------- */
.cta { text-align: center; margin-top: 24px; padding: 24px 20px; background: var(--surface); border: 1px solid var(--stroke); border-radius: 20px; }
.cta h2 { font-size: 17px; font-weight: 700; }
.cta p { margin-top: 8px; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.stores { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.stores a { display: block; }
.stores img { display: block; height: 44px; width: auto; }

footer { margin-top: 36px; text-align: center; }
.foot-links { font-size: 12.5px; color: var(--text-dim); display: flex; gap: 10px; justify-content: center; }
.foot-links a { color: var(--text-dim); }
.copyright { margin-top: 14px; font-size: 11px; letter-spacing: 1.5px; color: var(--text-dim); opacity: 0.55; text-transform: uppercase; }

@media (min-width: 700px) {
  .top .logo { width: 110px; }
  h1 { font-size: 30px; }
}

/* ---------- tool index cards ---------- */
.tool-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.tool-card {
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: #fff;
  padding: 18px;
  transition: transform 120ms ease, border-color 120ms ease;
}
.tool-card:active { transform: scale(0.98); }
@media (hover: hover) { .tool-card:hover { border-color: rgba(212, 255, 79, 0.45); } }
.tool-icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  background: rgba(212, 255, 79, 0.10);
  border: 1px solid rgba(212, 255, 79, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.tool-icon svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-text { flex: 1; min-width: 0; }
.tool-name { display: block; font-size: 16px; font-weight: 700; }
.tool-sub { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-dim); }
.chev { flex: none; width: 18px; height: 18px; stroke: var(--text-dim); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- units toggle ---------- */
.units {
  display: flex; gap: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px;
  width: max-content;
  margin: 18px auto 0;
}
.units button {
  border: none; background: transparent; color: var(--text-dim);
  font: 600 12.5px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.5px;
  padding: 8px 18px; border-radius: 999px;
  cursor: pointer;
}
.units button[aria-pressed="true"] { background: var(--accent); color: #0B0C0F; }

/* ---------- form ---------- */
.calc-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.control { display: flex; gap: 8px; align-items: center; }
.control .unit { font-size: 13px; color: var(--text-dim); min-width: 28px; }
input[type="number"], select {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: #fff;
  font: 500 16px/1.2 Inter, system-ui, sans-serif;
  padding: 12px 14px;
  -moz-appearance: textfield;
  appearance: textfield;
}
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
select { appearance: auto; }
.metric-only, .imperial-only { display: none; }
body.metric .metric-only { display: flex; }
body.imperial .imperial-only { display: flex; }
.pair { display: flex; gap: 8px; }
.pair .control { flex: 1; }

/* ---------- results ---------- */
.result { text-align: center; }
.result .big {
  font-size: 44px; font-weight: 700; color: var(--accent);
  letter-spacing: -1px; line-height: 1.1;
}
.result .big small { font-size: 18px; font-weight: 600; color: var(--text-dim); letter-spacing: 0; }
.result .verdict {
  display: inline-block; margin-top: 10px;
  border: 1px solid rgba(212, 255, 79, 0.3);
  background: rgba(212, 255, 79, 0.10);
  color: var(--accent);
  border-radius: 999px; padding: 6px 14px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
}
.result .sub { margin-top: 10px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.targets { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.targets li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
}
.targets .t-name { color: #fff; font-weight: 600; }
.targets .t-loss { color: var(--text-dim); font-size: 12px; }
.targets .t-kcal { color: var(--accent); font-weight: 700; white-space: nowrap; }

.warn {
  display: none;
  margin-top: 12px; padding: 10px 14px;
  border: 1px solid rgba(255, 159, 67, 0.4);
  background: rgba(255, 159, 67, 0.08);
  border-radius: 12px;
  color: #FFB673; font-size: 12.5px; line-height: 1.5;
}
.warn.show { display: block; }

.note { margin-top: 14px; font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.disclaimer { margin-top: 16px; text-align: center; font-size: 11.5px; color: var(--text-dim); opacity: 0.7; }
