/* ═══════════════════════════════════════════════════════════════
   LEARNLY — Online Learning Portal UI  (AAT-1)
   style.css — one shared stylesheet for all four pages.
   Design language: "the well-kept notebook" — ruled lines,
   highlighter marks and index tabs, because readable, consistent
   interfaces ARE the product. UI text is a grotesque; the lesson
   reader switches to a serif, like real reading apps do.
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────── 1. Design tokens ───────────────────────── */
:root {
  /* palette */
  --ink: #191627;            /* near-black violet ink          */
  --paper: #FFFFFF;          /* page background                */
  --tint: #F3F1FB;           /* lavender surface               */
  --line: #E6E2F3;           /* hairlines / ruled lines        */
  --muted: #6B667F;          /* secondary text                 */
  --violet: #5B3DF5;         /* primary                        */
  --violet-soft: #ECE7FE;    /* primary tint                   */
  --marker: #C6F24E;         /* highlighter lime               */
  --coral: #FF6B5E;          /* assignments / errors           */
  --ok: #12A150;

  /* type */
  --font-display: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --font-ui: "Karla", "Segoe UI", Arial, sans-serif;
  --font-read: "Source Serif 4", Georgia, serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  /* geometry */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(25, 22, 39, 0.1);
  --shadow-lift: 0 18px 44px rgba(25, 22, 39, 0.16);
}

/* ───────────────────────── 2. Reset & base ───────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1140px, 92%); margin-inline: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
}
.eyebrow::before { content: ""; width: 0.62em; height: 0.62em; background: var(--violet); border-radius: 3px; }

.section { padding: 92px 0; }
.section-head { max-width: 660px; margin-bottom: 44px; }
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.015em; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.15; margin-top: 12px; }
.section-head p { color: var(--muted); margin-top: 12px; }

/* highlighter-marker effect for key phrases */
.mark {
  background: linear-gradient(to top, rgba(198, 242, 78, 0.65) 42%, transparent 42%);
  padding: 0 0.08em;
}

