/* ===== Design tokens ===== */
:root {
  --bg: #0E0E11;
  --surface: #18181C;
  --surface-2: #212126;
  --border: #2A2A30;
  --red: #E5342F;
  --red-dark: #B71F1F;
  --text: #F5F5F5;
  --text-muted: #9C9CA3;
  --green: #3DD68C;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }

a { color: var(--red); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Brand lockup ===== */
.brand { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.brand-mark { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--red); }

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--red);
  color: #fff;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover { background: var(--red-dark); }

/* Signature spark accent: a diagonal light sweep on primary CTAs only */
.btn-spark::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-spark:hover::after { left: 130%; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-small { padding: 8px 14px; font-size: 13px; }

/* ===== Auth screens ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-title { font-size: 26px; margin-top: 24px; }
.auth-subtitle { color: var(--text-muted); margin-top: 6px; font-size: 14px; }
.auth-switch { text-align: center; color: var(--text-muted); font-size: 14px; margin-top: 20px; }
.auth-switch a { text-decoration: none; font-weight: 600; }

.form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}
.field input:focus { border-color: var(--red); outline: none; }

.role-select { display: flex; gap: 8px; }
.role-option {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}
.role-option input { position: absolute; opacity: 0; }
.role-option:has(input:checked) {
  border-color: var(--red);
  color: var(--text);
  background: rgba(229,52,47,0.08);
}

/* ===== App shell ===== */
#app-shell { display: flex; min-height: 100vh; }

.sidebar {
  display: none;
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  flex-direction: column;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 32px; flex: 1; }
.logout-btn { margin-top: auto; }

.app-content { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.greeting { font-family: var(--font-display); font-size: 18px; font-weight: 600; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.page { flex: 1; padding: 0 20px 100px; }

/* ===== Nav items (shared styling for sidebar links + bottom nav) ===== */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  text-align: left;
  width: 100%;
}
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  z-index: 10;
}
.bottom-nav .nav-item {
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  padding: 6px 10px;
  width: auto;
  text-align: center;
}
.bottom-nav .nav-item.active { background: none; color: var(--red); }

/* ===== Dashboard components ===== */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 28px 0 12px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.quick-action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
}
.quick-action:hover { border-color: var(--red); }
.quick-action .qa-icon { font-size: 22px; display: block; margin-bottom: 8px; }
.quick-action .qa-label { font-size: 12px; font-weight: 600; display: block; }
.quick-action .qa-sub { font-size: 10px; color: var(--text-muted); display: block; margin-top: 2px; }

.help-banner {
  margin-top: 24px;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.help-banner-text h3 { font-size: 16px; }
.help-banner-text p { font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 4px; }
.help-banner .btn { background: #fff; color: var(--red-dark); width: auto; white-space: nowrap; }

.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.session-card .sc-title { font-weight: 600; font-size: 14px; }
.session-card .sc-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.session-card .sc-price { font-family: var(--font-mono); font-weight: 700; font-size: 14px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 32px; display: block; margin-bottom: 10px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 100;
  max-width: 90%;
}
.toast.error { border-color: var(--red); }

/* ===== Desktop ===== */
@media (min-width: 900px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .page { padding: 0 40px 60px; max-width: 900px; }
  .topbar { padding: 24px 40px; }
  .quick-actions { grid-template-columns: repeat(4, 1fr); max-width: 600px; }
}
