/* ==========================================================================
   O.R.D.E.R. Portal — "Book Prospectus" Design System
   Editorial / book interior aesthetic · Libre Baskerville + Source Sans 3
   ========================================================================== */

/* --- Design Tokens -------------------------------------------------------- */
:root {
  --navy:        #1B3A5C;
  --navy-dark:   #0F2440;
  --burgundy:    #703838;
  --gold:        #DCC909;
  --black:       #000000;
  --white:       #FFFFFF;
  --cream:       #FAFAF7;
  --text:        #1A1A1A;
  --text-sec:    #555D66;
  --text-muted:  #888888;
  --border:      #D5D5D5;
  --success:     #2D7D46;
  --error:       #8B2E2E;
  --error-bg:    #FDF2F2;
  --surface:     #F5F4F0;

  --font-heading: 'Libre Baskerville', 'Georgia', serif;
  --font-body:    'Source Sans 3', 'Helvetica Neue', sans-serif;

  --page-width: 680px;
  --spine-w:     6px;
  --header-h:    52px;

  --radius-sm:   2px;

  --ease: cubic-bezier(.4,0,.2,1);
}

/* --- Reset & Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
  background: var(--cream);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- Book Spine ----------------------------------------------------------- */
.spine { display: none; }

/* --- Top Nav Bar (authenticated pages) ------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 24px;
  padding-left: calc(var(--spine-w) + 24px);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-brand {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  transition: color var(--ease);
}
.topbar-link:hover { color: var(--text); }
.topbar-link.active { color: var(--text); font-weight: 600; }

/* --- Left Sidebar Navigation (authenticated pages) ------------------------ */
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--navy-dark, #0F2440);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: block;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  padding: 20px 20px 4px;
  text-decoration: none;
}
.sidebar-brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,.28);
  padding: 0 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 2px;
}
/* See .sidebar-nav below for combined styles */
.sidebar-link {
  display: block;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: all .15s ease;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.04);
  border-left-color: rgba(212,201,9,.3);
}
.sidebar-link.active {
  color: var(--white);
  background: rgba(255,255,255,.06);
  border-left-color: var(--gold);
  font-weight: 600;
}
.sidebar-link.indent {
  padding-left: 30px;
  font-size: 12px;
}
.sidebar-sublink {
  padding-left: 32px;
  font-size: 12px;
  color: rgba(255,255,255,.4) !important;
}
.sidebar-sublink:hover {
  color: rgba(255,255,255,.7) !important;
}
.sidebar-sublink.active {
  color: var(--white) !important;
  border-left-color: var(--gold);
  font-weight: 600;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 2px 0;
  flex: 1;
  overflow-y: auto;
}
.sidebar-phase {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.22);
  padding: 10px 20px 3px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 2px;
}
.sidebar-footer {
  padding: 10px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 0.65rem;
  color: rgba(255,255,255,.18);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hamburger {
  display: none;
}
.main-content {
  flex: 1;
  min-width: 0;
  padding-top: 40px;
  padding-bottom: 80px;
}

/* hide topbar when sidebar is used */
body.auth .topbar { display: none; }

/* mobile: sidebar collapses */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform .25s var(--ease);
    z-index: 100;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .hamburger {
    display: block;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 101;
    background: var(--navy);
    color: var(--white);
    border: none;
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
  }
  .main-content {
    padding-top: 20px;
    padding-bottom: 60px;
  }
}

/* --- Page Container ------------------------------------------------------- */
.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 32px;
}
.page-wide {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px;
}

/* --- Typography ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.35;
  color: var(--text);
}
h1 { font-size: 2.6rem; letter-spacing: 0.02em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

.chapter-num {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 16px;
}

.label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--burgundy);
}

.label-sm {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sub {
  color: var(--text-sec);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* --- Buttons -------------------------------------------------------------- */
.btn-gold,
.btn-outline,
.btn-primary,
.btn-secondary,
.btn-dark {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--ease);
  line-height: 40px;
  padding: 0 28px;
}

