/* ACSWP Learning: indigo and amber. Change the brand by editing the tokens below. */
:root {
  --indigo: #25235f;
  --indigo-deep: #18163f;
  --indigo-soft: #ecebf7;
  --amber: #f4a62a;
  --amber-hover: #e8951a;
  --amber-text: #8a5a00;
  --ink: #1d1c2b;
  --muted: #5d5b70;
  --line: #e3e1ec;
  --field: #cfcde0;
  --cream: #fbf8f2;
  --white: #ffffff;
  --success: #1f7a4d;
  --success-soft: #e6f4ec;
  --error: #b42318;
  --error-soft: #fdecea;
  --radius: 0;
  --shadow: 0 1px 2px rgba(24, 22, 63, .06), 0 8px 24px rgba(24, 22, 63, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.65 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--cream);
}
main { flex: 1; }
a { color: var(--indigo); }
h1, h2, h3 { line-height: 1.25; color: var(--indigo-deep); }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: .2em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* Top bar and footer */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 56px; padding: 10px clamp(16px, 4vw, 32px); background: var(--indigo-deep); color: var(--white);
}
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--white); text-decoration: none; }
.brand-mark { font-weight: 800; letter-spacing: .06em; }
.brand-sub { color: var(--amber); font-weight: 600; font-size: .95rem; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a, .linklike { color: var(--white); font: inherit; font-size: .95rem; text-decoration: none; }
.topnav form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; }
.topnav a:hover, .linklike:hover { text-decoration: underline; }
.topnav .account-menu { position: relative; }
.topnav .account-menu > summary { display: grid; width: 40px; height: 40px; place-items: center; border: 2px solid var(--white); border-radius: 50%; color: var(--white); cursor: pointer; list-style: none; }
.topnav .account-menu > summary::-webkit-details-marker { display: none; }
.topnav .account-menu > summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.topnav .account-popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: min(280px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); box-shadow: 0 12px 32px rgba(31, 28, 58, .18); }
.topnav .account-popover p { overflow-wrap: anywhere; margin: 0 0 12px; font-weight: 700; }
.topnav .account-popover form { margin: 0; }
.topnav .account-popover button { width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: #ecebf7; color: #302a7c; font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.topnav .account-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 20px clamp(16px, 4vw, 32px); font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line);
}

/* Shared pieces */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); }
.narrow { max-width: 560px; margin: clamp(24px, 6vw, 64px) auto; width: calc(100% - 32px); }
.eyebrow { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); }
.small { font-size: .875rem; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px;
  border-radius: 0; border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--amber); color: var(--indigo-deep); }
.btn-primary:hover { background: var(--amber-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--indigo); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--indigo); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.notice { border-radius: 0; padding: 12px 16px; margin: 0 0 16px; font-size: .95rem; }
.notice-error { background: var(--error-soft); color: var(--error); }
.notice-info { background: var(--indigo-soft); color: var(--indigo-deep); }
.notice-success { background: var(--success-soft); color: var(--success); }
.form { display: grid; gap: 14px; margin: 16px 0; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form input {
  font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid var(--field); border-radius: 0; background: var(--white); width: 100%;
}
.form input:focus { border-color: var(--indigo); outline: 2px solid var(--indigo-soft); }
.progress { height: 10px; border-radius: 0; background: var(--indigo-soft); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--amber); border-radius: 0; }
.progress-label { font-size: .875rem; color: var(--muted); margin: 8px 0 18px; }

/* Enrol */
.enrol {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: start;
  max-width: 1080px; width: 100%; margin: 0 auto; padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 32px);
}
.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li { background: var(--white); border: 1px solid var(--line); border-radius: 0; padding: 6px 14px; font-size: .9rem; }
.price { font-size: 2rem; font-weight: 800; color: var(--indigo-deep); margin: 0 0 12px; }
.price span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.enrol-card h2 { margin-top: 0; }

/* Course overview */
.course-home { max-width: 860px; width: 100%; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 32px); }
.course-hero { margin-bottom: 28px; }
.outline-section { background: var(--white); border: 1px solid var(--line); border-radius: 0; margin-bottom: 10px; }
.outline-section summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 700; color: var(--indigo-deep); }
.outline-num { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 0; background: var(--indigo-soft); font-size: .85rem; }
.outline-title { flex: 1; }
.outline-count { font-size: .85rem; color: var(--muted); font-weight: 600; }
.outline-section ol, .player-nav ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.outline-section li a, .player-nav li a {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 0; text-decoration: none; color: var(--ink); font-size: .95rem;
}
.outline-section li a:hover, .player-nav li a:hover { background: var(--cream); }
.tick { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 0; border: 2px solid var(--line); display: grid; place-items: center; font-size: .7rem; color: var(--white); }
.is-done .tick { background: var(--success); border-color: var(--success); }

