/* BizGrow Academy — public site + student area
   Palette borrowed from Sri Lankan shop signboards: estate green and marigold. */

:root {
  --ink: #0f2e27;
  --estate: #145a4a;
  --estate-deep: #0c3f34;
  --leaf: #23855a;
  --marigold: #f4b400;
  --marigold-soft: #fff2c7;
  --paper: #f5f7f5;
  --surface: #ffffff;
  --line: #d6e1dc;
  --line-strong: #b9cbc3;
  --muted: #56695f;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok-soft: #e4f4ea;

  --font-head: "Bricolage Grotesque", "Yaldevi", system-ui, sans-serif;
  --font-body: "Figtree", "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --wrap: 1180px;
  --gutter: 20px;
  --focus: 0 0 0 3px rgba(244, 180, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
:lang(si) body, body:lang(si) { line-height: 1.75; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--estate); text-underline-offset: 3px; }
a:hover { color: var(--estate-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.2em; }
.ic-fill { fill: currentColor; stroke: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--marigold); color: var(--ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 1rem/1 var(--font-body);
  padding: .85em 1.35em; border-radius: var(--r-sm); border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--marigold); color: var(--ink); border-color: var(--marigold); }
.btn-primary:hover { background: #e2a600; border-color: #e2a600; color: var(--ink); }
.btn-dark { background: var(--estate); color: #fff; border-color: var(--estate); }
.btn-dark:hover { background: var(--estate-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--estate); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--estate); color: var(--estate-deep); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: .55em .9em; font-size: .9rem; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--estate); cursor: pointer; text-decoration: underline; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel],
.field input[type=number], .field input[type=file], .field select, .field textarea {
  width: 100%; font: 400 1rem/1.4 var(--font-body); color: var(--ink);
  padding: .75em .9em; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--estate); box-shadow: var(--focus); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: .875rem; margin-top: 4px; }
.check { display: flex; gap: .6em; align-items: flex-start; font-size: .95rem; }
.check input { margin-top: .3em; width: 18px; height: 18px; accent-color: var(--estate); }

.alert { padding: 12px 16px; border-radius: var(--r-sm); margin: 0 0 18px; border-left: 4px solid; background: #fff; }
.alert-success { border-color: var(--leaf); background: var(--ok-soft); }
.alert-error { border-color: var(--danger); background: var(--danger-soft); }
.alert-info { border-color: var(--marigold); background: var(--marigold-soft); }
.flash-stack { position: relative; z-index: 5; }
.flash-stack .alert { margin: 14px 0 0; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand small { font-weight: 600; color: var(--estate); }
.main-nav { display: flex; gap: 6px; margin-left: 8px; }
.main-nav a { text-decoration: none; color: var(--ink); font-weight: 500; padding: 8px 12px; border-radius: var(--r-sm); }
.main-nav a:hover, .main-nav a.on { background: var(--paper); color: var(--estate); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; font-size: .85rem; }
.lang-switch a { padding: 5px 11px; text-decoration: none; color: var(--muted); font-weight: 600; }
.lang-switch a.on { background: var(--estate); color: #fff; }
.user-menu { position: relative; }
.user-menu > button {
  display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 4px; font: 600 .95rem var(--font-body); color: var(--ink); cursor: pointer;
}
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--estate); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  min-width: 210px; padding: 6px; display: none; box-shadow: 0 12px 30px -12px rgba(15, 46, 39, .35);
}
.user-menu.open .menu { display: block; }
.user-menu .menu a, .user-menu .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink); background: none; border: 0; font: 500 .95rem var(--font-body); cursor: pointer; text-align: left;
}
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--paper); }
.nav-toggle { display: none; background: none; border: 0; padding: 6px; color: var(--ink); cursor: pointer; }
.nav-toggle .ic { width: 26px; height: 26px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 10px var(--gutter) 16px; margin: 0; display: none;
  }
  .site-header.nav-open .main-nav { display: flex; }
  .header-actions .btn-ghost.hide-sm { display: none; }
  .user-menu > button .name { display: none; }
}

