/* ============================================================
   The Small Business MBA. Member app styles.
   Brand: warm near-black + antique gold. Cormorant display, Barlow body.
   Mirrors the Notebook of a COO marketing site.
   ============================================================ */

:root {
  --black: #0A0A0C;
  --surface: #100F12;
  --surface-2: #17151B;
  --card: #161318;
  --white: #FAF7F0;
  --text: rgba(244,240,231,0.74);
  --text-bright: rgba(244,240,231,0.92);
  --text-muted: rgba(244,240,231,0.42);
  --border-subtle: rgba(244,240,231,0.09);
  --gold: #CBA85A;
  --gold-light: #EAC871;
  --gold-dim: rgba(203,168,90,0.10);
  --gold-border: rgba(203,168,90,0.26);
  --gold-grad: linear-gradient(135deg, #EAC871 0%, #C9A84C 100%);
  --display: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Barlow', Arial, sans-serif;
  --radius: 4px;
  --t: 0.22s ease;
  --max-w: 1080px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--black); color: var(--text); font-family: var(--sans);
  line-height: 1.7; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, h4, h5 { font-family: var(--display); color: var(--white); line-height: 1.12; font-weight: 700; }
a { color: inherit; text-decoration: none; transition: color var(--t); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--gold-border); background: transparent; color: var(--text-bright);
  padding: 12px 22px; border-radius: 999px; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: all var(--t); white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-dim); }
.btn--gold { background: var(--gold-grad); border-color: transparent; color: #1a1408; font-weight: 800; }
.btn--gold:hover { filter: brightness(1.06); color: #1a1408; }
.btn--sm { padding: 8px 16px; font-size: 0.82rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Header ──────────────────────────────────────────────── */
.hdr { position: sticky; top: 0; z-index: 100; background: rgba(10,10,12,0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-subtle); }
.hdr__inner { max-width: var(--max-w); margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 26px; }
.hdr__logo { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--white); letter-spacing: -0.01em; }
.hdr__logo-img { height: 30px; width: auto; display: block; }
.hdr__logo-div { width: 1px; height: 24px; background: var(--border-subtle); flex: none; }
.hdr__logo-txt span { color: var(--gold-light); }
.hdr__nav { display: flex; gap: 22px; margin-left: 8px; flex: 1; }
.hdr__nav a { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.hdr__nav a:hover { color: var(--text-bright); }
.hdr__nav a.is-active { color: var(--gold-light); }
.hdr__right { display: flex; align-items: center; gap: 12px; }
.hdr__avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--gold-grad); color: #1a1408;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.82rem;
  overflow: hidden;
}
.hdr__avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 620px) {
  .hdr__inner { padding: 12px 18px; gap: 14px; }
  .hdr__nav { gap: 14px; }
  .hdr__logo { font-size: 1.05rem; gap: 9px; }
  .hdr__logo-img { height: 26px; }
  .hdr__logo-div, .hdr__logo-txt { display: none; }
}

/* ── Page scaffolding ────────────────────────────────────── */
.page { padding: 44px 0 96px; }
.page__head { margin-bottom: 34px; }
.page__eyebrow { color: var(--gold); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; }
.page__title { font-size: clamp(2rem, 4vw, 3rem); color: var(--white); }
.page__sub { color: var(--text); max-width: 640px; margin-top: 10px; }

/* ── Cards / grids ───────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card { border: 1px solid var(--border-subtle); background: var(--card); border-radius: var(--radius); padding: 26px; transition: border-color var(--t), transform var(--t); }
.card:hover { border-color: var(--gold-border); }

/* Pillar card */
.pillar { display: flex; flex-direction: column; }
.pillar__eyebrow { color: var(--gold); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; }
.pillar__title { font-size: 1.5rem; color: var(--white); margin-bottom: 8px; }
.pillar__sub { color: var(--text); font-size: 0.92rem; line-height: 1.6; margin-bottom: 16px; flex: 1; }
.pillar__meta { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; }