/* Player */
.player { display: grid; grid-template-columns: 320px minmax(0, 1fr); flex: 1; }
.player-nav { background: var(--white); border-right: 1px solid var(--line); padding: 16px 8px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.player-nav-head { padding: 0 10px 12px; }
.back { font-size: .9rem; font-weight: 600; text-decoration: none; }
.small-bar { height: 6px; margin-top: 12px; }
.player-nav details summary { padding: 10px; font-weight: 700; font-size: .9rem; color: var(--indigo-deep); cursor: pointer; }
.player-nav li a { font-size: .9rem; }
.player-nav li.is-current a { background: var(--indigo-soft); font-weight: 700; }
.lesson { max-width: 820px; width: 100%; margin: 0 auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px) 48px; }
.nav-toggle { display: none; margin-bottom: 16px; }
.lesson-content { font-size: 1.02rem; overflow-wrap: anywhere; }
.lesson-content h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.lesson-content svg { display: none; }
.lesson-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .95rem; display: block; overflow-x: auto; }
.lesson-content th, .lesson-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; min-width: 140px; overflow-wrap: normal; }
.lesson-content th { background: var(--indigo-soft); }
.lesson-content ul, .lesson-content ol { padding-left: 1.3em; }
.activity { background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--amber); border-radius: 0; padding: 20px clamp(16px, 3vw, 28px); margin: 28px 0; }
.activity h2 { margin: .2em 0 .3em; }
.activity-kind { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-text); }
.question { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.question legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; margin-bottom: 8px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--indigo); background: var(--indigo-soft); }
.option input { margin-top: 5px; accent-color: var(--indigo); }
.reflection { display: grid; gap: 8px; font-weight: 600; font-size: .95rem; }
.reflection textarea { font: inherit; font-weight: 400; padding: 12px; border: 1px solid var(--field); border-radius: 0; resize: vertical; width: 100%; }
.lesson-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.lesson-footer form { margin: 0; }
.done-note { text-align: right; color: var(--success); }

@media (max-width: 900px) {
  .enrol { grid-template-columns: 1fr; }
  .player { grid-template-columns: minmax(0, 1fr); }
  .player-nav { display: none; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .player-nav.is-open { display: block; }
  .nav-toggle { display: inline-flex; }
  .lesson-footer { flex-direction: column-reverse; align-items: stretch; }
  .lesson-footer .btn, .lesson-footer form { width: 100%; }
  .done-note { text-align: center; }
}

/* ---------- Steps (one step on screen at a time when JavaScript is on) ---------- */
.lesson-meta { margin: -6px 0 22px; font-size: .9rem; color: var(--muted); }
.meta-done { color: var(--success); font-weight: 700; }
.stepper { list-style: none; margin: 0 0 24px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.stepper-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); background: var(--white);
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 0;
}
.stepper-num { display: grid; place-items: center; width: 24px; height: 24px; background: var(--indigo-soft); color: var(--indigo-deep); font-weight: 800; font-size: .8rem; }
.stepper-item.is-seen .stepper-num { background: var(--indigo); color: var(--white); }
.stepper-item.is-current { border-color: var(--indigo); color: var(--indigo-deep); }
.stepper-item.is-current .stepper-num { background: var(--amber); color: var(--indigo-deep); }
.js .step:not(.is-active) { display: none; }
.js .step.is-active { animation: step-in .25s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step + .step { margin-top: 40px; }
.js .step + .step { margin-top: 0; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; }
.step-nav:not(:has(.btn)) { display: none; }
.js .lesson-footer.is-hidden { display: none; }
.reflection-item + .reflection-item { margin-top: 24px; }

/* ---------- Section progress blocks ---------- */
.segs { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.seg { width: 10px; height: 10px; background: var(--indigo-soft); border: 1px solid var(--line); }
.seg.is-done { background: var(--success); border-color: var(--success); }
.segs-lg { gap: 5px; margin: 8px 0 22px; justify-content: center; }
.segs-lg .seg { width: 18px; height: 18px; }
.outline-section.is-complete .outline-num { background: var(--success); color: var(--white); }
.outline-lesson { flex: 1; }
.outline-min { flex: none; font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ---------- Celebration ---------- */
.celebrate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(24, 22, 63, .72); overflow: hidden; }
.celebrate-card { position: relative; z-index: 1; max-width: 460px; width: 100%; background: var(--white); border-top: 6px solid var(--amber); padding: 32px 28px; text-align: center; animation: pop .35s ease-out; }
.celebrate-card h2 { margin: .3em 0; font-size: 1.5rem; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: absolute; top: -20px; width: 10px; height: 10px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) {
  .js .step.is-active, .celebrate-card { animation: none; }
}

/* ---------- Interactive pieces rebuilt from the course ---------- */
.ix { margin: 22px 0; }
.ix-hint, .ix-label { margin: 0 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-text); }
.ix-hint::before { content: "→ "; }
.ix-hero { font-size: 1.15rem; font-weight: 700; color: var(--indigo); }

/* Flip cards */
.ix-flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ix-flip { display: grid; cursor: pointer; perspective: 1200px; min-height: 190px; outline-offset: 3px; }
.ix-flip-face { grid-area: 1 / 1; padding: 18px; border: 1px solid var(--line); background: var(--white); }
.ix-flip-front { display: flex; flex-direction: column; background: var(--indigo-deep); color: var(--white); border-color: var(--indigo-deep); }
.ix-num { font-size: .8rem; font-weight: 800; color: var(--amber); letter-spacing: .1em; }
.ix-flip-title { flex: 1; margin: 10px 0; font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.ix-cue { font-size: .8rem; font-weight: 700; color: var(--amber); }
.ix-cue::after { content: " ↻"; }
.ix-flip-backtitle { margin: 0 0 6px; font-weight: 800; color: var(--indigo-deep); }
.ix-flip-back { border-top: 4px solid var(--amber); font-size: .95rem; }
.ix-flip-back p, .ix-flip-back ul { margin: .4em 0; }
.js .ix-flip-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s ease; }
.js .ix-flip-back { transform: rotateY(180deg); }
.js .ix-flip.is-flipped .ix-flip-front { transform: rotateY(-180deg); }
.js .ix-flip.is-flipped .ix-flip-back { transform: rotateY(0); }
.ix-flip:hover .ix-flip-front { background: var(--indigo); }

/* Accordion */
.ix-acc-item { border: 1px solid var(--line); background: var(--white); margin-bottom: 8px; }
.ix-acc-item summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 700; color: var(--indigo-deep); cursor: pointer; list-style: none; }
.ix-acc-item summary::-webkit-details-marker { display: none; }
.ix-acc-item summary::after { content: "+"; flex: none; width: 24px; height: 24px; display: grid; place-items: center; background: var(--amber); color: var(--indigo-deep); font-weight: 800; }
.ix-acc-item[open] summary::after { content: "−"; }
.ix-acc-item[open] { border-color: var(--indigo); }
.ix-acc-body { padding: 0 16px 14px; }

