/* Forgd Trainers — design system.
 *
 * Single stylesheet, shared by login + dashboard + client detail.
 * Aligned with forgd-fit-website (the marketing site) so trainers
 * jumping from forgd.fit → trainers.forgd.fit experience one product.
 *
 * Typography matches marketing: Inter (sans), Fraunces (serif accents
 * for big numbers / headlines), JetBrains Mono (codes / metrics).
 * Accent palette also matches: warm orange + lime green.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Match forgd-fit accents */
  --brand: #FF7A4D;        /* accent-warm on marketing site */
  --brand-deep: #E94F1F;
  --accent-lime: #A8FF66;  /* used sparingly — checkmarks, success cues */

  --bg: #fafaf9;           /* warm off-white, matches marketing light mode */
  --bg-elev: #f3f3f1;
  --bg-card: #ffffff;
  --text: #15161a;
  --text-muted: #6b7280;
  --border: #e5e5e3;

  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --space: 16px;
  --max-content: 1100px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e10;
    --bg-elev: #15171a;
    --bg-card: #1a1c20;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #2c2f36;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.brand-logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-logo .accent { color: var(--brand); }

/* App chrome */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidenav {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidenav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.sidenav-link:hover { background: var(--border); text-decoration: none; }
.sidenav-link.active { background: var(--brand); color: white; }
.sidenav-link.active:hover { background: var(--brand-deep); }
.sidenav-spacer { flex: 1; }
.sidenav-bottom { font-size: 13px; color: var(--text-muted); padding: 8px 12px; }

.app-main {
  padding: 32px 48px;
  max-width: var(--max-content);
  width: 100%;
}

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidenav { flex-direction: row; padding: 12px 16px; overflow-x: auto; gap: 4px; }
  .sidenav-spacer { display: none; }
  .sidenav-bottom { display: none; }
  .app-main { padding: 16px; }
}

/* Cards / sections */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.section h2 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
}

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.05s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-deep); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-elev); text-decoration: none; }
.btn-danger { background: var(--danger); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px;
  background: var(--bg-card);
  color: var(--text);
}
.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

/* Login page-specific */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.04), rgba(233, 79, 31, 0.02));
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 380px;
}
.auth-card h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Status pills */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-elev);
  color: var(--text-muted);
}
.pill-active { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.pill-pending { background: rgba(217, 119, 6, 0.12); color: var(--warn); }
.pill-ended { background: rgba(220, 38, 38, 0.12); color: var(--danger); }

/* Tables */
.client-table {
  width: 100%;
  border-collapse: collapse;
}
.client-table th, .client-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.client-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.client-table tr:last-child td { border-bottom: none; }
.client-table a { color: var(--text); font-weight: 500; }
.client-table a:hover { color: var(--brand); }

/* Empty state */
.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon { font-size: 36px; margin-bottom: 8px; }

/* Error banners */
.alert-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Detail-page tabs */
.tab-row {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 10px 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Workout/nutrition rows */
.session-row {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.session-row .session-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.session-row .session-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.photo-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elev);
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
