/* Life AI Academy — learning area. Loaded after styles.css. */

.narrow { max-width: 680px; }
.h3 { font-size: 1.25rem; }
.small { font-size: .92rem; }
.crumbs { font-size: .92rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }

/* Notices */
.notice-error { border-color: #f1c4b6; background: #fdeee9; }
.notice-info { border-color: var(--line); background: var(--tint); }

/* Buttons */
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 14px 6px; font-weight: 600; }
.btn-link:hover { color: var(--navy); }
.btn-danger { background: var(--warn); color: #fff; }
.btn-danger:hover { background: #962f12; color: #fff; }
.btn-row form { margin: 0; }

/* Forms */
.form.flat { border: 0; padding: 0; background: none; max-width: none; }
.form.flat button { width: auto; }
.auth .form { margin-top: 10px; }
.inline-form { display: grid; gap: 0 10px; }
@media (min-width: 560px) {
  .inline-form { grid-template-columns: 1fr auto; align-items: end; }
  .inline-form label { grid-column: 1 / -1; }
  .inline-form button { margin-top: 0; }
}
details.danger { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
details.danger summary { cursor: pointer; color: var(--warn); font-weight: 700; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
dl.details dt { font-weight: 700; color: var(--navy); }
dl.details dd { margin: 0; overflow-wrap: anywhere; }
.card + .card { margin-top: 18px; }

/* Progress bar + pills */
.bar { height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; min-width: 0; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--tint); color: var(--navy); }
.pill-done { background: #e3f4ea; color: var(--ok); }
.pill-progress { background: #fdf0dc; color: var(--amber-ink); }
.pill-locked { background: #f1f1f1; color: #666; }

/* Dashboard */
.dash h1 { margin-bottom: 18px; }
.dash-top { margin-bottom: 30px; }
@media (min-width: 760px) { .dash-top { grid-template-columns: 3fr 2fr; } }
.continue .eyebrow { margin-bottom: 4px; }
.stat-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: center; text-align: center; }
.stat b { display: block; font-size: 1.8rem; color: var(--navy); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }
.course-grid { margin-bottom: 30px; }
.course-card { display: flex; flex-direction: column; }
.course-card h3 a { text-decoration: none; }
.course-card > p { flex: 1; }
.course-card .btn { align-self: flex-start; margin-top: 8px; }
.course-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.course-card.locked { background: #fbfbfa; }
.brain-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
@media (min-width: 700px) { .brain-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .brain-list { grid-template-columns: repeat(3, 1fr); } }
.brain-list li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.brain-list label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.brain-list input { width: 18px; height: 18px; flex: none; transform: translateY(3px); }

/* Course page */
.course-head { padding-bottom: 36px; }
.facts { display: grid; gap: 12px; margin: 18px 0; }
@media (min-width: 760px) { .facts { grid-template-columns: 2fr 1fr 1fr; } }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.facts b { display: block; color: var(--navy); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.module { margin-bottom: 28px; }
.lesson-list { list-style: none; padding: 0; margin: 0; counter-reset: none; }
.lesson-list li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lesson-title { font-weight: 700; }
.lesson-title a { text-decoration: none; }
.lesson-list .meta { white-space: nowrap; color: var(--amber-ink); font-weight: 600; }
.tick { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; font-size: .85rem; font-weight: 800; }
.tick.todo { background: #fff; border: 2px solid #c9ceda; }
.unlock { margin-bottom: 28px; border-color: var(--amber); }

/* Lesson page */
.lesson-wrap { display: grid; gap: 24px; padding-top: 28px; padding-bottom: 56px; }
@media (min-width: 980px) { .lesson-wrap { grid-template-columns: 290px minmax(0, 1fr); } }
.lesson-side { font-size: .95rem; }
@media (min-width: 980px) { .toc-box { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; } }
.toc-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.toc-box summary { cursor: pointer; font-weight: 800; }
.toc-box summary a { text-decoration: none; }
.toc-mod { margin: 14px 0 4px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--amber-ink); }
.toc { margin: 0; padding-left: 22px; }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; color: var(--text); }
.toc li.done::marker { content: "✔  "; color: var(--ok); }
.toc li.current a { font-weight: 800; color: var(--navy); }
.lesson { min-width: 0; max-width: 760px; }
.lesson-meta { color: var(--muted); font-size: .95rem; }
.lesson-body h2 { margin-top: 1.6em; }
.lesson-body h3 { margin-top: 1.3em; }
.lesson-body ul, .lesson-body ol { padding-left: 24px; margin: 0 0 1em; }
.lesson-body li { margin-bottom: 4px; }
.lesson-body li > ul, .lesson-body li > ol { margin: 4px 0 0; }
.lesson-body table { font-size: .96rem; margin-bottom: 1em; }
.lesson-body .table-wrap { margin-bottom: 1em; border: 1px solid var(--line); border-radius: 12px; }
.lesson-body code { background: var(--tint); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.lesson-body pre { background: var(--navy); color: #f3f5fa; padding: 16px; border-radius: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-size: .92rem; line-height: 1.5; margin: 0 0 1em; }
.lesson-body pre code { background: none; padding: 0; color: inherit; }
.lesson-body blockquote { margin: 0 0 1em; padding: 10px 16px; border-left: 4px solid var(--line); color: var(--muted); }
.lesson-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prompt { position: relative; margin: 0 0 1em; }
.prompt-head { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--amber-ink); margin-bottom: 6px; }
.prompt pre { margin: 0; border-top: 4px solid var(--amber); }
.copy-btn { float: right; margin: 0 0 6px 8px; background: var(--amber); color: var(--navy); border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-family: inherit; cursor: pointer; }
.copy-btn:hover { background: #f5b65c; }

/* Callouts */
.callout { border-radius: 12px; padding: 14px 18px; margin: 0 0 1em; border: 1px solid var(--line); background: var(--tint); }
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.callout-tip, .callout-success { border-color: #bfe3cd; background: #e9f6ef; }
.callout-warning, .callout-caution { border-color: #f0d9ae; background: #fff4e3; }
.callout-danger { border-color: #f1c4b6; background: #fdeee9; }
.callout-example { border-color: #d9cdf0; background: #f3effb; }

/* Checklists */
ul.tasks { list-style: none; padding-left: 0 !important; }
li.task label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 10px; border-radius: 10px; }
li.task label:hover { background: var(--tint-soft); }
li.task input { width: 20px; height: 20px; flex: none; margin-top: 3px; accent-color: var(--ok); }
li.task input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: #b5bccb; }

/* Quiz */
.quiz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 1.5em 0; }
.quiz-title { margin-top: 0; }
.quiz fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.quiz legend { font-weight: 700; color: var(--navy); margin-bottom: 8px; padding: 0; }
.quiz .opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.quiz .opt input { margin-top: 5px; flex: none; }
.quiz .q.right .opt.is-answer { border-color: var(--ok); background: #e9f6ef; }
.quiz .q.wrong input:checked + span { color: var(--warn); }
.quiz .q.wrong .opt.is-answer { border-color: var(--ok); background: #e9f6ef; }
.q-explain { font-size: .95rem; background: var(--tint-soft); border-radius: 10px; padding: 8px 12px; margin-top: 6px; }
.quiz-result { font-weight: 700; margin: 12px 0 0; }

/* Completion box + pager */
.complete-box { margin-top: 2em; padding: 20px; border-radius: var(--radius); background: #fff8ec; border: 1px solid #f3d8a8; }
.complete-box.done { background: #e9f6ef; border-color: #bfe3cd; }
.complete-box .tick { display: inline-grid; width: 22px; height: 22px; margin-right: 6px; vertical-align: -4px; }
.complete-box form button { width: auto; }
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 22px; font-size: .95rem; }
.pager a { text-decoration: none; max-width: 48%; }
.pager a:last-child { text-align: right; }

/* Completion record */
.record { background: #fff; border: 2px solid var(--navy); border-radius: 16px; padding: 36px 26px; text-align: center; outline: 6px solid #fdf0dc; outline-offset: -14px; }
.record h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.record-name { font-size: 1.8rem; font-weight: 800; color: var(--navy); margin: 18px 0 6px; }
.record-course { font-size: 1.4rem; font-weight: 800; color: var(--amber-dark); }
.record-result { font-size: .95rem; }
.fine-print { font-size: .8rem; color: var(--muted); margin-top: 20px; }

@media print {
  .site-header, .site-footer, .no-print, .notice, .skip { display: none !important; }
  body { background: #fff; }
  .section { padding: 0; }
}

/* Header link to the learning area */
.nav-learn { border: 1px solid var(--navy-line); }

/* Programme choice on the sign-up form */
fieldset.programme { border: 0; padding: 0; margin: 6px 0 4px; }
fieldset.programme legend { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.form .prog { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; border: 1px solid #c9ceda; border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; cursor: pointer; }
.form .prog:has(input:checked) { border-color: var(--amber-dark); background: #fff8ec; }
.form .prog input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.form input[type=password] { width: 100%; padding: 12px; border: 1px solid #c9ceda; border-radius: 10px; font: inherit; background: #fff; }

/* Reading mode: calmer display sizes than the marketing pages */
.app h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); letter-spacing: -.035em; line-height: 1.04; }
.app h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.025em; }
.lesson-body h2 { margin-top: 1.6em; }
.app .section { padding: 48px 0; }
@media (min-width: 900px) { .app .section { padding: 64px 0; } }
