/* Academy — catalogue + course viewer. Shell (header/footer/menu/avatar) is
   provided by shared/app-chrome.css; this styles the Academy-specific views. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --ink: #16273F;
  --body: #4A5563;
  --muted: #8791A0;
  --muted-2: #98A2B0;
  --line: #EAEDF3;
  --line-2: #E7EBF1;
  --brand: #E8402A;
  --card-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
}

.academy-page {
  font-family: "Mulish", system-ui, sans-serif;
  color: #33404F;
  background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%);
}
.academy-page .app-shell { min-height: 100vh; display: flex; flex-direction: column; }
/* Match the suite convention: header/footer inner span the same 90% as content. */
.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }
.ac-main { flex: 1; width: 100%; }
.ac-loading, .ac-error { max-width: 90%; margin: 0 auto; padding: 48px 32px; color: var(--muted); font-size: 15px; }
.ac-error { color: #C0392B; }
.mono, .ac-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

/* ---------------- catalogue ---------------- */
.ac-hero { }
.ac-hero-inner { max-width: 90%; margin: 0 auto; padding: 34px 32px 8px; }
.ac-title { font-family: "Poppins"; font-weight: 800; font-size: 34px; letter-spacing: -0.6px; color: var(--ink); margin: 0 0 8px; }
.ac-subtitle { font-size: 15.5px; line-height: 1.6; color: var(--body); max-width: 760px; margin: 0 0 16px; }
.ac-chips { display: flex; gap: 12px; flex-wrap: wrap; }
.ac-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 15px; font-size: 13.5px; color: var(--body); box-shadow: var(--card-shadow); }
.ac-chip strong { font-family: "Poppins"; font-weight: 800; color: var(--ink); }

