/* Repcheck — base stylesheet.
   Tokens mirror the brand preview. Mobile-first, dark default,
   tabular numerals everywhere a number is shown.
*/
:root {
  --bg: #0E0E10;
  --surface: #1F2024;
  --surface-2: #16171a;
  --line: #2a2b2f;
  --line-2: #3a3b3f;
  --text: #F5F5F4;
  --muted: #8A8A8E;
  --muted-2: #6a6b6f;
  --accent: #C7F751;
  --accent-press: #b4e043;
  --success: #4ADE80;
  --danger: #F87171;
  --radius: 14px;
  --radius-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
html, body { background: var(--bg); }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01', 'tnum';
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Subtle ambient glow — gives the dark canvas depth without busy gradients. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60vw 60vw at 50% -10%, rgba(199,247,81,.07), transparent 60%),
    radial-gradient(40vw 40vw at 100% 100%, rgba(199,247,81,.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
a.subtle-link { color: var(--muted); }
a.subtle-link:hover { color: var(--text); }

.shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 24px calc(32px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: env(safe-area-inset-top);
}
.topbar .logo svg { height: 22px; width: auto; display: block; }
.topbar-actions { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.topbar-actions a { color: var(--muted); }
.topbar-actions a:hover { color: var(--text); }

.status-chip {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Headings ──────────────────────────────────────────────────────────────── */
.h-hero {
  font-size: clamp(40px, 11vw, 56px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.02;
}
.h-hero .accent { color: var(--accent); }
.h-section {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.1;
}
.h-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 500;
}
.body-lead { font-size: 17px; color: var(--muted); max-width: 36ch; }
.body-sm { font-size: 13px; color: var(--muted); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease, background .15s ease;
  min-height: 52px;
  text-align: center;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-link {
  background: transparent;
  color: var(--muted);
  padding: 8px;
  font-weight: 500;
  min-height: 0;
  font-size: 14px;
}
.btn-link:hover { color: var(--text); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 500;
}
.field input[type=email],
.field input[type=password],
.field input[type=text],
.field input[type=number],
.field input[type=date],
.field input[type=time],
.field input[type=tel],
.field input[type=search],
.field input[type=url],
.field input:not([type]),
.field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
  min-height: 52px;
  -webkit-text-fill-color: var(--text); /* iOS Safari sometimes overrides color */
  caret-color: var(--accent);
}
.field input[type=file] {
  width: 100%;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  min-height: 52px;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted-2); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}
/* iOS autofill background fix */
.field input:-webkit-autofill,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  caret-color: var(--accent);
}
.field .field-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 2px;
}
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-2);
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.alert {
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid;
  line-height: 1.4;
}
.alert-error { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.3); color: #fca5a5; }
.alert-success { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.3); color: #86efac; }

/* ── Misc ──────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.center-text { text-align: center; }
.mt-auto { margin-top: auto; }
.footer-mark {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Workout-card preview (used on landing) */
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.preview-title { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; }
.preview-meta { font-size: 12px; color: var(--muted); }
.ex {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}
.ex:first-of-type { border-top: none; padding-top: 0; }
.ex-name { font-weight: 600; font-size: 15px; }
.ex-target { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ex-weight {
  grid-row: 1 / span 2;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ex-weight span { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.pr-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.5px;
  background: rgba(199,247,81,.12);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 700;
  margin-left: 8px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Slightly more breathing room on tablet+ */
@media (min-width: 520px) {
  .shell { padding-top: 48px; padding-bottom: 48px; gap: 36px; }
}
