/* ==========================================================================
   GymBro — Design tokens
   Direction: "Iron & Chalk" — a dark, gym-floor palette. Charcoal like
   rubber flooring, chalk-white type, one signal accent (plate-collar
   orange) reserved for PRs, streaks and primary actions. Numbers are set
   in a mono face, like a plate's stamped weight — reps and sets are data,
   not decoration.
   ========================================================================== */

:root {
  /* Color */
  --bg: #14181c;
  --bg-raised: #1b2126;
  --surface: #1e252b;
  --surface-hover: #262e35;
  --border: #2b3339;
  --border-strong: #3a444c;
  --chalk: #f2efe9;
  --chalk-dim: #c7c2b8;
  --muted: #8a9199;
  --muted-dim: #5d656c;
  --accent: #ff4b26;
  --accent-hover: #ff6440;
  --accent-dim: #7a3020;
  --success: #6fcf7a;
  --danger: #ff5c5c;

  /* Type */
  --font-display: 'Archivo Black', 'Arial Black', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-plate: 999px;
  --max-width: 1120px;
  --header-h: 68px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255,75,38,0.06), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(255,75,38,0.05), transparent 45%);
  color: var(--chalk);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
  text-transform: uppercase;
}

p { line-height: 1.55; color: var(--chalk-dim); margin: 0; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Focus visibility — never suppressed */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #14181c;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--chalk);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--muted); }

.btn-block { width: 100%; }

.btn-danger-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--danger);
}
.btn-danger-ghost:hover { background: rgba(255,92,92,0.08); border-color: var(--danger); }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Plate divider (signature element) ---------- */
.plate-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
}
.plate-divider::before,
.plate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.plate-divider span {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; text-align: left; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 0.98rem;
  transition: border-color 0.15s ease;
}
.field input:focus {
  border-color: var(--accent);
  outline: none;
}
.field input::placeholder { color: var(--muted-dim); }

.form-error {
  display: none;
  background: rgba(255,92,92,0.1);
  border: 1px solid rgba(255,92,92,0.35);
  color: var(--danger);
  font-size: 0.88rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.form-error.visible { display: block; }

.form-note {
  display: none;
  background: rgba(111,207,122,0.1);
  border: 1px solid rgba(111,207,122,0.35);
  color: var(--success);
  font-size: 0.88rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.form-note.visible { display: block; }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(20,24,28,0.35);
  border-top-color: #14181c;
  animation: spin 0.7s linear infinite;
}
.btn-ghost .spinner { border-color: rgba(242,239,233,0.25); border-top-color: var(--chalk); }
@keyframes spin { to { transform: rotate(360deg); } }


/* ==========================================================================
   Landing page (index.html)
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 10;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(20,24,28,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.02em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.hero {
  padding: 32px 0 72px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
}
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  margin-bottom: 22px;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead {
  font-size: 1.14rem;
  max-width: 46ch;
  margin-bottom: 34px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* Signature: a live-looking workout log card, plate-stamped numbers */
.log-card {
  padding: 26px;
  position: relative;
}
.log-card .log-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px;
}
.log-card .log-head h3 { font-size: 0.95rem; letter-spacing: 0.04em; }
.log-card .log-head .tag {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted);
  border: 1px solid var(--border-strong); padding: 3px 8px; border-radius: var(--radius-plate);
}
.set-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.set-row:first-of-type { border-top: none; }
.set-row .num { font-family: var(--font-mono); color: var(--muted-dim); font-size: 0.85rem; }
.set-row .lift { font-weight: 600; font-size: 0.95rem; }
.set-row .lift small { display: block; color: var(--muted); font-weight: 400; font-size: 0.78rem; margin-top: 2px; }
.set-row .figure { font-family: var(--font-mono); font-size: 0.95rem; text-align: right; }
.set-row .figure.pr { color: var(--accent); }
.set-row .badge {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.04em;
  color: var(--accent); border: 1px solid var(--accent-dim); background: rgba(255,75,38,0.08);
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}

section.features { padding: 60px 0 40px; }
.section-head { max-width: 60ch; margin-bottom: 44px; }
.section-head .plate-divider { margin-bottom: 22px; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 14px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card { padding: 28px 24px; }
.feature-card .mark {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); color: var(--accent); font-weight: 700;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.05rem; text-transform: none; margin-bottom: 10px; letter-spacing: 0; }
.feature-card p { font-size: 0.94rem; }

section.cta {
  padding: 76px 0 100px;
  text-align: center;
}
section.cta .card {
  padding: 56px 32px;
  max-width: 720px;
  margin: 0 auto;
}
section.cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 16px; }
section.cta p { max-width: 44ch; margin: 0 auto 30px; }

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
footer .container {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 0.85rem;
}
.footer-bar { flex-wrap: wrap; gap: 12px; }
.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-link {
  color: var(--chalk-dim);
  transition: color 0.15s ease;
}
.footer-link:hover { color: var(--chalk); }
.footer-separator { color: var(--muted-dim); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
}


/* ==========================================================================
   Login / signup page (auth/login.html)
   ========================================================================== */
.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-shell { width: 100%; max-width: 408px; }
.back-brand {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.02em;
  margin-bottom: 32px;
}
.back-brand img { width: 30px; height: 30px; border-radius: 7px; }

.auth-card { padding: 34px 30px; }
.auth-tabs {
  display: flex;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 26px;
}
.auth-tabs button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 0;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tabs button.active {
  background: var(--surface-hover);
  color: var(--chalk);
}