.btn-gold {
  background: var(--gold);
  color: var(--black);
}
.btn-gold:hover {
  background: #c4bc08;
  color: var(--black);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--text);
  background: rgba(0,0,0,.03);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--navy-dark);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-secondary:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-dark {
  background: var(--black);
  color: var(--white);
}
.btn-dark:hover {
  background: #222;
  color: var(--white);
}

/* ==========================================================================
   Landing Page — full book prospectus, no topbar
   ========================================================================== */

body.landing .topbar { display: none; }
body.landing .spine  { display: none; }

/* --- Half Title ----------------------------------------------------------- */
.half-title {
  padding: 140px 0 100px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.half-title h1 {
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}
.half-title .rule {
  width: 48px;
  height: 2px;
  background: var(--burgundy);
  margin: 0 auto 20px;
}
.half-title .subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-sec);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.7;
}
.half-title .author {
  margin-top: 40px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Chapter Sections (landing) ------------------------------------------- */
.landing-chapter {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.landing-chapter:last-of-type { border-bottom: none; }
.landing-chapter p {
  font-size: 0.92rem;
  color: var(--text-sec);
  margin-bottom: 16px;
  max-width: 560px;
}
.landing-chapter p:last-of-type { margin-bottom: 0; }

/* --- Pull Quote ----------------------------------------------------------- */
.pull-quote {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.pull-quote blockquote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.65;
  color: var(--text);
  max-width: 500px;
  margin: 0 auto;
  padding-left: 24px;
  border-left: 3px solid var(--navy);
}
.pull-quote cite {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 20px;
  padding-left: 27px;
}

/* --- Dark Section (The Problem) ------------------------------------------- */
.dark-section {
  background: var(--black);
  color: var(--white);
  padding: 80px 0;
}
.dark-section .page { max-width: var(--page-width); }
.dark-section .chapter-num { color: var(--gold); }
.dark-section h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 24px;
}
.dark-section p {
  font-size: 0.92rem;
  color: rgba(255,255,255,.6);
  line-height: 1.75;
  margin-bottom: 16px;
}
.dark-section .symptoms {
  margin-top: 28px;
  list-style: none;
}
.dark-section .symptoms li {
  font-size: 0.88rem;
  color: rgba(255,255,255,.7);
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding-left: 18px;
  position: relative;
}
.dark-section .symptoms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 5px;
  height: 5px;
  background: var(--burgundy);
  border-radius: 50%;
}

/* --- Module List (landing) ------------------------------------------------ */
.module-list-landing {
  padding-top: 8px;
}
.module-item-landing {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 20px;
}
.module-item-landing:last-child { border-bottom: none; }
.module-number-landing {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--navy);
  padding-top: 3px;
}
.module-body-landing h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 3px;
}
.module-body-landing .time {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 10px;
}
.module-body-landing p {
  font-size: 0.88rem;
  color: var(--text-sec);
  line-height: 1.7;
}

/* --- Enrollment (landing) ------------------------------------------------- */
.enrollment {
  padding: 80px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}
.enrollment .price-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.enrollment .price {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
}
.enrollment .alt {
  font-size: 0.82rem;
  color: var(--text-sec);
  margin-bottom: 32px;
}
.enrollment .includes {
  list-style: none;
  margin-bottom: 36px;
  padding-left: 0;
  display: inline-block;
  text-align: left;
}
.enrollment .includes li {
  font-size: 0.82rem;
  color: var(--text-sec);
  padding: 5px 0;
}
.enrollment .includes li::before {
  content: "— ";
  color: var(--navy);
}
.enrollment .guarantee {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Colophon (landing footer) -------------------------------------------- */
.colophon {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.colophon-brand {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
}
.colophon-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Authenticated Pages (dashboard, module, lesson, etc.)
   ========================================================================== */

.auth-content {
  padding-top: 40px;
  padding-bottom: 80px;
}

/* --- Progress Cards (dashboard) ------------------------------------------- */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 48px;
}
.progress-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 20px 16px;
  text-align: center;
}
.progress-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-card-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
}

/* --- Module List (dashboard) ---------------------------------------------- */
.module-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.module-card:first-child { border-top: 1px solid var(--border); }
.module-card:hover { background: rgba(0,0,0,.015); }
.module-card-num {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  width: 28px;
  padding-top: 3px;
}
.module-card h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 3px;
}
.module-card .sub {
  font-size: 0.82rem;
  line-height: 1.5;
}