/* ───────────────────────── 3. Buttons ───────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.82em 1.6em;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--violet);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(91, 61, 245, 0.32);
}
.btn-primary:hover { background: #4A2EDB; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #FFFFFF; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ───────────────────────── 4. Navbar ───────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; }
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.28rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.brand-mark {
  width: 27px; height: 27px;
  border-radius: 8px;
  background: var(--violet);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  box-shadow: 0 3px 8px rgba(91, 61, 245, 0.4);
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-weight: 700;
  font-size: 0.93rem;
  color: var(--muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-bottom-color: var(--marker); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-badge {
  min-width: 21px; height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--marker);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
.burger span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ───────────────────────── 5. Hero ───────────────────────── */
.hero { padding: 80px 0 88px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 54px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.3rem); line-height: 1.08; margin-top: 16px; }
.hero-sub { color: var(--muted); font-size: 1.08rem; max-width: 480px; margin-top: 18px; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-note { margin-top: 26px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.hero-note b { color: var(--ink); }

/* notebook panel with a floating course card */
.hero-stage {
  position: relative;
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--line) 27px 28px),
    var(--tint);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  min-height: 430px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-stage .course-card { width: 300px; box-shadow: var(--shadow-lift); transform: rotate(-2deg); }
@keyframes drift { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-7px); } }
.hero-stage .course-card { animation: drift 6s ease-in-out infinite; }
.float-chip {
  position: absolute;
  background: var(--ink);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 8px 13px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.float-chip.progress { top: 34px; right: 30px; transform: rotate(2deg); }
.float-chip.progress b { color: var(--marker); }
.float-chip.due { bottom: 34px; left: 26px; transform: rotate(-2deg); background: #FFFFFF; color: var(--ink); border: 1.5px solid var(--line); }
.float-chip.due b { color: var(--coral); }
@media (prefers-reduced-motion: reduce) {
  .hero-stage .course-card { animation: none; }
  html { scroll-behavior: auto; }
}

/* ───────────────────────── 6. The Reader (signature section) ─────────────────────────
   A sample lesson whose typography the user can tune live.
   Every control just changes a CSS custom property on .reader. */
.reader-section { background: var(--tint); border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.reader-layout { display: grid; grid-template-columns: 320px 1fr; gap: 36px; align-items: start; }

.ctrl-panel { background: #FFFFFF; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.ctrl-panel h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 18px;
}
.ctrl-group { margin-bottom: 20px; }
.ctrl-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 9px; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--tint); }
.seg button {
  flex: 1;
  padding: 9px 6px;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--ink); color: #FFFFFF; }
.ctrl-hint { font-size: 0.8rem; color: var(--muted); border-top: 1.5px dashed var(--line); padding-top: 14px; }
.ctrl-hint code { font-family: var(--font-mono); font-size: 0.74rem; color: var(--violet); }

/* the reader card — themed via [data-theme], sized via CSS vars */
.reader {
  --r-bg: #FFFFFF;
  --r-fg: #23202F;
  --r-muted: #6B667F;
  --r-line: #E6E2F3;
  --r-size: 18px;
  --r-lh: 1.75;
  background:
    repeating-linear-gradient(to bottom,
      transparent 0 calc(var(--r-size) * var(--r-lh) - 1px),
      var(--r-line) calc(var(--r-size) * var(--r-lh) - 1px) calc(var(--r-size) * var(--r-lh))),
    var(--r-bg);
  color: var(--r-fg);
  border: 1.5px solid var(--r-line);
  border-radius: var(--radius);
  padding: 34px 38px;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, color 0.2s ease;
}
.reader[data-theme="sepia"] { --r-bg: #F7EFDF; --r-fg: #3B3226; --r-muted: #7C7261; --r-line: #E7DCC4; }
.reader[data-theme="night"] { --r-bg: #171522; --r-fg: #E9E6F5; --r-muted: #9A95B2; --r-line: #2A2740; }

.reader-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.reader-meta .crumb { font-family: var(--font-mono); font-size: 0.74rem; color: var(--r-muted); letter-spacing: 0.06em; }
.pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--r-line);
  color: var(--r-muted);
}
.reader h3.lesson-title { font-size: 1.5rem; margin: 6px 0 14px; color: var(--r-fg); }
.reader .prose {
  font-family: var(--font-read);
  font-size: var(--r-size);
  line-height: var(--r-lh);
  max-width: 65ch;                 /* the classic readable measure */
}
.reader .prose p + p { margin-top: calc(var(--r-size) * var(--r-lh) * 0.5); }
.reader .prose .mark { color: #23202F; }

.callout {
  margin-top: 26px;
  border: 1.5px solid var(--coral);
  border-left-width: 5px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 94, 0.08);
  padding: 14px 18px;
  font-size: 0.92rem;
}
.callout b { color: var(--coral); font-family: var(--font-display); }

.resources { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.res-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 7px 13px;
  border-radius: 8px;
  background: var(--r-bg);
  border: 1.5px solid var(--r-line);
  color: var(--r-muted);
}

/* ───────────────────────── 7. Syllabus accordion + progress ───────────────────────── */
.syllabus-layout { display: grid; grid-template-columns: 1fr 330px; gap: 36px; align-items: start; }
.modules { border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #FFFFFF; }
.module + .module { border-top: 1.5px solid var(--line); }
.module-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  background: var(--tint);
  border: none;
  text-align: left;
}
.module-head:hover { background: #ECE9F8; }
.module-head .m-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.module-head .m-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.module-head .chev { transition: transform 0.2s ease; color: var(--muted); }
.module.open .chev { transform: rotate(90deg); }
.lessons { display: none; }
.module.open .lessons { display: block; }
.lesson {
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px 22px;
  border-top: 1.5px solid var(--line);
  font-size: 0.93rem;
}
.lesson:hover { background: #FBFAFE; }
.type-ic {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  background: var(--violet-soft);
  color: var(--violet);
}
.type-ic.assign { background: rgba(255, 107, 94, 0.14); color: var(--coral); }
.type-ic.read { background: rgba(18, 161, 80, 0.12); color: var(--ok); }
.lesson .dur { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }
.lesson input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--violet);
  cursor: pointer;
}
.lesson.done .l-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--marker); text-decoration-thickness: 2px; }