.auth-card h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 6px;
}
.auth-card .subhead {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 26px;
}

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted-dim); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 22px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--chalk); color: #14181c;
  width: 100%;
}
.btn-google:hover { background: #ffffff; }
.btn-google svg { width: 18px; height: 18px; }

.field-forgot {
  display: flex; justify-content: flex-end;
  margin-top: -10px; margin-bottom: 18px;
}
.field-forgot button {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted); font-size: 0.82rem; font-family: var(--font-body);
  text-decoration: underline;
}
.field-forgot button:hover { color: var(--chalk); }

.legal {
  text-align: center; font-size: 0.78rem; color: var(--muted-dim);
  margin-top: 22px;
}


/* ==========================================================================
   Dashboard page (app/dashboard/index.html)
   ========================================================================== */
.app-nav {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(20,24,28,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.app-nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.02rem; letter-spacing: 0.02em; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 0.9rem; font-weight: 600; color: var(--muted);
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--chalk); background: var(--surface-hover); }
.nav-links a.current { color: var(--chalk); background: var(--surface); }
.nav-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem; color: var(--accent);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

main { padding: 44px 0 80px; }
.page-head { margin-bottom: 34px; }
.page-head .eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px;
}
.page-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.page-head .skeleton-name { display: inline-block; width: 140px; height: 1em; background: var(--surface-hover); border-radius: 4px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.stat-card { padding: 20px 22px; }
.stat-card .label {
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 10px;
}
.stat-card .value { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; }
.stat-card .value .unit { font-size: 1rem; color: var(--muted); font-weight: 500; margin-left: 4px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-title h2 { font-size: 1.1rem; letter-spacing: 0.02em; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 44px;
}
.quick-card {
  padding: 24px 22px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.quick-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.quick-card .mark {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.quick-card h3 { font-size: 1rem; letter-spacing: 0; text-transform: none; }
.quick-card p { font-size: 0.86rem; }
.quick-card .soon {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.05em;
  color: var(--muted); border: 1px solid var(--border-strong);
  padding: 2px 7px; border-radius: var(--radius-plate);
  width: fit-content;
}

.empty-card {
  padding: 46px 30px;
  text-align: center;
}
.empty-card .mark {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); color: var(--muted);
}
.empty-card h3 { font-size: 1.05rem; letter-spacing: 0; text-transform: none; margin-bottom: 8px; }
.empty-card p { max-width: 40ch; margin: 0 auto 22px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
}



/* ==========================================================================
   Legal page (legal/index.html)
   ========================================================================== */
.legal-page { padding: 44px 0 90px; }
.legal-head { max-width: 70ch; margin-bottom: 36px; }
.legal-head .eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px;
}
.legal-head h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin-bottom: 10px; }
.legal-updated { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }

.legal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.legal-toc-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 6px;
}
.legal-toc-label-second { margin-top: 18px; }
.legal-toc a {
  font-size: 0.86rem; color: var(--muted);
  padding: 5px 0;
  transition: color 0.15s ease;
}
.legal-toc a:hover { color: var(--chalk); }

.legal-content { display: flex; flex-direction: column; gap: 20px; }
.legal-section { padding: 32px 34px; }
.legal-kicker {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
}
.legal-section h2 {
  font-size: 1.15rem; text-transform: none; letter-spacing: 0;
  margin-top: 28px; margin-bottom: 10px;
}
.legal-section h2:first-of-type { margin-top: 0; }
.legal-section p { font-size: 0.95rem; margin-bottom: 4px; }
.legal-link { color: var(--accent); text-decoration: underline; }

@media (max-width: 800px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
  .legal-section { padding: 26px 22px; }
}



/* ---------- Enhanced Interactive Log Card ---------- */
.log-card {
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Enlarged Status & Timer Header */
.log-card .log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-raised);
  margin: -26px -26px 16px -26px; /* Bleed to card edges */
  padding: 16px 26px;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  border-bottom: 1px solid var(--border);
}

.log-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

/* Pulsing live dot */
.log-status-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 1.5s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.timer-display {
  font-size: 1.4rem; /* Significantly larger */
  font-weight: 700;
  color: var(--chalk);
  letter-spacing: -0.02em;
}

/* Interactive Input Cueing */
.interactive-row {
  position: relative;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

/* Soft glow highlighting the interactive inputs */
.interactive-inputs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px dashed var(--accent-dim);
  padding: 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 75, 38, 0.02);
  animation: border-glow 2s infinite alternate ease-in-out;
}

@keyframes border-glow {
  0% { border-color: var(--accent-dim); box-shadow: 0 0 2px rgba(255,75,38,0.05); }
  100% { border-color: var(--accent); box-shadow: 0 0 8px rgba(255,75,38,0.15); }
}

.inline-input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--accent); /* Accent color text inside inputs to show it's active */
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 6px;
  width: 58px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.inline-input:focus {
  border-color: var(--accent);
  background: var(--bg-raised);
  outline: none;
}

.inline-input::-webkit-outer-spin-button,
.inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inline-input[type=number] {
  -moz-appearance: textfield;
}

.input-multiply {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0 2px;
}

/* Card Action Button Area */
.log-card-footer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.btn-success-solid {
  background: var(--success);
  color: #14181c;
  width: 100%;
}
.btn-success-solid:hover {
  background: #86e391;
  transform: translateY(-1px);
}