/* Lesson row */
.lesson-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--border-subtle); background: var(--card); border-radius: var(--radius); margin-bottom: 10px; transition: border-color var(--t), transform var(--t); }
.lesson-row:hover { border-color: var(--gold-border); transform: translateX(2px); }
.lesson-row__num { font-family: var(--display); font-size: 1.2rem; color: var(--gold); min-width: 30px; font-weight: 700; }
.lesson-row__body { flex: 1; min-width: 0; }
.lesson-row__title { color: var(--white); font-weight: 600; font-size: 1.02rem; }
.lesson-row__summary { color: var(--text-muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-row__right { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.8rem; }
.lesson-row.is-locked { opacity: 0.72; }
.lock-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold-light); border: 1px solid var(--gold-border); border-radius: 999px; padding: 4px 10px; }
.tag-free { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #1a1408; background: var(--gold-grad); border-radius: 4px; padding: 2px 7px; }

/* ── Lesson body (brand-styled content) ──────────────────── */
.lesson-doc { max-width: 760px; margin: 0 auto; }
.lesson-doc h2 { color: var(--white); font-size: 1.7rem; border-bottom: 2px solid var(--gold-border); padding-bottom: 8px; margin: 36px 0 16px; }
.lesson-doc h3 { color: var(--gold-light); font-size: 1.25rem; margin: 26px 0 10px; }
.lesson-doc p { color: var(--text-bright); font-size: 1.02rem; line-height: 1.75; margin: 0 0 16px; }
.lesson-doc ul, .lesson-doc ol { color: var(--text-bright); margin: 0 0 16px; padding-left: 24px; line-height: 1.75; }
.lesson-doc li { margin-bottom: 7px; }
.lesson-doc strong { color: var(--white); }
.lesson-doc blockquote { border-left: 4px solid var(--gold); background: var(--surface-2); font-style: italic; color: var(--text-bright); padding: 14px 20px; margin: 22px 0; }
.lesson-doc a { color: var(--gold-light); text-decoration: underline; }
.lesson-doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.92rem; }
.lesson-doc th { background: var(--surface-2); color: var(--white); text-align: left; padding: 10px 12px; border: 1px solid var(--border-subtle); }
.lesson-doc td { padding: 10px 12px; border: 1px solid var(--border-subtle); color: var(--text-bright); }

/* ── Locked / subscribe banner ───────────────────────────── */
.locked-banner { border: 1px solid var(--gold-border); background: linear-gradient(160deg, var(--gold-dim), var(--card) 60%); border-radius: var(--radius); padding: 36px 32px; text-align: center; max-width: 620px; margin: 30px auto; }
.locked-banner h3 { font-size: 1.6rem; color: var(--white); margin-bottom: 10px; }
.locked-banner p { color: var(--text-bright); margin-bottom: 22px; }

/* ── Community feed ──────────────────────────────────────── */
.composer { border: 1px solid var(--border-subtle); background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; }
.composer textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius); color: var(--white); padding: 12px 14px; font: inherit; font-size: 0.98rem; resize: vertical; min-height: 84px; }
.composer textarea:focus { outline: none; border-color: var(--gold); }
.composer__actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.post { border: 1px solid var(--border-subtle); background: var(--card); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; }
.post__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gold-grad); color: #1a1408; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.post__who { display: flex; flex-direction: column; }
.post__name { color: var(--white); font-weight: 700; font-size: 0.95rem; }
.post__time { color: var(--text-muted); font-size: 0.78rem; }
.post__body { color: var(--text-bright); font-size: 1rem; line-height: 1.65; white-space: pre-wrap; word-wrap: break-word; }
.post__actions { display: flex; gap: 20px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.post__action { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--text-muted); font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: color var(--t); }
.post__action:hover { color: var(--gold-light); }
.post__action.is-on { color: var(--gold-light); }
.pin-flag { color: var(--gold); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }

.comments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 12px; }
.comment { display: flex; gap: 10px; }
.comment .avatar { width: 30px; height: 30px; font-size: 0.7rem; }
.comment__bubble { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.comment__name { color: var(--white); font-weight: 700; font-size: 0.84rem; }
.comment__body { color: var(--text-bright); font-size: 0.92rem; line-height: 1.55; white-space: pre-wrap; }

/* ── Forms ───────────────────────────────────────────────── */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  color: var(--white); padding: 12px 14px; font: inherit; font-size: 0.98rem; transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim); }

/* ── Auth page ───────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(203,168,90,0.10), transparent 60%), var(--black); }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; text-decoration: none; }
.auth-logo-img { height: 46px; width: auto; display: block; }
.auth-logo-txt { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--white); letter-spacing: -0.01em; }
.auth-logo-txt span { color: var(--gold-light); }
.auth-card { background: var(--card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 30px 28px; }
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; background: none; border: 0; color: var(--text-muted); font-weight: 700; font-size: 0.86rem; padding: 9px 0; border-radius: 999px; cursor: pointer; transition: all var(--t); }
.auth-tabs button.is-active { background: var(--gold-grad); color: #1a1408; }
.auth-form { display: block; }
.auth-err { background: rgba(180,60,60,0.14); border: 1px solid rgba(200,80,80,0.4); color: #f3c9c9; border-radius: var(--radius); padding: 10px 12px; font-size: 0.86rem; margin-bottom: 14px; }
.auth-fine { color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; margin-top: 14px; text-align: center; }
.auth-alt { text-align: center; color: var(--text-muted); font-size: 0.88rem; margin-top: 20px; }
.auth-alt a { color: var(--gold-light); }

/* ── States ──────────────────────────────────────────────── */
.loading, .empty { text-align: center; color: var(--text-muted); padding: 60px 20px; }
.empty h3 { color: var(--white); margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--radius); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Toast ───────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--surface-2); border: 1px solid var(--gold-border); color: var(--white); padding: 12px 20px; border-radius: 999px; font-size: 0.88rem; opacity: 0; pointer-events: none; transition: all var(--t); z-index: 9999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.backlink { display: inline-fl