/* --- Module Detail Page --------------------------------------------------- */
.module-header-detail {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.module-number-detail {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 8px;
}

/* --- Deliverables --------------------------------------------------------- */
.deliverables {
  margin-bottom: 32px;
}
.deliverables-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.deliverable-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.88rem;
  color: var(--text-sec);
  line-height: 1.5;
}
.deliverable-dash {
  color: var(--navy);
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Lesson List ---------------------------------------------------------- */
.lesson-list {
  margin-top: 20px;
  margin-bottom: 28px;
}
.lesson-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.lesson-item:hover { background: rgba(0,0,0,.015); }
.lesson-item:last-child { border-bottom: none; }
.lesson-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 22px;
}
.lesson-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

/* --- Progress Bar --------------------------------------------------------- */
.progress-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* --- Badges --------------------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.badge-completed {
  background: rgba(45,125,70,.1);
  color: var(--success);
}
.badge-in_progress {
  background: rgba(27,58,92,.06);
  color: var(--navy);
}
.badge-available {
  background: rgba(27,58,92,.06);
  color: var(--navy);
}
.badge-locked {
  background: rgba(0,0,0,.04);
  color: var(--text-muted);
}

/* --- Lesson Content ------------------------------------------------------- */
.lesson-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-sec);
  max-width: 620px;
}
.lesson-content h2 {
  font-size: 1.35rem;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--text);
}
.lesson-content p {
  margin-bottom: 16px;
}
.lesson-content ul, .lesson-content ol {
  margin: 12px 0 16px 20px;
}
.lesson-content li {
  margin-bottom: 6px;
}
.lesson-content blockquote {
  border-left: 3px solid var(--navy);
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text);
}

/* --- Forms ---------------------------------------------------------------- */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--ease);
  line-height: 1.5;
}
.form-input:focus {
  outline: none;
  border-color: var(--navy);
}
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 120px; }
.form-submit { width: 100%; margin-top: 8px; }
.form-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}

/* --- Modal ---------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-box {
  background: var(--white);
  max-width: 420px;
  width: 100%;
  padding: 36px 32px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 30px;
  text-align: center;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
}
.modal-desc {
  font-size: 0.88rem;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ==========================================================================
   Checkout
   ========================================================================== */

.checkout-page {
  max-width: 440px;
  margin: 0 auto;
}
.checkout-page h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.6rem;
  margin-bottom: 28px;
}
.order-summary {
  padding: 16px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}
.item-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
}
.item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.item-price {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
}
.checkout-form { margin-top: 8px; }
.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.btn-pay {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 44px;
  transition: background var(--ease);
}
.btn-pay:hover { background: #222; }
.payment-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 12px;
}
.error-banner {
  background: var(--error-bg);
  color: var(--error);
  padding: 12px 16px;
  border: 1px solid rgba(139,46,46,.15);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.back-link {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 24px;
}
.back-link:hover { color: var(--navy); }

/* ==========================================================================
   Checkout Success
   ========================================================================== */

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(45,125,70,.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-icon svg { width: 28px; height: 28px; color: var(--success); }
.success-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 8px;
}
.success-desc {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-sec);
  margin-bottom: 28px;
  line-height: 1.6;
}
.success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Reflection
   ========================================================================== */

.reflection-section h2 {
  font-weight: 400;
  margin-bottom: 8px;
}

/* ==========================================================================
   Welcome
   ========================================================================== */

.welcome-section h1 {
  font-weight: 400;
  margin-bottom: 20px;
}

/* ==========================================================================
   Progress Hero (dashboard)
   ========================================================================== */