/* ---------- home ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero h1 { max-width: 15ch; }
:lang(si) .hero h1 { max-width: 18ch; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.3; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-search { margin-top: 28px; display: flex; max-width: 460px; border: 2px solid var(--ink); border-radius: var(--r-sm); background: #fff; }
.hero-search input { flex: 1; border: 0; padding: .8em 1em; font: 1rem var(--font-body); background: transparent; min-width: 0; }
.hero-search input:focus { outline: none; }
.hero-search button { border: 0; background: var(--ink); color: #fff; padding: 0 18px; cursor: pointer; }

/* The one loud element: a marigold signboard with rising bars */
.signboard {
  position: relative; background: var(--marigold); border-radius: 14px; aspect-ratio: 5 / 4.4;
  padding: 28px; display: flex; flex-direction: column; justify-content: flex-end;
}
.signboard .bars { display: flex; align-items: flex-end; gap: 4%; height: 70%; padding: 0 4%; }
.signboard .bar { flex: 1; background: var(--estate); border-radius: 6px 6px 0 0; transform-origin: bottom; }
.signboard .bar:nth-child(1) { height: 22%; }
.signboard .bar:nth-child(2) { height: 38%; }
.signboard .bar:nth-child(3) { height: 52%; }
.signboard .bar:nth-child(4) { height: 74%; }
.signboard .bar:nth-child(5) { height: 100%; background: var(--ink); }
.signboard .ground { height: 4px; background: var(--ink); border-radius: 2px; }
.signboard .lesson-chip {
  position: absolute; left: -26px; top: 30px; background: #fff; border-radius: var(--r-md); padding: 14px 16px;
  display: flex; gap: 12px; align-items: center; max-width: 290px; box-shadow: 0 16px 40px -18px rgba(15, 46, 39, .55);
  text-decoration: none; color: var(--ink);
}
.lesson-chip .play { width: 42px; height: 42px; border-radius: 50%; background: var(--estate); color: #fff; display: grid; place-items: center; flex: none; }
.lesson-chip .play .ic { fill: currentColor; stroke: none; }
.lesson-chip strong { display: block; font-size: .95rem; line-height: 1.3; }
.lesson-chip span { font-size: .8rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .signboard .bar { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .signboard .bar:nth-child(2) { animation-delay: .08s; }
  .signboard .bar:nth-child(3) { animation-delay: .16s; }
  .signboard .bar:nth-child(4) { animation-delay: .24s; }
  .signboard .bar:nth-child(5) { animation-delay: .32s; }
  @keyframes rise { from { transform: scaleY(.05); } to { transform: scaleY(1); } }
}
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; gap: 36px; }
  .signboard { aspect-ratio: 16 / 10; }
  .signboard .lesson-chip { left: 16px; top: 16px; }
}

.section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); max-width: 52ch; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* course cards */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.course-card:hover { border-color: var(--estate); }
.course-card:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; }
.course-thumb { aspect-ratio: 16 / 9; background: var(--estate); position: relative; overflow: hidden; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--marigold); font: 800 2.4rem var(--font-head); }
.course-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card h3 { font-size: 1.08rem; margin: 0; line-height: 1.35; }
.course-card .by { font-size: .875rem; color: var(--muted); }
.course-card .meta { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); }
.course-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-card .price-row { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; gap: 8px; border-top: 1px dashed var(--line); }
.price { font: 700 1.15rem var(--font-head); }
.price-was { text-decoration: line-through; color: var(--muted); font-size: .9rem; }
.price-free { color: var(--leaf); }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper); color: var(--estate); border: 1px solid var(--line); }
.tag-gold { background: var(--marigold-soft); border-color: #f1d98a; color: #6b4f00; }

/* steps — a real sequence, so numbers are earned */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.steps li { list-style: none; padding: 22px 22px 0 0; position: relative; }
.steps li::before { counter-increment: step; content: counter(step); font: 800 2.6rem/1 var(--font-head); color: var(--estate); display: block; margin-bottom: 10px; }
.steps h3 { font-size: 1.05rem; }
.steps p { color: var(--muted); font-size: .95rem; margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 26px; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.reasons h3 { display: flex; gap: 10px; align-items: center; }
.reasons h3 .ic { color: var(--estate); width: 1.4em; height: 1.4em; }
.reasons p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .reasons { grid-template-columns: 1fr; gap: 22px; } }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform .2s; }
.faq details[open] summary .ic { transform: rotate(90deg); }
.faq details p { color: var(--muted); }