.progress-card {
  background: var(--ink);
  color: #FFFFFF;
  border-radius: var(--radius);
  padding: 26px 24px;
  position: sticky;
  top: 92px;
}
.progress-card h3 { font-size: 1.05rem; }
.progress-card .p-nums { font-family: var(--font-mono); font-size: 0.78rem; color: #B9B4CE; margin-top: 6px; }
.p-track { height: 12px; border-radius: 999px; background: #322E47; overflow: hidden; margin: 18px 0 8px; }
.p-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), var(--marker));
  transition: width 0.35s ease;
}
.p-pct { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; color: var(--marker); }
.progress-card .p-hint { font-size: 0.82rem; color: #B9B4CE; margin-top: 12px; }

/* ───────────────────────── 8. Features / stats / CTA ───────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature {
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--violet); }
.feature-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--violet-soft);
  color: var(--violet);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.feature h3 { font-size: 1.02rem; margin-bottom: 6px; }
.feature p { font-size: 0.9rem; color: var(--muted); }

.stat-strip { background: var(--ink); color: #FFFFFF; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 44px 0; }
.stat-item { padding: 6px 28px; border-left: 1px solid #322E47; }
.stat-item:first-child { border-left: none; }
.stat-item b {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2rem;
  color: var(--marker);
  line-height: 1.2;
}
.stat-item span { font-size: 0.85rem; color: #B9B4CE; }

.cta-band {
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--line) 27px 28px),
    var(--tint);
  padding: 52px 40px;
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta-band p { color: var(--muted); margin: 10px 0 24px; }

/* ───────────────────────── 9. Page head ───────────────────────── */
.page-head { padding: 58px 0 8px; }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 12px; }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 560px; }

/* ───────────────────────── 10. Course grid (products) ───────────────────────── */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 30px 0 34px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #FFFFFF;
  color: var(--muted);
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--violet); color: var(--violet); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--marker); }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 24px;
  padding-bottom: 96px;
}

/* the reusable course card — an index card with a coloured tab */
.course-card {
  position: relative;
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.course-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.course-tab {
  position: absolute;
  top: -1.5px;
  left: 22px;
  width: 64px;
  height: 8px;
  border-radius: 0 0 7px 7px;
  background: var(--accent, var(--violet));
}
.course-top { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.level {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--muted);
  border: 1.5px solid var(--line);
}
.rating { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink); }
.rating b { color: #E8A400; }
.course-card h3 { font-size: 1.12rem; line-height: 1.3; }
.instructor { font-size: 0.85rem; color: var(--muted); }
.course-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1.5px dashed var(--line);
  padding-top: 12px;
  margin-top: 2px;
}
.course-meta span b { color: var(--ink); }
.course-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.price { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; }
.add-btn {
  background: var(--ink);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.66em 1.2em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 0.15s ease, transform 0.15s ease;
}
.add-btn:hover { background: var(--violet); }
.add-btn.added { background: var(--ok); }
.add-btn:active { transform: scale(0.96); }

/* ───────────────────────── 11. Cart page ───────────────────────── */
.cart-layout { display: grid; grid-template-columns: 1fr 350px; gap: 28px; align-items: start; padding: 34px 0 96px; }
.cart-list { background: #FFFFFF; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-row {
  display: grid;
  grid-template-columns: 66px 1fr auto auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--line);
}
.cart-row:last-child { border-bottom: none; }
.swatch {
  width: 62px; height: 50px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--tint);
  position: relative;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}
.swatch::before {
  content: "";
  position: absolute;
  top: -1.5px;
  left: 10px;
  width: 26px; height: 6px;
  border-radius: 0 0 5px 5px;
  background: var(--accent, var(--violet));
}
.cart-item-name { font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; }
.cart-item-price { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #FFFFFF; }
.qty button { width: 32px; height: 32px; border: none; background: transparent; font-size: 1rem; font-weight: 700; color: var(--ink); }
.qty button:hover { background: var(--violet-soft); color: var(--violet); }
.qty output { min-width: 30px; text-align: center; font-family: var(--font-mono); font-size: 0.88rem; font-weight: 700; }
.line-total { font-family: var(--font-mono); font-weight: 700; min-width: 74px; text-align: right; }
.remove-btn { width: 32px; height: 32px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 0.95rem; }
.remove-btn:hover { border-color: var(--coral); color: var(--coral); background: rgba(255, 107, 94, 0.08); }

.summary { background: #FFFFFF; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 26px 24px; position: sticky; top: 92px; }
.summary h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 16px;
}
.summary-line { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--muted); margin-bottom: 10px; }
.summary-line span:last-child { font-family: var(--font-mono); color: var(--ink); }
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1.5px solid var(--line);
  padding-top: 14px;
  margin: 14px 0 20px;
  font-family: var(--font-display);
  font-weight: 700;
}
.summary-total span:last-child { font-family: var(--font-mono); font-size: 1.3rem; }
.summary-note { margin-top: 14px; font-size: 0.78rem; color: var(--muted); text-align: center; }