.progress-hero {
  margin-bottom: 36px;
  padding: 28px 24px;
  background: var(--white);
  border: 1px solid var(--border);
  text-align: center;
}
.progress-hero-label {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}
.progress-hero-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-hero-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.progress-hero-pct {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Lesson Steps (module page)
   ========================================================================== */

.lesson-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lesson-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-body);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.lesson-step:hover {
  transform: scale(1.12);
}
.lesson-step--done {
  background: var(--navy);
  color: var(--white);
}
.lesson-step--todo {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
  :root { --page-width: 100%; }

  .half-title {
    padding: 100px 20px 72px;
  }
  .half-title h1 { font-size: 2.4rem; }

  .landing-chapter { padding: 56px 0; }
  .dark-section { padding: 56px 0; }
  .pull-quote blockquote { font-size: 1.1rem; }
  .module-item-landing { padding: 28px 0; }
  .enrollment { padding: 56px 0; }

  .topbar {
    padding-left: calc(var(--spine-w) + 12px);
    padding-right: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-nav {
    gap: 14px;
    flex-shrink: 0;
  }
  .topbar-link { font-size: 12px; white-space: nowrap; }
  .page, .page-wide { padding: 0 20px; }

  .auth-content { padding: 20px 0 60px; }

  .progress-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .progress-hero { padding: 20px 16px; }

  .colophon {
    flex-direction: column;
    gap: 6px;
  }

  .success-actions {
    flex-direction: column;
  }
  .success-actions .btn-primary,
  .success-actions .btn-secondary { width: 100%; }

  .modal-box { padding: 28px 20px; }

  .module-header-detail h2 { font-size: 1.3rem; }
  .module-number-detail { font-size: 2rem; }
}

/* Print */
@media print {
  .spine, .topbar, .colophon, .modal-backdrop,
  .btn-gold, .btn-outline, .btn-primary, .btn-secondary,
  .btn-dark, .btn-pay { display: none !important; }
  .auth-content { padding-top: 0; }
  body.landing .page { max-width: 100%; }
}

/* ==========================================================================
   Lesson Page — Editorial Layout
   ========================================================================== */
.lesson-header { margin-bottom: 40px; padding-bottom: 24px; border-bottom: 2px solid var(--black); }
.lesson-back { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 20px; display: inline-block; }
.lesson-back:hover { color: var(--burgundy); }
.lesson-meta { font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--burgundy); margin-bottom: 8px; }
.lesson-title-sm { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 400; line-height: 1.25; }
.video-frame { background: var(--navy-dark); border-radius: 4px; overflow: hidden; margin-bottom: 48px; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.video-frame iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.section-block { margin-bottom: 48px; }
.section-label { font-family: var(--font-body); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--burgundy); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.pull-quote-block { border-left: 3px solid var(--burgundy); padding: 12px 0 12px 24px; margin-bottom: 48px; font-family: var(--font-heading); font-size: 1.05rem; font-style: italic; line-height: 1.7; color: var(--text); background: linear-gradient(to right, rgba(112,56,56,.04), transparent); border-radius: 0 4px 4px 0; }
.pull-quote-block .section-label { font-style: normal; }
.pull-quote-block .lesson-content { font-family: var(--font-heading); font-style: italic; }
.journal-block { border: 1px solid var(--border); border-radius: 4px; padding: 24px; background: var(--cream); margin-bottom: 48px; }
.journal-block .section-label { margin-bottom: 16px; }
.journal-block h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 400; margin-bottom: 12px; }
.journal-block textarea { border: 1px solid var(--border); background: var(--white); font-family: var(--font-body); font-size: 0.9rem; line-height: 1.7; margin-top: 12px; }
.journal-block textarea:focus { border-color: var(--burgundy); outline: none; box-shadow: 0 0 0 2px rgba(112,56,56,.12); }
.journal-save { margin-top: 12px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; background: var(--navy); color: var(--white); border: none; padding: 8px 20px; border-radius: 3px; cursor: pointer; transition: background .2s ease; }
.journal-save:hover { background: var(--navy-dark); }
.quiz-section { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--black); }
.quiz-section h3 { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 400; margin-bottom: 24px; }
.quiz-card { background: var(--white); border: 1px solid var(--border); border-radius: 4px; padding: 20px; margin-bottom: 12px; transition: border-color .15s ease; }
.quiz-card:hover { border-color: var(--navy); }
.quiz-q { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.quiz-option { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.88rem; color: var(--text-sec); cursor: pointer; }
.quiz-option:hover { color: var(--text); }
.quiz-option input[type=radio] { accent-color: var(--navy); width: 16px; height: 16px; }
.quiz-text-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 3px; font-family: var(--font-body); font-size: 0.9rem; margin-top: 6px; }
.quiz-text-input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 2px rgba(27,58,92,.1); }
.quiz-submit { margin-top: 20px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; background: var(--navy); color: var(--white); border: none; padding: 12px 28px; border-radius: 3px; cursor: pointer; transition: background .2s; }
.quiz-submit:hover { background: var(--navy-dark); }
.quiz-feedback { margin-top: 28px; padding: 24px; border-radius: 4px; }
.quiz-feedback.pass { background: rgba(45,125,70,.08); border: 1px solid rgba(45,125,70,.2); }
.quiz-feedback.review { background: rgba(139,46,46,.06); border: 1px solid rgba(139,46,46,.15); }
.quiz-feedback-score { font-family: var(--font-heading); font-size: 1.2rem; margin-bottom: 16px; }
.quiz-feedback-item { font-size: 0.82rem; padding: 6px 0; color: var(--text-sec); border-bottom: 1px solid rgba(0,0,0,.05); }
.quiz-feedback-item:last-child { border-bottom: none; }
.lesson-nav { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lesson-nav-link { font-size: 0.82rem; color: var(--text-sec); transition: color .15s; }
.lesson-nav-link:hover { color: var(--text); }
.lesson-nav-link strong { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Flash Messages
   ========================================================================== */
.flash-wrap { margin-bottom: 24px; }
.flash {
  padding: 14px 20px;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 8px;
}
.flash-success {
  background: rgba(45,125,70,.08);
  border: 1px solid rgba(45,125,70,.2);
  color: #2d7d46;
}
.flash-error {
  background: rgba(139,46,46,.06);
  border: 1px solid rgba(139,46,46,.15);
  color: #8b2e2e;
}
.lesson-complete-btn { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; background: var(--gold); color: var(--black); border: none; padding: 12px 24px; border-radius: 3px; cursor: pointer; transition: background .2s; }
.lesson-complete-btn:hover { background: #c4bc08; }

/* ============================================================
   Avatar + Profile Dropdown
   ============================================================ */
.avatar-fixed {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 1000;
}
.avatar-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  border: none;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.avatar-btn:hover, .avatar-btn:focus {
  transform: scale(1.06);
  box-shadow: 0 3px 12px rgba(0,0,0,.18);
}
.avatar-dropdown {
  display: none;
  position: absolute;
  top: 52px;
  right: 0;
  width: 280px;
  background: var(--paper);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  overflow: hidden;
  padding: 20px 24px;
}
.avatar-dropdown.open { display: block; }
.avatar-dropdown-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.avatar-dropdown-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar-dropdown-name {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.2;
}
.avatar-dropdown-email {
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.avatar-dropdown-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 14px;
  line-height: 1.6;
}
.avatar-dropdown-meta strong { color: var(--navy); }
.avatar-dropdown-links {
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid rgba(0,0,0,.06);
  padding-top: 12px;
}
.avatar-dropdown-links a {
  font-size: 0.82rem;
  color: var(--navy);
  text-decoration: none;
  padding: 6px 0;
  transition: color .15s;
}
.avatar-dropdown-links a:hover { color: var(--gold); }
.avatar-dropdown-links .sign-out { color: var(--ink-muted); }

/* Profile page */
.profile-page { max-width: 600px; }
.profile-page h2 { font-family: var(--serif); color: var(--navy); margin-bottom: 24px; }
.profile-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 6px;
  padding: 28px 32px;
}
.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.profile-field { margin-bottom: 18px; }
.profile-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.profile-field .value {
  font-size: 0.95rem;
  color: var(--navy);
}
.profile-field input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--sans);
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 4px;
  color: var(--navy);
  background: var(--paper);
}
.profile-field input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,169,81,.1);
}
.profile-actions { margin-top: 24px; text-align: right; }
.profile-actions .btn-save {
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--gold); color: var(--black);
  border: none; padding: 10px 28px;
  border-radius: 3px; cursor: pointer;
}
.profile-actions .btn-save:hover { background: #c4bc08; }