/* Tabs */
.ix-tabpanel { padding: 16px; background: var(--white); border: 1px solid var(--line); border-top: 0; }
.ix-tabpanel-title { margin: 0 0 6px; font-weight: 800; color: var(--indigo-deep); }
.js .ix-tabpanel-title { display: none; }
.ix-tabpanel + .ix-tabpanel { margin-top: 12px; }
.js .ix-tabpanel + .ix-tabpanel { margin-top: 0; }

/* Carousel */
.ix-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--white); border: 1px solid var(--line); }
.ix-track::-webkit-scrollbar { display: none; }
.ix-slide { flex: 0 0 100%; scroll-snap-align: start; padding: 22px; min-width: 0; }
.ix-slide-count { margin: 0; font-size: .78rem; font-weight: 800; color: var(--amber-text); }
.ix-slide-title { margin: 4px 0 8px; font-size: 1.15rem; font-weight: 800; color: var(--indigo-deep); }
.ix-carousel-nav { display: none; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
.js .ix-carousel-nav { display: flex; }
.ix-prev, .ix-next { width: 44px; height: 44px; border: 0; background: var(--indigo-deep); color: var(--white); font: inherit; font-size: 1.1rem; cursor: pointer; }
.ix-prev:disabled, .ix-next:disabled { opacity: .3; cursor: default; }
.ix-carousel-status { min-width: 60px; text-align: center; font-weight: 700; color: var(--muted); }

/* Key takeaways, practice list and quotes */
.ix-kp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ix-kp { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--amber); padding: 16px; }
.ix-kp-title { margin: 0 0 6px; font-weight: 800; color: var(--indigo-deep); }
.ix-kp p { margin: .3em 0; }
.ix-list { list-style: none; padding: 0; counter-reset: ix; }
.ix-list-item { counter-increment: ix; position: relative; padding: 16px 16px 16px 64px; margin-bottom: 10px; background: var(--white); border: 1px solid var(--line); }
.ix-list-item::before { content: counter(ix); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; display: grid; place-items: center; background: var(--indigo-deep); color: var(--amber); font-weight: 800; }
.ix-list-title { margin: 0 0 4px; font-weight: 800; color: var(--indigo-deep); }
.ix-list-item p { margin: .3em 0; }
.ix-quote { margin: 26px 0; padding: 18px 22px; border-left: 6px solid var(--amber); background: var(--indigo-deep); color: var(--white); }
.ix-quote blockquote { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.5; }
.ix-quote figcaption { margin-top: 8px; font-size: .9rem; color: var(--amber); }

@media (max-width: 600px) {
  .stepper-label { display: none; }
  .stepper-item { padding: 6px; }
  .step-nav { flex-direction: column-reverse; align-items: stretch; }
  .step-nav .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .js .ix-flip-face { transition: none; }
}

/* Tabs as a wrapping grid of square buttons (long tab names stay readable on phones) */
.ix-tablist { display: none; }
.js .ix-tablist { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; margin-bottom: 6px; }
.ix-tab { padding: 10px 12px; border: 1px solid var(--line); background: var(--white); font: inherit; font-size: .88rem; font-weight: 700; line-height: 1.35; color: var(--indigo-deep); cursor: pointer; text-align: left; }
.ix-tab:hover { border-color: var(--indigo); }
.ix-tab[aria-selected="true"] { background: var(--indigo-deep); color: var(--white); border-color: var(--indigo-deep); box-shadow: inset 0 -4px 0 var(--amber); }
.js .ix-tabpanel { border-top: 1px solid var(--line); }