.empty-state {
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--line) 27px 28px),
    var(--tint);
  text-align: center;
  padding: 76px 30px;
  margin: 34px 0 96px;
}
.empty-mark {
  width: 66px; height: 66px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: var(--ink);
  display: grid;
  place-items: center;
  color: var(--marker);
  font-size: 1.4rem;
}
.empty-state h2 { font-size: 1.5rem; }
.empty-state p { color: var(--muted); margin: 8px 0 24px; }

/* ───────────────────────── 12. Payment page ───────────────────────── */
.pay-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: start; padding: 34px 0 96px; }
.pay-form { background: #FFFFFF; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 30px 28px; }
.pay-form fieldset { border: none; margin-bottom: 26px; }
.pay-form legend {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 16px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.field input {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #FCFBFE;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(91, 61, 245, 0.16); }
.field input.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.field input.invalid { border-color: var(--coral); background: rgba(255, 107, 94, 0.06); }
.err { font-size: 0.76rem; color: var(--coral); margin-top: 5px; min-height: 1em; visibility: hidden; }
.err.show { visibility: visible; }
.accepted { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; margin-top: -6px; margin-bottom: 16px; }

.mini-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 0.9rem; }
.mini-item .swatch { width: 50px; height: 40px; font-size: 0.72rem; }
.mini-item .m-name { flex: 1; font-weight: 700; font-family: var(--font-display); font-size: 0.88rem; }
.mini-item .m-qty { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.mini-item .m-price { font-family: var(--font-mono); font-weight: 700; }

/* ───────────────────────── 13. Toast & modal ───────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 80px);
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 90;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 22, 39, 0.62);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 44px 38px;
  max-width: 430px;
  width: 100%;
  text-align: center;
  animation: pop 0.3s ease;
}
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.check-mark {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: var(--violet);
  color: #FFFFFF;
  font-size: 2rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(91, 61, 245, 0.4);
}
.modal h2 { font-size: 1.5rem; }
.modal .order-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--tint);
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  display: inline-block;
  padding: 6px 14px;
  margin: 14px 0 8px;
}
.modal p { color: var(--muted); font-size: 0.92rem; margin-bottom: 22px; }

/* ───────────────────────── 14. Footer ───────────────────────── */
.footer { border-top: 1.5px solid var(--line); background: var(--tint); padding: 56px 0 0; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding-bottom: 44px; }
.footer-blurb { color: var(--muted); font-size: 0.9rem; max-width: 320px; margin-top: 12px; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 14px;
}
.footer ul { list-style: none; }
.footer li { margin-bottom: 9px; }
.footer li a { font-size: 0.92rem; }
.footer li a:hover { color: var(--violet); }
.footer-bottom {
  border-top: 1.5px solid var(--line);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}

/* ───────────────────────── 15. Responsive ───────────────────────── */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .reader-layout, .syllabus-layout { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-layout, .pay-layout { grid-template-columns: 1fr; }
  .summary, .progress-card { position: static; }
}
@media (max-width: 820px) {
  .burger { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #FFFFFF;
    border-bottom: 1.5px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px 4%;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 13px 4px; width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .stat-item:nth-child(3) { border-left: none; }
  .reader { padding: 26px 22px; }
}
@media (max-width: 620px) {
  .section { padding: 64px 0; }
  .features-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cart-row {
    grid-template-columns: 62px 1fr auto;
    grid-template-areas:
      "sw name remove"
      "sw qty  total";
    row-gap: 12px;
  }
  .swatch { grid-area: sw; }
  .cart-item-info { grid-area: name; }
  .qty { grid-area: qty; justify-self: start; }
  .line-total { grid-area: total; }
  .remove-btn { grid-area: remove; justify-self: end; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .stat-item { padding: 6px 16px; }
  .stat-item b { font-size: 1.6rem; }
  .lesson { grid-template-columns: 26px 1fr auto; }
  .lesson .dur { display: none; }
}
