/* Morfos LMS — styles follow the "Morfos LMS dashboard prototype" design */
:root {
  --ink: #122d23; --muted: #5d6a63; --muted-2: #4a5a52; --line: #dedad0; --line-soft: #ebe8df;
  --bg: #f8f7f2; --surface: #fffefb; --primary: #205245; --primary-ink: #f8f7f2;
  --sage: #6a8d77; --sage-soft: #e6eadf; --stone: #efece4; --border-input: #c9c5b8;
  --on-dark-soft: #dfe4d8; --on-dark-faint: #bbc1af;
  --bad: #a8352b; --warn: #8a5d12;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); }
a:hover { color: var(--ink); }
button, input, select { font-family: inherit; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topbar.narrow .topbar-inner { max-width: 1040px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand img { height: 36px; width: auto; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name strong { font-size: 19px; font-weight: 400; letter-spacing: .3em; }
.brand-name small { font-size: 10px; letter-spacing: .3em; color: var(--muted); }
.mainnav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.navlink { padding: 10px 14px; border-radius: 999px; color: var(--muted-2); text-decoration: none; font-size: 15px; }
.navlink:hover { background: var(--sage-soft); color: var(--ink); }
.navlink[aria-current="page"] { background: var(--sage-soft); color: var(--ink); font-weight: 500; }
.navlink.as-button { background: none; border: 0; cursor: pointer; font: inherit; font-size: 15px; }

.account { position: relative; }
.account summary { list-style: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--primary); font-weight: 600; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.account summary::-webkit-details-marker { display: none; }
.account-menu { position: absolute; right: 0; top: 52px; z-index: 20; min-width: 220px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; box-shadow: 0 8px 24px rgba(18, 45, 35, .08); }
.account-menu p { margin: 6px 10px 8px; font-size: 13px; color: var(--muted); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 10px; border-radius: 6px;
  color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: 15px; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--sage-soft); }

/* ---------- Layout ---------- */
main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; flex: 1; }
main.narrow { max-width: 1040px; padding-top: 40px; }
.tagline { margin: 48px 0 32px; text-align: center; font-size: 14px; font-style: italic; color: var(--muted); }
h1 { margin: 0 0 8px; font-size: 38px; font-weight: 400; line-height: 1.15; }
h2 { font-weight: 500; }
.eyebrow { margin: 0 0 8px; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lede { margin: 0 0 28px; font-size: 18px; line-height: 1.55; color: var(--muted-2); max-width: 60ch; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .lede { margin: 0; }
.crumb { margin: 0 0 10px; font-size: 15px; }
.crumb a { text-decoration: none; }
.section { margin-bottom: 40px; }
.section-title { margin: 0 0 14px; font-size: 22px; font-weight: 500; }
.section-subtitle { margin: 28px 0 12px; font-size: 18px; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 4px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink); text-decoration: none;
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--primary-ink); }
.btn.secondary { background: var(--surface); color: var(--primary); }
.btn.secondary:hover { background: var(--sage-soft); color: var(--ink); }
.btn.ghost { background: none; border-color: transparent; color: var(--primary); padding-left: 4px; padding-right: 4px; }
.btn.ghost:hover { color: var(--ink); text-decoration: underline; }
.btn.on-dark { background: transparent; border-color: var(--primary-ink); color: var(--primary-ink); }
.btn.on-dark:hover { background: var(--primary-ink); color: var(--primary); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.linklike { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 15px; color: var(--primary); cursor: pointer; }
.linklike:hover { color: var(--ink); text-decoration: underline; }
.linklike.danger { color: var(--bad); }

/* ---------- Cards, pills ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px 28px; }
.chip { display: inline-block; font-size: 12px; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px;
  background: var(--sage-soft); color: var(--primary); font-weight: 500; white-space: nowrap; }
.chip.muted { background: var(--stone); color: var(--muted); }
.chip.bad { background: #f6e3e0; color: var(--bad); }
.messages { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.messages li { background: var(--sage-soft); border-radius: 8px; padding: 14px 18px; color: var(--ink); }
.messages li.error { background: #f6e3e0; }

/* ---------- Dashboard ---------- */
.hero { position: relative; background: var(--primary); color: var(--primary-ink); border-radius: 12px;
  padding: 40px 40px 56px; display: flex; align-items: center; gap: 32px; flex-wrap: wrap; overflow: hidden; }
.hero-text { flex: 999 1 420px; min-width: 0; }
.hero .eyebrow { color: var(--on-dark-faint); }
.hero h1 { font-size: 40px; margin-bottom: 12px; }
.hero p.hero-line { margin: 0; font-size: 18px; line-height: 1.55; color: var(--on-dark-soft); max-width: 52ch; }
.hero-badge { flex: none; width: 168px; height: 168px; margin-right: 24px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center; }
.hero-badge img { width: 112px; height: auto; transform: rotate(-10deg); }
.hero-crawler { position: absolute; left: 40px; bottom: 14px; height: 22px; width: auto; background: var(--bg);
  border-radius: 12px; padding: 3px 8px; box-sizing: content-box; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0 20px; align-items: center; }
.pills > span { font-size: 14px; color: var(--muted); margin-right: 4px; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 15px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-input); text-decoration: none; }
.pill:hover { background: var(--sage-soft); color: var(--ink); }
.pill[aria-current="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; }
.kpi p { margin: 0; }
.kpi .kpi-label { margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.kpi .kpi-value { font-size: 36px; font-weight: 500; line-height: 1.1; }
.kpi .kpi-sub { margin-top: 6px; font-size: 13px; color: var(--muted); }

.dash-cols { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; align-items: flex-start; }
.dash-main { flex: 999 1 560px; min-width: 0; }
.dash-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; font-size: 22px; }
.card-head span { font-size: 13px; color: var(--muted); }
.course-row { padding: 22px 0; border-top: 1px solid var(--line-soft); }
.course-row-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.course-row h3 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
.course-row h3 a { color: var(--ink); text-decoration: none; }
.course-row h3 a:hover { text-decoration: underline; }
.meta { margin: 0; font-size: 14px; color: var(--muted); }
.counts { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--muted-2); }
.counts strong { color: var(--ink); font-weight: 600; }
.counts .push { margin-left: auto; }
.card-foot { padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Progress: caterpillar crawls along the bar, butterfly waits at the end */
.journey { display: flex; align-items: flex-end; gap: 14px; margin-top: 18px; }
.journey-track { position: relative; flex: 1; padding-top: 26px; }
.journey-bar { height: 10px; border-radius: 999px; background: var(--sage-soft); overflow: hidden; }
.journey-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sage), var(--primary)); }
.journey-crawler { position: absolute; top: 0; height: 22px; width: auto; }
.journey-fly { width: 44px; height: auto; flex: none; transition: opacity .3s; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.avatar { width: 40px; height: 40px; border-radius: 8px; background: var(--sage-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { margin: 0; font-weight: 500; font-size: 16px; }
.list-row .title a { color: var(--ink); text-decoration: none; }
.list-row .title a:hover { text-decoration: underline; }
.list-row .sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.activity .icon { width: 44px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; }
.activity .icon img.fly { height: 30px; width: auto; }
.activity .icon img.cat { height: 14px; width: auto; }
.activity .icon svg { color: var(--primary); }
.activity p { margin: 0; font-size: 15px; line-height: 1.4; }
.activity p.when { margin-top: 2px; font-size: 13px; color: var(--muted); }
.side-empty { margin: 8px 0 0; font-size: 15px; color: var(--muted); }

/* ---------- Learner home ---------- */
.welcome { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 36px; }
.welcome-text { flex: 999 1 420px; min-width: 0; }
.welcome .lede { margin: 0; }
.tally { flex: 1 1 200px; display: flex; align-items: center; justify-content: center; gap: 18px; background: var(--sage-soft);
  border-radius: 12px; padding: 22px; }
.tally div { text-align: center; }
.tally img.cat { height: 20px; width: auto; display: block; margin: 10px auto 12px; }
.tally img.fly { height: 42px; width: auto; display: block; margin: 0 auto; }
.tally .n { margin: 0; font-size: 28px; font-weight: 500; }
.tally .l { margin: 0; font-size: 13px; color: var(--muted-2); white-space: nowrap; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 26px;
  display: flex; flex-direction: column; gap: 16px; }
.course-card .head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.course-card h3 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.3; }
.course-card p { margin: 0; font-size: 15px; color: var(--muted-2); line-height: 1.5; }
.course-card .btn { align-self: flex-start; }
.course-card.done { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.course-card.done p { color: var(--on-dark-soft); }
.course-card.done .chip { background: var(--bg); color: var(--primary); }
.flight { display: flex; align-items: center; gap: 16px; }
.flight img { width: 76px; height: auto; background: var(--bg); border-radius: 50%; padding: 12px; box-sizing: content-box; flex: none; }
.course-card.done .flight p { color: var(--primary-ink); font-size: 16px; }

/* ---------- Lists, tables, forms ---------- */
.course-list { list-style: none; margin: 0; padding: 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.course-list .course-row:first-child { border-top: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inactive { color: var(--bad); }
.empty { background: var(--surface); border: 1px dashed var(--border-input); border-radius: 8px; padding: 40px 24px; text-align: center; }
.empty p { color: var(--muted); margin: 0 0 16px; }
.empty img { height: 48px; width: auto; margin-bottom: 12px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px 28px; max-width: 560px; }
.panel.wide { max-width: none; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=file],
.copy-row input, .filter-row select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-input); border-radius: 4px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.help { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.help.flush { margin: 0 0 16px; }
.center { text-align: center; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--bad); font-size: 14px; }
.uploading { display: none; color: var(--muted); margin-left: 12px; }
form.busy .uploading { display: inline; }
.copy-row { display: flex; gap: 8px; margin-bottom: 16px; }
.copy-row input { flex: 1; min-width: 0; background: var(--sage-soft); }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.checks { margin: 0 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 24px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 8px 0; }
.checks input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--primary); }
.filter-row { display: flex; gap: 10px; align-items: center; margin: 0 0 20px; flex-wrap: wrap; }
.filter-row select { width: auto; min-width: 220px; }
.filter-row label { color: var(--muted); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
thead th { border-top: 0; color: var(--muted); font-weight: 500; background: var(--sage-soft);
  text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
td a { text-decoration: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.status { font-weight: 500; }
.status.passed, .status.completed { color: var(--primary); }
.status.failed { color: var(--bad); }
.status.incomplete { color: var(--warn); }
.muted-row td { color: var(--muted); }

/* ---------- Login & sign-up ---------- */
.auth { max-width: 420px; margin: 24px auto 0; }
.auth-logo { display: block; width: 200px; height: auto; margin: 0 auto 28px; }
.auth h1 { font-size: 28px; text-align: center; margin-bottom: 8px; }
.auth .lede { text-align: center; margin: 0 auto 24px; font-size: 16px; }
.auth .panel { max-width: none; }
.auth .btn { width: 100%; justify-content: center; }

@media (max-width: 640px) {
  .topbar-inner { padding: 12px 16px; gap: 12px; }
  .account { order: 1; }
  .mainnav { order: 2; width: 100%; }
  main { padding: 24px 16px 40px; }
  .hero { padding: 28px 24px 52px; }
  .hero h1, h1 { font-size: 30px; }
  .hero-badge { width: 120px; height: 120px; margin: 0; }
  .hero-badge img { width: 80px; }
  .hero-crawler { left: 24px; }
  .card, .panel { padding: 20px; }
  .course-list { padding: 0 20px; }
  .counts .push { margin-left: 0; }
}
.upload-progress { margin: 4px 0 18px; }
.upload-progress .help { margin-top: 8px; }
