/* Mathory — mini-course server chrome (auth + dashboard pages).
 * Aligned with the marketing-site editorial refresh: warm cream palette,
 * navy + gold accents, Playfair Display serif, Inter body/UI, near-sharp
 * corners on buttons, editorial label typography on nav.
 */

:root {
  /* Brand (preserved — match marketing site tokens) */
  --navy: #0f2e4a;
  --navy-2: #1a4066;
  --gold: #c8963e;
  --gold-2: #a87b28;

  /* Warm-shifted neutrals (match marketing site) */
  --ink: #14181c;
  --text: #14181c;
  --text-muted: #5a5f66;
  --text-tertiary: #7a8188;
  --cream: #faf7f0;
  --cream-2: #f0eadc;
  --accent-tint: #f9f0da;
  --border: #e8e3d3;

  /* Status colors */
  --danger: #b8342c;
  --success: #147a52;
  --warning: #a87b28;
  --info: #1a4066;

  --shadow: 0 1px 3px rgba(15, 46, 74, 0.06), 0 4px 12px rgba(15, 46, 74, 0.04);
  --shadow-lift: 0 4px 12px rgba(15, 46, 74, 0.08), 0 12px 32px rgba(15, 46, 74, 0.05);
  --radius: 2px;         /* near-sharp buttons — match marketing editorial */
  --radius-panel: 8px;   /* cards and larger surfaces */
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Site chrome (nav) --------------------------------------------- */
.nav {
  background: rgba(250, 247, 240, 0.94);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  min-height: 76px;
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: var(--navy);
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: -0.03em;
}
.brand svg { width: 1.4rem; height: 1.4rem; display: block; margin-right: 1px; }
.brand span { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: 'Inter', sans-serif;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.btn { text-transform: uppercase; }
.nav-user {
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-size: 0.75rem !important;
  color: var(--text-tertiary) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* --- Layout --------------------------------------------------------- */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.narrow {
  max-width: 560px;
  margin: 72px auto;
  padding: 0 24px;
}

/* --- Typography ----------------------------------------------------- */
h1, h2, h3 {
  font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  color: var(--navy);
  font-weight: 600;
  margin-top: 0;
}
h1 {
  font-size: 2.75rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
h2 {
  font-size: 1.85rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
h3 {
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 8px;
}
p { margin: 0 0 16px; color: var(--text-muted); }
p.lead {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.15rem; }
  .nav-links a { font-size: 0.75rem; letter-spacing: 0.06em; gap: 16px; }
}

/* --- Cards ---------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 32px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* --- Forms ---------------------------------------------------------- */
form { margin: 0; }
.field { margin-bottom: 20px; }
label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 46, 74, 0.08);
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}
.form-help {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.form-error {
  display: block;
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 8px;
}

/* --- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(2px); }
.btn-primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-2);
  border-color: var(--gold-2);
  color: #fff;
  transform: translateY(1px);
}
.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: transparent;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--gold);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--gold-2); }
.btn-block { width: 100%; }

/* --- Flash messages ------------------------------------------------- */
.flash {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-left-width: 3px;
  font-size: 0.95rem;
}
.flash-success { background: #eaf7f0; border-color: #b8e0cb; border-left-color: var(--success); color: var(--success); }
.flash-danger  { background: #fbecea; border-color: #f2c2bd; border-left-color: var(--danger); color: var(--danger); }
.flash-warning { background: var(--accent-tint); border-color: #ecd5a4; border-left-color: var(--warning); color: var(--warning); }
.flash-info    { background: #ecf1f8; border-color: #c9d6ea; border-left-color: var(--info); color: var(--info); }

/* --- Course tiles --------------------------------------------------- */
.course-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  min-height: 180px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-top-color 0.15s ease;
  border-top: 3px solid var(--border);
}
.course-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-top-color: var(--gold);
}
.course-tile.locked { opacity: 0.6; }
.course-tile .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.course-tile .actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.course-tile h3 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

/* --- Badges --------------------------------------------------------- */
.badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--cream-2);
  color: var(--text-muted);
}
.badge.owned { background: #eaf7f0; color: var(--success); }
.badge.trial-ending { background: #ffe0b2; color: #8a4e00; }
.badge.trial-expired { background: #f5c8c8; color: #7a1f1f; }

/* --- Footer --------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  margin-top: 72px;
}

/* --- Utilities ------------------------------------------------------ */
.text-muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 24px; }