.ac-filterbar { max-width: 90%; margin: 0 auto; padding: 18px 32px 6px; }
.ac-filterbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ac-principle-seg { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; box-shadow: var(--card-shadow); }
.ac-seg { border: 0; background: none; cursor: pointer; font-family: "Poppins"; font-weight: 600; font-size: 13.5px; color: var(--body); padding: 8px 14px; border-radius: 9px; }
.ac-seg.active { background: var(--ink); color: #fff; }
.ac-filters { display: flex; gap: 10px; align-items: center; }
.ac-search-wrap { position: relative; }
.ac-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); display: flex; }
.ac-search { width: 300px; max-width: 60vw; padding: 11px 14px 11px 38px; font-family: "Mulish"; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid #E4E8EF; border-radius: 11px; outline: none; }
.ac-search:focus { border-color: #2F6FE0; box-shadow: 0 0 0 4px rgba(47, 111, 224, 0.12); }
.ac-select-wrap { position: relative; }
.ac-select { appearance: none; padding: 11px 34px 11px 14px; font-family: "Mulish"; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid #E4E8EF; border-radius: 11px; cursor: pointer; outline: none; }
.ac-select-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; }
.ac-count { max-width: 90%; margin: 0 auto; padding: 12px 32px 0; font-size: 13px; color: var(--muted); }

.ac-grid { max-width: 90%; margin: 0 auto; padding: 16px 32px 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ac-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); cursor: pointer; overflow: hidden; text-align: left; transition: transform .12s ease, box-shadow .12s ease; }
.ac-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(18, 38, 63, 0.10); }
.ac-card:focus-visible { outline: 2px solid #2F6FE0; outline-offset: 2px; }
.ac-card-bar { display: block; height: 8px; width: 100%; }
.ac-card-body { padding: 18px 20px 20px; }
.ac-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ac-card-sc { font-family: "Poppins"; font-weight: 800; font-size: 22px; letter-spacing: -0.5px; color: var(--ink); }
.ac-card-name { font-family: "Poppins"; font-weight: 700; font-size: 16px; color: var(--ink); margin: 12px 0 4px; }
.ac-card-principle { font-family: "Poppins"; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.ac-card-blurb { font-size: 13.5px; line-height: 1.55; color: var(--body); margin: 0 0 16px; }
.ac-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ac-card-lessons { font-size: 12.5px; color: var(--muted); }

.ac-level { font-family: "Poppins"; font-weight: 700; font-size: 11.5px; border-radius: 7px; padding: 3px 9px; }
.ac-level-a { color: #1F8A5B; background: #E7F7F1; }
.ac-level-aa { color: #2F6FE0; background: #EAF1FC; }
.ac-level-aaa { color: #6A45C9; background: #F1EEFC; }

.ac-status { font-family: "Poppins"; font-weight: 700; font-size: 11.5px; border-radius: 999px; padding: 4px 11px; }
.ac-status-completed { color: #1F8A5B; background: #E7F7F1; }
.ac-status-inprogress { color: #B5772E; background: #FCF6E4; }
.ac-status-notstarted { color: #8791A0; background: #EEF1F6; }

.ac-empty { max-width: 90%; margin: 0 auto; padding: 0 32px 60px; text-align: center; color: var(--muted); }
.ac-empty-title { font-family: "Poppins"; font-weight: 700; font-size: 18px; color: var(--ink); margin-bottom: 6px; }

/* ---------------- course viewer ---------------- */
.ac-course { max-width: 1080px; margin: 0 auto; padding: 26px 32px 56px; }
.ac-back { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 0; cursor: pointer; font-family: "Poppins"; font-weight: 600; font-size: 13.5px; color: #2F6FE0; margin-bottom: 16px; }
.ac-back:hover { color: #1E56C0; }
.ac-course-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.ac-course-sc { font-family: "Poppins"; font-weight: 800; font-size: 30px; letter-spacing: -0.6px; color: var(--ink); }
.ac-course-name { font-family: "Poppins"; font-weight: 700; font-size: 22px; color: var(--ink); margin: 2px 0 4px; }
.ac-course-meta { font-size: 13px; color: var(--muted); }
.ac-course-badges { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ac-course-done { display: inline-flex; align-items: center; gap: 6px; font-family: "Poppins"; font-weight: 700; font-size: 12.5px; color: #1F8A5B; background: #E7F7F1; border-radius: 999px; padding: 5px 13px; }

.ac-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ac-progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.ac-progress-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.ac-progress-label { font-family: "Poppins"; font-weight: 600; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.ac-slide { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 4px 20px rgba(18, 38, 63, 0.06); padding: 40px 44px; min-height: 440px; animation: acSlideIn .28s ease both; }
@keyframes acSlideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.ac-kicker { font-family: "Poppins"; font-weight: 700; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 10px; }
.ac-slide-title { font-family: "Poppins"; font-weight: 700; font-size: 28px; letter-spacing: -0.4px; color: var(--ink); margin: 0 0 18px; }
.ac-blocks { display: flex; flex-direction: column; gap: 16px; }
.ac-para { font-size: 16px; line-height: 1.7; color: var(--body); margin: 0; }
.ac-sub { font-family: "Poppins"; font-weight: 700; font-size: 15.5px; color: var(--ink); }
.ac-note { background: var(--pt, #EAF1FC); border-radius: 12px; padding: 14px 16px; font-size: 15px; line-height: 1.6; color: var(--ink); border: 1px solid rgba(0,0,0,0.03); }
.ac-code { background: #0E1B2A; color: #B7D2EC; border-radius: 12px; padding: 16px 18px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; overflow-x: auto; margin: 0; }
.ac-bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ac-bullet { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.6; color: var(--body); }
.ac-tick { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--pt, #EAF1FC); color: var(--pc, #2F6FE0); margin-top: 1px; }

.ac-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; }
.ac-nav-btn { font-family: "Poppins"; font-weight: 700; font-size: 14.5px; border: 0; border-radius: 12px; padding: 12px 26px; cursor: pointer; }
.ac-back-btn { background: #fff; border: 1px solid #E4E8EF; color: var(--ink); }
.ac-back-btn:disabled { color: #C6CDD8; cursor: not-allowed; }
.ac-next { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(232, 64, 42, 0.28); }
.ac-next:hover { background: #d5381f; }
.ac-finish { background: #1FA97A; color: #fff; box-shadow: 0 6px 16px rgba(31, 169, 122, 0.28); }
.ac-finish:hover { background: #188C64; }
.ac-dots { display: flex; align-items: center; gap: 7px; }
.ac-dot { width: 8px; height: 8px; border-radius: 999px; background: #D7DCE5; transition: all .2s ease; }
.ac-dot.active { width: 22px; }

/* ---------------- quiz ---------------- */
.ac-quiz-banner { background: #FCECEC; border: 1px solid #F3D3D3; color: #C0392B; border-radius: 12px; padding: 13px 16px; font-size: 14px; font-weight: 600; }
.ac-quiz { display: flex; flex-direction: column; gap: 18px; }
.ac-q { border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px; margin: 0; }
.ac-q.ok { border-color: #C9EBDD; background: #F4FBF8; }
.ac-q.bad { border-color: #F3D3D3; background: #FDF4F4; }
.ac-q-legend { font-family: "Poppins"; font-weight: 700; font-size: 15.5px; color: var(--ink); padding: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-q-status { font-family: "Poppins"; font-weight: 700; font-size: 11.5px; border-radius: 999px; padding: 3px 10px; }
.ac-q-status.ok { color: #1F8A5B; background: #E7F7F1; }
.ac-q-status.bad { color: #C0392B; background: #FCECEC; }
.ac-q-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ac-q-options { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.ac-q-option { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 11px; cursor: pointer; font-size: 15px; color: var(--ink); }
.ac-q-option.selected { border-color: #2F6FE0; background: #EAF1FC; }
.ac-q-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.ac-q-box { flex: 0 0 auto; width: 20px; height: 20px; border: 2px solid #C7D0DE; background: #fff; display: inline-block; }
.ac-q-option input[type="radio"] + .ac-q-box { border-radius: 50%; }
.ac-q-option input[type="checkbox"] + .ac-q-box { border-radius: 5px; }
.ac-q-option.selected .ac-q-box { border-color: #2F6FE0; background: #2F6FE0; box-shadow: inset 0 0 0 3px #fff; }
.ac-q-option input:focus-visible + .ac-q-box { outline: 2px solid #2F6FE0; outline-offset: 2px; }

@media (max-width: 1080px) {
  .ac-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .ac-grid { grid-template-columns: 1fr; }
  .ac-hero-inner, .ac-filterbar, .ac-count, .ac-grid, .ac-course { padding-left: 18px; padding-right: 18px; }
  .ac-filterbar-inner { flex-direction: column; align-items: stretch; }
  .ac-slide { padding: 28px 22px; }
}