.cta-band { background: var(--estate); color: #fff; }
.cta-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 44px; padding-bottom: 44px; flex-wrap: wrap; }
.cta-band h2 { margin: 0; max-width: 24ch; }

.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); }
.empty p { color: var(--muted); }

/* ---------- catalogue ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 36px 0 28px; }
.page-head h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.filters .search { display: flex; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; flex: 1 1 260px; max-width: 380px; }
.filters .search input { border: 0; flex: 1; padding: .6em .8em; font: 1rem var(--font-body); min-width: 0; background: transparent; }
.filters .search input:focus { outline: none; }
.filters .search button { border: 0; background: none; padding: 0 12px; color: var(--muted); cursor: pointer; }
.chip { display: inline-flex; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 500; background: #fff; }
.chip.on, .chip:hover { border-color: var(--estate); color: var(--estate); }
.chip.on { background: var(--estate); color: #fff; }

/* ---------- course page ---------- */
.course-hero { background: var(--estate-deep); color: #fff; }
.course-hero .wrap { display: grid; grid-template-columns: 1fr 360px; gap: 40px; padding-top: 44px; padding-bottom: 44px; }
.course-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); color: #fff; }
.course-hero .sub { font-size: 1.12rem; color: #d3e5dd; max-width: 60ch; }
.course-hero .facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; color: #d3e5dd; font-size: .95rem; }
.course-hero .facts span { display: inline-flex; gap: 6px; align-items: center; }
.course-hero .crumbs { font-size: .9rem; margin-bottom: 14px; }
.course-hero .crumbs a { color: var(--marigold); }
.buy-card { background: #fff; color: var(--ink); border-radius: var(--r-md); overflow: hidden; align-self: start; position: relative; top: 0; }
.buy-card .media { aspect-ratio: 16 / 9; background: var(--estate); position: relative; }
.buy-card .media iframe, .buy-card .media img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.buy-card .inner { padding: 20px; }
.buy-card .price { font-size: 1.8rem; }
.buy-card ul { list-style: none; padding: 0; margin: 16px 0 0; font-size: .92rem; }
.buy-card li { display: flex; gap: 8px; padding: 4px 0; }
.buy-card li .ic { color: var(--leaf); }
.course-body { display: grid; grid-template-columns: 1fr 360px; gap: 40px; padding: 40px var(--gutter) 64px; }
.course-body .main { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; margin-bottom: 24px; }
.learn-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.learn-list li { display: flex; gap: 10px; }
.learn-list .ic { color: var(--leaf); margin-top: .2em; }
@media (max-width: 640px) { .learn-list { grid-template-columns: 1fr; } }
.prose { max-width: 70ch; }
.prose h1, .prose h2, .prose h3 { font-size: 1.25rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { border-left: 3px solid var(--marigold); margin: 0; padding: 4px 16px; color: var(--muted); }
.prose code { background: var(--paper); padding: 2px 5px; border-radius: 4px; }

.curriculum { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.curriculum details + details { border-top: 1px solid var(--line); }
.curriculum summary { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; cursor: pointer; background: var(--paper); font-weight: 600; list-style: none; }
.curriculum summary::-webkit-details-marker { display: none; }
.curriculum summary .count { font-weight: 400; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.curriculum ul { list-style: none; margin: 0; padding: 4px 0; }
.curriculum li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; font-size: .95rem; }
.curriculum li .t { flex: 1; min-width: 0; }
.curriculum li .d { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.curriculum li .ic { color: var(--muted); }
.curriculum li a.preview { font-size: .85rem; font-weight: 600; }
.instructor { display: flex; gap: 18px; align-items: flex-start; }
.instructor img, .instructor .ph { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; background: var(--estate); color: #fff; display: grid; place-items: center; font: 700 1.6rem var(--font-head); }
@media (max-width: 960px) {
  .course-hero .wrap, .course-body { grid-template-columns: 1fr; }
  .course-body .side { order: -1; }
}

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 69px); display: grid; place-items: center; padding: 40px var(--gutter); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 32px; }
.auth-card h1 { font-size: 1.8rem; }
.auth-card .alt { text-align: center; margin-top: 18px; font-size: .95rem; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--estate); font: 600 .85rem var(--font-body); cursor: pointer; padding: 6px; }

/* ---------- checkout ---------- */
.checkout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; padding: 40px var(--gutter) 64px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; }
.summary-line.total { border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 14px; font: 700 1.25rem var(--font-head); }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; min-width: 0; text-transform: uppercase; }
.bank-box { background: var(--marigold-soft); border: 1.5px solid #f1d98a; border-radius: var(--r-md); padding: 18px 20px; }
.bank-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.bank-box dt { color: #6b4f00; font-size: .9rem; }
.bank-box dd { margin: 0; font-weight: 600; word-break: break-word; }
.copy { background: none; border: 0; color: var(--estate); cursor: pointer; font: 600 .8rem var(--font-body); padding: 0 0 0 6px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.st-awaiting_slip { background: var(--marigold-soft); color: #6b4f00; }
.st-pending_review { background: #e6eefc; color: #1d4ea8; }
.st-approved { background: var(--ok-soft); color: #17603f; }
.st-rejected, .st-cancelled { background: var(--danger-soft); color: var(--danger); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--r-md); padding: 26px; text-align: center; background: #fff; cursor: pointer; position: relative; }
.dropzone.drag { border-color: var(--estate); background: var(--ok-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .ic { width: 34px; height: 34px; color: var(--estate); }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }

/* ---------- student dashboard ---------- */
.dash-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 30px 0 0; }
.tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--estate); border-color: var(--marigold); }
.my-course { display: grid; grid-template-columns: 200px 1fr auto; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; }
.my-course .course-thumb { border-radius: var(--r-sm); }
.my-course h3 { margin: 0 0 4px; font-size: 1.1rem; }
.progress { height: 8px; background: var(--paper); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: var(--leaf); border-radius: 999px; }
.progress-label { font-size: .85rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 720px) { .my-course { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
table.simple { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.simple th, table.simple td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.simple th { font-size: .85rem; color: var(--muted); font-weight: 600; background: var(--paper); }
table.simple tr:last-child td { border-bottom: 0; }

/* ---------- learning page ---------- */
.learn-top { background: var(--ink); color: #fff; }
.learn-top .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; max-width: none; }
.learn-top a { color: #fff; text-decoration: none; }
.learn-top .ttl { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learn-top .overall { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: #cfe0d9; }
.learn-top .overall .progress { width: 120px; background: rgba(255, 255, 255, .15); border: 0; }
.learn-layout { display: grid; grid-template-columns: 1fr 360px; min-height: calc(100vh - 58px); }
.learn-main { min-width: 0; }
.player-shell { background: #000; }
.player-box { position: relative; aspect-ratio: 16 / 9; max-height: calc(100vh - 160px); margin: 0 auto; }
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watermark {
  position: absolute; pointer-events: none; user-select: none; z-index: 3; color: rgba(255, 255, 255, .42);
  font: 600 13px/1.3 var(--font-body); text-shadow: 0 0 3px rgba(0, 0, 0, .5); white-space: nowrap;
  transition: top 1.2s ease, left 1.2s ease;
}
.player-box:fullscreen { max-height: none; width: 100%; height: 100%; aspect-ratio: auto; background: #000; }
.player-box:-webkit-full-screen { max-height: none; width: 100%; height: 100%; background: #000; }
.player-box.pseudo-full { position: fixed; inset: 0; z-index: 200; max-height: none; aspect-ratio: auto; background: #000; }
.player-tools { display: flex; justify-content: flex-end; gap: 8px; padding: 8px var(--gutter); background: #000; }
.player-tools button { background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: var(--r-sm); padding: 6px 12px; font: 600 .85rem var(--font-body); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.player-tools button:hover { background: rgba(255, 255, 255, .2); }
.player-box.pseudo-full .fs-exit { display: inline-flex; }
.fs-exit { display: none; position: absolute; right: 12px; top: 12px; z-index: 4; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: var(--r-sm); padding: 8px 12px; font: 600 .85rem var(--font-body); }
.player-missing { position: absolute; inset: 0; display: grid; place-items: center; color: #cfe0d9; text-align: center; padding: 20px; }
.lesson-content { padding: 24px var(--gutter) 60px; max-width: 900px; }
.lesson-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.lesson-bar h1 { font-size: 1.5rem; margin: 0; }
.lesson-nav { display: flex; gap: 8px; }
.done-badge { display: inline-flex; gap: 6px; align-items: center; color: var(--leaf); font-weight: 600; }
.resources { list-style: none; padding: 0; margin: 0; }
.resources li a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; text-decoration: none; background: #fff; }
.resources li a:hover { border-color: var(--estate); }
.resources .size { margin-left: auto; color: var(--muted); font-size: .85rem; }
.learn-side { background: #fff; border-left: 1px solid var(--line); max-height: calc(100vh - 58px); overflow-y: auto; position: sticky; top: 0; }
.learn-side h2 { font-size: 1rem; padding: 16px 18px; margin: 0; border-bottom: 1px solid var(--line); }
.side-section { border-bottom: 1px solid var(--line); }
.side-section > p { margin: 0; padding: 12px 18px 6px; font-weight: 700; font-size: .9rem; }
.side-lessons { list-style: none; margin: 0; padding: 0 0 8px; }
.side-lessons a { display: flex; gap: 10px; padding: 9px 18px; text-decoration: none; color: var(--ink); font-size: .92rem; align-items: flex-start; }
.side-lessons a:hover { background: var(--paper); }
.side-lessons a.current { background: var(--marigold-soft); box-shadow: inset 3px 0 0 var(--marigold); }
.side-lessons .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; margin-top: 2px; }
.side-lessons .tick.done { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.side-lessons .tick .ic { width: 12px; height: 12px; stroke-width: 3; }
.side-lessons .d { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; padding-left: 8px; }
@media (max-width: 980px) {
  .learn-layout { grid-template-columns: 1fr; }
  .learn-side { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  .learn-top .overall .progress { width: 70px; }
}

/* ---------- certificate & misc ---------- */
.cert-verify { max-width: 640px; margin: 48px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 32px; text-align: center; }
.cert-verify .seal { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--leaf); display: grid; place-items: center; margin: 0 auto 14px; }
.cert-verify .seal .ic { width: 32px; height: 32px; }
.cert-verify .seal.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #c9d8d2; margin-top: auto; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 24px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .brand { color: #fff; }
.site-footer .brand small, .admin-side .brand small { color: var(--marigold); }
.site-footer .bottom { border-top: 1px solid rgba(255, 255, 255, .12); grid-column: 1 / -1; padding-top: 18px; font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

body.layout-app { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; text-decoration: none; }
.pagination .on { background: var(--estate); color: #fff; border-color: var(--estate); }

.install-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 460px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 14px 16px; display: none; align-items: center; gap: 12px; z-index: 60; }
.install-banner.show { display: flex; }
.install-banner p { margin: 0; flex: 1; font-size: .92rem; }
.install-banner button.x { background: none; border: 0; color: #cfe0d9; cursor: pointer; padding: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
