/* =========================================================
   Automation.bh Academy
   Built on the Automation.bh agency template (red theme).
   Change the brand colour in ONE place: --red below.
   ========================================================= */
:root {
  --red: #d7262e;
  --red-rgb: 215, 38, 46;
  --red-dark: #b01d24;
  --red-tint: #fdeced;
  --red-line: #f6c9cb;
  --ink: #1a1214;
  --text: #3d3436;
  --muted: #7a6f71;
  --line: #ece5e5;
  --paper: #ffffff;
  --soft: #faf6f6;
  --on-dark: #f6efef;
  --on-dark-muted: #b9aaab;
  --gold: #c27b0a;
  --green: #1d7a46;
  --green-tint: #e7f5ec;

  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1240px;
  --shadow: 0 1px 2px rgba(26, 18, 20, .05), 0 8px 24px rgba(26, 18, 20, .06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 {
  font-family: var(--font-display); color: var(--ink); line-height: 1.15;
  letter-spacing: -0.02em; margin: 0; text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; }
.hl { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.wrap {
  max-width: var(--wrap); margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.section { padding-block: clamp(48px, 7vw, 96px); }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.section--soft { background: var(--soft); }
.section-head { display: grid; gap: 12px; max-width: 720px; margin-bottom: 32px; }
.section-head--row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.section-head p { font-size: 1.05rem; color: var(--muted); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; left: 16px; top: 16px; z-index: 100; background: var(--paper); padding: 8px 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font: 600 1rem/1 var(--font-body);
  border: 2px solid transparent; cursor: pointer; text-align: center;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); color: #fff; transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--paper); }
.btn--ghost:hover { border-color: var(--red); color: var(--red); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; color: #fff; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--red-tint); color: var(--ink); }
.btn--sm { padding: 9px 16px; font-size: .92rem; }
.btn--xs { padding: 6px 12px; font-size: .82rem; }
.btn--block { width: 100%; }
.btn--danger { background: #fff; color: var(--red-dark); border-color: var(--red-line); }
.btn--danger:hover { background: var(--red-tint); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--red); cursor: pointer; font-weight: 600; }
.linkbtn:hover { color: var(--red-dark); }
.link-arrow { font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.link-arrow::after { content: "→"; transition: transform .15s; }
.link-arrow:hover::after { transform: translateX(3px); }
.inline-form { display: inline; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .95); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__bar { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 700 1.2rem var(--font-display); color: var(--ink); white-space: nowrap; }
.logo:hover { color: var(--ink); }
.logo img { width: 52px; height: 52px; border-radius: 50%; }
.logo small { font: 600 .72rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-inline-start: 2px; }
.search { flex: 1; max-width: 520px; position: relative; }
.search svg { position: absolute; inset-inline-start: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; font: inherit; padding-block: 11px; padding-inline: 44px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--soft); color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px var(--red-tint); }
.nav { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 8px; color: var(--ink);
  font: 500 .95rem var(--font-body); background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.nav__link:hover, .nav__item.open > .nav__link { color: var(--red); background: var(--red-tint); }
.nav__link .chev { width: 10px; transition: transform .2s; }
.nav__item.open .chev { transform: rotate(180deg); }
.nav__user { padding: 6px 10px 6px 6px; }
.mega {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(26, 18, 20, .14); padding: 14px; min-width: 240px; display: none; z-index: 5;
}
.mega::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 14px; } /* invisible bridge over the gap, so the mouse can reach the menu */
.mega--wide { min-width: 520px; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.mega--right { left: auto; inset-inline-end: 0; transform: none; }
.nav__item.open > .mega { display: grid; gap: 2px; }
.nav__item.open > .mega--wide { display: grid; }
.mega a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.mega a:hover { background: var(--soft); color: var(--red); }
.mega__foot { grid-column: 1 / -1; border-top: 1px solid var(--line); margin-top: 6px; padding: 10px 12px 2px; }
.mega__foot a { color: var(--red); padding: 0; font-weight: 600; }
.header__cta { margin-inline-start: 6px; white-space: nowrap; }
.cart-link { position: relative; }
.cart-link svg { width: 22px; height: 22px; }
.cart-link__label { display: none; }
.cart-link__n {
  position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center;
}
.cart-link--mobile { display: none; color: var(--ink); padding: 8px; }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; flex: none; }
.burger span, .burger span::before, .burger span::after { display: block; width: 18px; height: 2px; background: var(--ink); margin: auto; position: relative; content: ""; }
.burger span::before { position: absolute; top: -6px; }
.burger span::after { position: absolute; top: 6px; }

@media (max-width: 1080px) {
  .burger { display: grid; place-items: center; }
  .cart-link--mobile { display: inline-flex; margin-inline-start: auto; }
  .search { order: 10; flex-basis: 100%; max-width: none; margin-bottom: 12px; }
  .header__bar { flex-wrap: wrap; row-gap: 0; min-height: 64px; gap: 10px; }
  .logo img { width: 44px; height: 44px; }
  .logo small { display: none; }

  /* Phone / tablet menu: a full-height panel that drops down under the header.
     Positioned against the header itself, so it always starts right below it. */
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - var(--hdr-h, 120px)); height: calc(100dvh - var(--hdr-h, 120px));
    background: var(--paper); border-top: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 8px max(20px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    display: flex; visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; z-index: 60;
  }
  .nav.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity .2s ease, transform .2s ease; box-shadow: 0 24px 0 0 var(--paper); }
  .nav > .cart-link { display: none; }
  .nav__item { width: 100%; }
  .nav__link { width: 100%; justify-content: space-between; padding: 15px 4px; font-size: 1.05rem; font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 52px; }
  .nav__link:hover, .nav__item.open > .nav__link { background: none; }
  .nav__user { justify-content: flex-start; gap: 10px; }
  .nav__user .chev { margin-inline-start: auto; }
  .mega::before { display: none; }
  .mega, .mega--wide, .mega--right { position: static; transform: none; box-shadow: none; border: 0; border-radius: 0; min-width: 0; padding: 6px 0 10px; grid-template-columns: 1fr; background: none; }
  .mega a { padding: 12px 12px; font-size: 1rem; }
  .mega__foot { padding: 10px 12px 4px; }
  .nav .header__cta { margin: 14px 0 0; width: 100%; justify-content: center; text-align: center; padding-block: 13px; font-size: 1rem; }
  .nav .lang { align-self: center; width: auto; margin-top: 18px; }
  body.menu-open { overflow: hidden; }

  /* Burger turns into an X while the menu is open */
  .burger span, .burger span::before, .burger span::after { transition: transform .2s ease, background .2s ease, top .2s ease; }
  .burger[aria-expanded="true"] span { background: transparent; }
  .burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
  .burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }
}
@media (max-width: 1080px) and (prefers-reduced-motion: reduce) { .nav, .nav.open { transition: none; } }

/* ---------- Alerts ---------- */
.flashes { display: grid; gap: 10px; padding-top: 20px; }
.alert { padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--soft); color: var(--ink); font-weight: 500; }
.alert--success { background: var(--green-tint); border-color: #bfe3cc; color: var(--green); }
.alert--error { background: var(--red-tint); border-color: var(--red-line); color: var(--red-dark); }
.alert--info { background: #f3f1f1; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 96px) clamp(40px, 5vw, 72px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(var(--red-rgb), .12), transparent 65%); pointer-events: none;
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero__grid > * { min-width: 0; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; justify-items: start; }
.hero__lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 580px; }
.hero__search { display: flex; width: 100%; max-width: 560px; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow); }
.hero__search input { flex: 1; min-width: 0; border: 0; font: inherit; padding: 10px 16px; background: none; color: var(--ink); }
.hero__search input:focus { outline: none; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .9rem; font-weight: 500; background: #fff; }
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.hero__art { position: relative; display: grid; gap: 14px; }
.hero__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; }
.hero__card:nth-child(2) { margin-inline-start: 40px; }
.hero__card:nth-child(3) { margin-inline-start: 12px; }
.hero__card .icon { width: 56px; height: 56px; border-radius: 14px; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 1.4rem; }
.hero__card strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
.hero__card span { color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } .hero__art { display: none; } }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.stat { padding: 26px 20px; display: grid; gap: 4px; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat__num { font: 700 clamp(1.8rem, 3vw, 2.6rem)/1 var(--font-display); color: var(--red); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: .92rem; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 600; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat:hover { color: var(--ink); border-color: var(--red-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--red-tint); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.cat small { display: block; color: var(--muted); font-weight: 500; }
@media (max-width: 960px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cat-grid { grid-template-columns: 1fr; } }

/* ---------- Course card ---------- */
.course-card {
  display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff; color: inherit; transition: box-shadow .2s, transform .2s;
}
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); color: inherit; }
.course-card__body { padding: 16px 16px 18px; display: grid; gap: 6px; align-content: start; }
.course-card h3 { font-size: 1.05rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card__by { color: var(--muted); font-size: .86rem; }
.course-card__meta { color: var(--muted); font-size: .8rem; }
.course-card .tag { justify-self: start; }
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }
.thumb--gen {
  position: relative; display: grid; align-content: space-between; padding: 16px; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 72% 48%), hsl(calc(var(--h) - 10) 75% 26%));
}
.thumb--gen::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px); background-size: 16px 16px;
}
.thumb--gen::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
  border: 26px solid rgba(255, 255, 255, .12);
}
.thumb--gen span { position: relative; justify-self: start; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; }
.thumb--gen strong { position: relative; font: 700 1.15rem/1.2 var(--font-display); max-width: 85%; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumb--lg strong { font-size: 1.6rem; }

.rating { display: inline-flex; align-items: center; gap: 6px; }
.rating b { color: var(--gold); font-weight: 700; font-size: .92rem; }
.stars-bar {
  --r: 100%; display: inline-block; width: 78px; height: 14px;
  background: linear-gradient(90deg, #e59819 var(--r), #e6dcdc var(--r));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 14'%3E%3Cg%3E%3Cpath id='s' d='M7 0l2.1 4.5 4.9.5-3.7 3.3 1.1 4.8L7 10.6 2.6 13.1l1.1-4.8L0 5l4.9-.5z'/%3E%3Cuse href='%23s' x='16'/%3E%3Cuse href='%23s' x='32'/%3E%3Cuse href='%23s' x='48'/%3E%3Cuse href='%23s' x='64'/%3E%3C/g%3E%3C/svg%3E") no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 14'%3E%3Cg%3E%3Cpath id='s' d='M7 0l2.1 4.5 4.9.5-3.7 3.3 1.1 4.8L7 10.6 2.6 13.1l1.1-4.8L0 5l4.9-.5z'/%3E%3Cuse href='%23s' x='16'/%3E%3Cuse href='%23s' x='32'/%3E%3Cuse href='%23s' x='48'/%3E%3Cuse href='%23s' x='64'/%3E%3C/g%3E%3C/svg%3E") no-repeat;
}
.price { display: flex; align-items: baseline; gap: 8px; }
.price b { color: var(--ink); font: 700 1.05rem var(--font-display); }
.price s { color: var(--muted); font-size: .88rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--red-dark); background: var(--red-tint); padding: 3px 9px; border-radius: 999px; }
.tag--best { background: #fdf0d5; color: #8a5300; }
.tag--new { background: var(--green-tint); color: var(--green); }
.tag--draft { background: #efecec; color: var(--muted); }
.tag--pending { background: #fdf0d5; color: #8a5300; }
.tag--published { background: var(--green-tint); color: var(--green); }
.tag--rejected { background: var(--red-tint); color: var(--red-dark); }

/* ---------- Catalog ---------- */
.page-hero { padding-block: clamp(40px, 5vw, 64px) clamp(28px, 4vw, 44px); background: var(--soft); border-bottom: 1px solid var(--line); }
.page-hero .wrap { display: grid; gap: 12px; }
.page-hero p { color: var(--muted); font-size: 1.05rem; max-width: 680px; }
.crumbs { font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--red); }
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: start; }
.catalog > * { min-width: 0; }
.filters { display: grid; gap: 24px; position: sticky; top: 96px; }
.filters fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.filters legend { font: 600 1rem var(--font-display); color: var(--ink); margin-bottom: 8px; }
.filters label { display: flex; gap: 10px; align-items: center; font-size: .95rem; cursor: pointer; }
.filters input[type=radio] { accent-color: var(--red); width: 16px; height: 16px; }
.catalog__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.catalog__bar select { font: inherit; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.filters-toggle { display: none; }
@media (max-width: 860px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; display: none; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
  .filters.open { display: grid; }
  .filters-toggle { display: inline-flex; }
}
.list-course { display: grid; grid-template-columns: 260px 1fr auto; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); color: inherit; }
.list-course:first-child { padding-top: 0; }
.list-course:hover { color: inherit; }
.list-course:hover h3 { color: var(--red); }
.list-course > * { min-width: 0; }
.list-course .thumb { border-radius: var(--radius-sm); }
.list-course__body { display: grid; gap: 6px; align-content: start; }
.list-course__body p.sub { color: var(--text); font-size: .95rem; }
.list-course .price { flex-direction: column; align-items: end; gap: 2px; }
@media (max-width: 760px) {
  .list-course { grid-template-columns: 1fr; gap: 12px; }
  .list-course .price { flex-direction: row; align-items: baseline; }
}
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pager__item { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.pager__item.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; padding: 56px 20px; display: grid; gap: 14px; justify-items: center; }
.empty p { color: var(--muted); max-width: 460px; }

/* ---------- Course page ---------- */
.course-hero { background: var(--ink); color: var(--on-dark); position: relative; overflow: hidden; }
.course-hero::after {
  content: ""; position: absolute; right: -200px; top: -260px; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--red-rgb), .4), transparent 65%); pointer-events: none;
}
.course-hero .wrap { position: relative; z-index: 1; padding-block: 44px 48px; }
.course-hero__text { max-width: 760px; display: grid; gap: 14px; }
.course-hero h1 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.course-hero .crumbs, .course-hero .crumbs a { color: var(--on-dark-muted); }
.course-hero .lead { font-size: 1.15rem; color: var(--on-dark); }
.course-hero .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .92rem; color: var(--on-dark-muted); align-items: center; }
.course-hero .meta a { color: #ffb3b6; text-decoration: underline; }
.course-hero .rating b { color: #f5b844; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.course-main { display: grid; gap: 40px; padding-block: 40px 72px; }
.course-main h2 { font-size: 1.5rem; margin-bottom: 14px; }
.buy-card {
  margin-top: -260px; position: sticky; top: 96px; z-index: 2; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 20px 50px rgba(26, 18, 20, .16); overflow: hidden;
}
.buy-card__media { position: relative; display: block; }
.buy-card__media .play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--red);
  display: grid; place-items: center; font-size: 1.3rem; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.buy-card__media .thumb--gen strong { visibility: hidden; }
.buy-card__media small { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-weight: 600; font-size: .85rem; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.buy-card__body { padding: 22px; display: grid; gap: 12px; }
.buy-card .price b { font-size: 1.9rem; }
.buy-card .price s { font-size: 1rem; }
.buy-card .discount { color: var(--red-dark); font-weight: 600; font-size: .92rem; }
.buy-card ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; font-size: .92rem; }
.buy-card li::before { content: "✓"; color: var(--red); font-weight: 700; margin-inline-end: 8px; }
.buy-card .row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.wish-btn { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.wish-btn.is-on { color: var(--red); border-color: var(--red-line); background: var(--red-tint); }
@media (max-width: 1000px) {
  .course-layout { grid-template-columns: 1fr; }
  .buy-card { margin-top: 24px; position: static; order: -1; }
  .course-main { padding-top: 0; }
}
.learn-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.learn-box ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.learn-box li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: .95rem; }
.learn-box li::before { content: "✓"; color: var(--red); font-weight: 700; }
@media (max-width: 620px) { .learn-box ul { grid-template-columns: 1fr; } }
.prose { display: grid; gap: 14px; }
.prose ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.curriculum__meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .92rem; color: var(--muted); margin-bottom: 12px; }
.curriculum { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.curriculum details + details { border-top: 1px solid var(--line); }
.curriculum summary {
  list-style: none; cursor: pointer; padding: 16px 20px; background: var(--soft); display: flex; justify-content: space-between; gap: 12px;
  font: 600 1rem var(--font-display); color: var(--ink);
}
.curriculum summary::-webkit-details-marker { display: none; }
.curriculum summary::before { content: "▸"; color: var(--red); margin-inline-end: 4px; transition: transform .2s; display: inline-block; }
.curriculum details[open] summary::before { transform: rotate(90deg); }
.curriculum summary span:first-child { flex: 1; }
.curriculum summary small { font: 500 .85rem var(--font-body); color: var(--muted); white-space: nowrap; }
.lesson-row { display: flex; gap: 12px; align-items: center; padding: 12px 20px; font-size: .95rem; }
.lesson-row__icon { color: var(--muted); width: 18px; flex: none; }
.lesson-row__title { flex: 1; min-width: 0; }
.lesson-row a { text-decoration: underline; }
.lesson-row time { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.instructor { display: grid; gap: 14px; }
.instructor__top { display: flex; gap: 16px; align-items: center; }
.instructor__top h3 a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red-line); }
.instructor__top p { color: var(--muted); }
.instructor__stats { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .9rem; color: var(--muted); }

/* Avatars */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--red-tint); color: var(--red); display: inline-grid; place-items: center; font-weight: 700; flex: none; object-fit: cover; font-size: .95rem; }
.avatar--sm { width: 32px; height: 32px; font-size: .78rem; }
.avatar--lg { width: 96px; height: 96px; font-size: 1.8rem; }

/* ---------- Reviews ---------- */
.review-summary { display: grid; grid-template-columns: 160px 1fr; gap: 28px; align-items: center; margin-bottom: 24px; }
.review-summary__big { text-align: center; display: grid; gap: 6px; justify-items: center; }
.review-summary__big b { font: 700 3.6rem/1 var(--font-display); color: var(--gold); }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 1fr 90px 44px; gap: 12px; align-items: center; font-size: .88rem; color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--muted); border-radius: inherit; }
@media (max-width: 560px) { .review-summary { grid-template-columns: 1fr; } }
.reviews { display: grid; gap: 0; }
.review { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 20px 0; border-top: 1px solid var(--line); }
.review strong { color: var(--ink); }
.review__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.review p { margin-top: 6px; }
.review-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; background: var(--soft); }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.8rem; color: #d9cfcf; cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #e59819; }
.star-input input:focus-visible + label { outline: 2px solid var(--red); border-radius: 4px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__row > * { min-width: 0; }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field small { color: var(--muted); font-size: .82rem; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  font: inherit; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { accent-color: var(--red); width: 18px; height: 18px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card { position: relative; border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: grid; gap: 2px; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card strong { color: var(--ink); }
.radio-card span { font-size: .85rem; color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--red); background: var(--red-tint); }
.radio-card:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 28px; }
.card--soft { background: var(--soft); }
.auth { max-width: 460px; margin-inline: auto; }
.auth h1 { font-size: 2rem; margin-bottom: 6px; }
.auth .card { display: grid; gap: 18px; }
.demo-logins { font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 4px; }
.demo-logins code { background: var(--soft); padding: 1px 6px; border-radius: 4px; color: var(--ink); }

/* ---------- Cart ---------- */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 160px 1fr auto; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-item > * { min-width: 0; }
.cart-item .thumb { border-radius: var(--radius-sm); }
.cart-item h3 { font-size: 1.05rem; }
.cart-item h3 a { color: var(--ink); }
.cart-item .price { flex-direction: column; align-items: end; gap: 2px; }
.summary { position: sticky; top: 96px; display: grid; gap: 14px; }
.summary__total { font: 700 2rem var(--font-display); color: var(--ink); }
.summary__line { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.coupon { display: flex; gap: 8px; }
.coupon input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; }
@media (max-width: 860px) {
  .cart { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 100px 1fr; }
  .cart-item .price { grid-column: 2; flex-direction: row; align-items: baseline; }
  .summary { position: static; }
}
.pay-methods { display: grid; gap: 10px; }
.secure-note { font-size: .82rem; color: var(--muted); text-align: center; }

/* ---------- My learning ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; }
.tabs a { padding: 12px 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.is-active, .tabs a:hover { color: var(--ink); border-bottom-color: var(--red); }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.progress-label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }

/* ---------- Player ---------- */
.player-page { background: #fff; }
.player-top { background: var(--ink); color: #fff; }
.player-top .wrap { max-width: none; display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.player-top a { color: #fff; }
.player-top h1 { color: #fff; font-size: 1.05rem; font-weight: 600; flex: 1; min-width: 200px; }
.player-top .progress { width: 160px; background: rgba(255,255,255,.2); }
.player-top small { color: var(--on-dark-muted); }
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 60px); }
.player { background: #000; aspect-ratio: 16 / 9; width: 100%; max-height: 72vh; display: grid; }
.player iframe, .player video { width: 100%; height: 100%; border: 0; background: #000; }
.player__empty { color: #fff; display: grid; place-items: center; padding: 40px; text-align: center; background: linear-gradient(135deg, #2b1c1e, #1a1214); }
.lesson-body { padding: 28px clamp(20px, 3vw, 40px) 64px; display: grid; gap: 18px; max-width: 920px; }
.lesson-body__bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.lesson-body h2 { font-size: 1.5rem; }
.lesson-body .notes { white-space: pre-line; }
.sidebar { border-inline-start: 1px solid var(--line); background: #fff; max-height: calc(100vh - 60px); overflow-y: auto; position: sticky; top: 0; }
.sidebar h2 { font-size: 1.05rem; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sidebar .curriculum { border: 0; border-radius: 0; }
.sidebar .lesson-row { padding: 10px 20px; color: var(--text); text-decoration: none; }
.sidebar a.lesson-row:hover { background: var(--soft); }
.sidebar .lesson-row.is-current { background: var(--red-tint); }
.sidebar .lesson-row.is-current .lesson-row__title { color: var(--red-dark); font-weight: 600; }
.tick { width: 18px; height: 18px; border-radius: 4px; border: 2px solid #cfc5c5; flex: none; display: grid; place-items: center; font-size: .7rem; color: #fff; }
.tick.is-done { background: var(--red); border-color: var(--red); }
.tick.is-done::after { content: "✓"; font-weight: 700; }
@media (max-width: 1000px) {
  .player-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; border-inline-start: 0; border-top: 1px solid var(--line); }
}

/* ---------- Certificate ---------- */
.certificate {
  max-width: 1000px; margin: 40px auto; aspect-ratio: 1.414; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 64px); display: grid; align-content: space-between; position: relative; overflow: hidden;
}
.certificate::before { content: ""; position: absolute; inset: 14px; border: 2px solid var(--red-line); pointer-events: none; }
.certificate::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--red-rgb), .18), transparent 65%); }
.certificate__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: relative; }
.certificate__body { display: grid; gap: 14px; position: relative; }
.certificate__body h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.certificate__name { font: 700 clamp(1.6rem, 3.5vw, 2.6rem) var(--font-display); color: var(--red); }
.certificate__foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); position: relative; }
.certificate__foot strong { display: block; color: var(--ink); }
@media print {
  .header, .footer, .no-print, .flashes { display: none !important; }
  .certificate { margin: 0; box-shadow: none; border: 0; max-width: none; }
  @page { size: A4 landscape; margin: 0; }
}

/* ---------- Dashboards ---------- */
.dash { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; padding-block: 32px 72px; }
.dash__nav { display: grid; gap: 2px; position: sticky; top: 96px; }
.dash__nav a { padding: 10px 14px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.dash__nav a:hover { background: var(--soft); color: var(--red); }
.dash__nav a.is-active { background: var(--red-tint); color: var(--red-dark); font-weight: 600; }
.dash__nav .eyebrow { padding: 8px 14px 4px; }
.dash__main { display: grid; gap: 24px; }
.dash__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.dash__head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .dash__nav { position: static; display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .dash__nav .eyebrow { display: none; }
  .dash__nav a { white-space: nowrap; }
}
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 4px; background: #fff; }
.kpi span { color: var(--muted); font-size: .88rem; }
.kpi b { font: 700 1.8rem/1.1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--soft); font-weight: 600; color: var(--ink); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.mini-course { display: flex; gap: 12px; align-items: center; min-width: 240px; }
.mini-course .thumb { width: 96px; border-radius: 6px; flex: none; }
.mini-course .thumb--gen { padding: 6px; }
.mini-course .thumb--gen span, .mini-course .thumb--gen::after { display: none; }
.mini-course .thumb--gen strong { font-size: .6rem; }
.mini-course a { color: var(--ink); font-weight: 600; }
.builder-section { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.builder-section__head { background: var(--soft); padding: 14px 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.builder-section__head form { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.builder-section__head input { flex: 1; min-width: 0; font: 600 1rem var(--font-display); padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); }
.builder-section__head input:hover, .builder-section__head input:focus { border-color: var(--line); background: #fff; outline: none; }
.builder-lesson { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.builder-lesson:last-child { border-bottom: 0; }
.builder-lesson__title { flex: 1; min-width: 200px; font-weight: 500; color: var(--ink); }
.builder-add { padding: 14px 18px; background: #fff; }
.builder-add summary { cursor: pointer; color: var(--red); font-weight: 600; }
.builder-add form { margin-top: 14px; }

/* ---------- Closing CTA band & footer ---------- */
.cta-band { background: var(--ink); color: var(--on-dark); position: relative; overflow: hidden; }
.cta-band::after {
  content: ""; position: absolute; right: -200px; bottom: -300px; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--red-rgb), .45), transparent 65%); pointer-events: none;
}
.cta-band .wrap { position: relative; z-index: 1; display: grid; gap: 20px; justify-items: start; padding-block: clamp(56px, 8vw, 96px); }
.cta-band h2 { color: #fff; max-width: 760px; }
.cta-band p { color: var(--on-dark-muted); max-width: 620px; font-size: 1.1rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split > * { min-width: 0; }
.split__text { display: grid; gap: 18px; }
.split__text p { color: var(--muted); font-size: 1.05rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.checklist li::before { content: "✓"; width: 24px; height: 24px; border-radius: 50%; background: var(--red-tint); color: var(--red); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.why { display: grid; gap: 12px; padding: 26px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); align-content: start; }
.why__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.why p { color: var(--muted); font-size: .95rem; }
.quote-card { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; display: grid; gap: 14px; align-content: start; margin: 0; }
.quote-card blockquote { margin: 0; }
.who { display: flex; gap: 12px; align-items: center; margin-top: auto; }
.who strong { display: block; color: var(--ink); font-size: .95rem; }
.who span { color: var(--muted); font-size: .85rem; }
.faq { max-width: 860px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.faq summary { list-style: none; cursor: pointer; padding: 20px 24px; display: flex; justify-content: space-between; gap: 16px; font: 600 1.05rem var(--font-display); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-size: 1.5rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 24px 20px; color: var(--muted); }

.footer { background: #120c0d; color: var(--on-dark-muted); font-size: .93rem; }
.footer .wrap { padding-block: 64px 32px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer__grid > * { min-width: 0; }
.footer .logo { color: #fff; }
.footer .logo small { color: var(--on-dark-muted); }
.footer__about { display: grid; gap: 16px; align-content: start; }
.footer h4 { color: #fff; font: 600 .82rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { color: var(--on-dark-muted); }
.footer a:hover { color: #fff; }
.footer__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.footer__badges span { font-size: .75rem; border: 1px solid rgba(255, 255, 255, .15); border-radius: 999px; padding: 4px 10px; }
.footer__bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
@media (max-width: 960px) { .footer__grid { grid-template-columns: repeat(2, 1fr); } .footer__about { grid-column: 1 / -1; } }

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

/* ---------- Language switch ---------- */
.lang { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.lang:hover { border-color: var(--red); color: var(--red); }
.lang[lang="ar"] { font-family: var(--font-ar-body); }
.lang[lang="en"] { font-family: var(--font-body); }

/* ---------- Arabic / right-to-left ---------- */
:root { --font-ar-display: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; --font-ar-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
[dir="rtl"] body { font-family: var(--font-ar-body); line-height: 1.8; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] .logo, [dir="rtl"] .faq summary,
[dir="rtl"] .stat__num, [dir="rtl"] .curriculum summary, [dir="rtl"] .filters legend, [dir="rtl"] .summary__total,
[dir="rtl"] .price b, [dir="rtl"] .kpi b, [dir="rtl"] .certificate__name, [dir="rtl"] .thumb--gen strong { font-family: var(--font-ar-display); letter-spacing: 0; }
[dir="rtl"] h1, [dir="rtl"] h2 { line-height: 1.45; }
[dir="rtl"] .eyebrow, [dir="rtl"] .tag, [dir="rtl"] .footer h4, [dir="rtl"] .table th, [dir="rtl"] .thumb--gen span { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .btn, [dir="rtl"] .nav__link, [dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea, [dir="rtl"] button { font-family: var(--font-ar-body); }
[dir="rtl"] .logo, [dir="rtl"] .logo small { font-family: var(--font-display); }
[dir="rtl"] .link-arrow::after { content: "←"; }
[dir="rtl"] .link-arrow:hover::after { transform: translateX(-3px); }
[dir="rtl"] .hero::before { inset: -40% auto auto -10%; }
[dir="rtl"] .cta-band::after { right: auto; left: -200px; }
[dir="rtl"] .course-hero::after { right: auto; left: -200px; }
[dir="rtl"] .thumb--gen::after { right: auto; left: -40px; }
[dir="rtl"] .certificate::after { right: auto; left: -120px; }
[dir="rtl"] .curriculum summary::before { content: "◂"; }
[dir="rtl"] .curriculum details[open] summary::before { transform: rotate(-90deg); }
[dir="rtl"] .skip:focus { left: auto; right: 16px; }
[dir="rtl"] .chat-btn, [dir="rtl"] .chat { right: auto; left: 20px; }
[dir="rtl"] .stars-bar { transform: scaleX(-1); }
[dir="rtl"] .num, [dir="rtl"] code, [dir="rtl"] time { unicode-bidi: plaintext; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* Course content written in English inside the Arabic layout: keep its punctuation in the right place. */
[dir="rtl"] .course-hero h1,
[dir="rtl"] .course-hero .lead,
[dir="rtl"] .learn-box li,
[dir="rtl"] .course-card h3,
[dir="rtl"] .cart-item h3,
[dir="rtl"] .lesson-row__title,
[dir="rtl"] .reviews p,
[dir="rtl"] .prose p {
  unicode-bidi: plaintext;
  text-align: right;
}

/* Admin → Site content */
.content-form { gap: 22px; }
.content-pair { border: 0; padding: 0 0 18px; margin: 0; border-bottom: 1px solid var(--line); }
.content-pair legend { padding: 0; margin-bottom: 8px; }
.content-image { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.content-image img { width: 120px; height: 80px; object-fit: contain; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }

/* Front page image and social links */
.hero__photo { width: 100%; max-height: 460px; object-fit: cover; border-radius: 24px; box-shadow: 0 30px 60px -30px rgba(26, 18, 20, .45); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .15); border-radius: 50%; color: var(--on-dark-muted); }
.socials a:hover { color: #fff; border-color: #fff; }

/* Info pages */
.page-body { max-width: 760px; }
.page-body h2 { font-size: 1.35rem; margin: 28px 0 10px; }
.page-body p, .page-body ul { margin: 0 0 14px; line-height: 1.75; }
@media (max-width: 900px) { .hero__art--photo { display: block; } }

/* Admin: picture picker */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pick { display: grid; gap: 6px; cursor: pointer; font-size: .85rem; font-weight: 500; position: relative; }
.pick input { position: absolute; opacity: 0; }
.pick img, .pick__blank { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 12px; border: 3px solid transparent; outline: 1px solid var(--line); }
.pick__blank { display: block; background: repeating-linear-gradient(45deg, var(--soft), var(--soft) 10px, #fff 10px, #fff 20px); }
.pick input:checked + img, .pick input:checked + .pick__blank { border-color: var(--red); }
.pick input:focus-visible + img, .pick input:focus-visible + .pick__blank { outline: 3px solid var(--red-line); }

/* Front page with a background picture: text sits on top of the picture */
.hero--photo { background: #140b0e; color: #fff; isolation: isolate; }
.hero--photo::before { display: none; }
.hero__bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.hero__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(20, 11, 14, var(--shade-a)) 0%, rgba(20, 11, 14, var(--shade-b)) 55%, rgba(20, 11, 14, var(--shade-c)) 100%); }
[dir="rtl"] .hero__shade { background: linear-gradient(270deg, rgba(20, 11, 14, var(--shade-a)) 0%, rgba(20, 11, 14, var(--shade-b)) 55%, rgba(20, 11, 14, var(--shade-c)) 100%); }
.hero--light  { --shade-a: .78; --shade-b: .35; --shade-c: .05; }
.hero--medium { --shade-a: .93; --shade-b: .66; --shade-c: .22; }
.hero--strong { --shade-a: .95; --shade-b: .78; --shade-c: .55; }
.hero--photo h1, .hero--photo .hero__lead { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero--photo .hero__lead { color: rgba(255, 255, 255, .86); }
.hero--photo .eyebrow { color: #ffb4a8; }
.hero--photo .hl { color: #ff6b6f; }
.hero--photo .chip { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(6px); }
.hero--photo .chip:hover { background: rgba(255, 255, 255, .2); }
.hero--photo .hero__search { box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); }
.hero--photo .hero__card { background: rgba(26, 18, 20, .55); border-color: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(10px); }
.hero--photo .hero__card span { color: rgba(255, 255, 255, .72); }
.hero--photo .hero__card .icon { color: #fff; }
.hero--photo .hero__grid { min-height: clamp(420px, 46vw, 600px); }
@media (max-width: 900px) {
  .hero--light, .hero--medium, .hero--strong { --shade-a: .88; --shade-b: .8; --shade-c: .72; }
  [dir="rtl"] .hero__shade, .hero__shade { background: rgba(20, 11, 14, var(--shade-b)); }
  .hero--photo .hero__grid { min-height: 0; }
}

/* Big-file uploader */
.uploader { display: grid; gap: 8px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--soft); }
.uploader__bar { height: 8px; background: #fff; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.uploader__bar span { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.uploader__status { font-size: .88rem; color: var(--muted); }
.uploader__status.is-ok { color: var(--green); font-weight: 600; }
.uploader__status.is-error { color: var(--red); font-weight: 600; }
.file-card { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.file-card__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--red-tint); color: var(--red); display: grid; place-items: center; font-weight: 700; font-size: .8rem; text-transform: uppercase; flex: none; }
.file-card__name { font-weight: 600; color: var(--ink); word-break: break-all; }
.lesson-part[hidden], small.lesson-part[hidden] { display: none !important; }

/* Quiz builder */
.quiz-admin-q { display: grid; gap: 10px; }
.quiz-admin-q__head { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.quiz-admin-q__opts { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; color: var(--muted); }
.quiz-admin-q__opts .is-right { color: var(--green); font-weight: 600; }
.q-option { display: flex; gap: 10px; align-items: center; }
.q-option input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--green); }
.q-part[hidden] { display: none !important; }

/* Quiz for students */
.quiz { display: grid; gap: 18px; }
.quiz__q { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: #fff; display: grid; gap: 12px; }
.quiz__q legend { font-weight: 600; color: var(--ink); padding: 0; margin-bottom: 4px; font-size: 1.02rem; }
.quiz__q .hint { font-size: .82rem; color: var(--muted); }
.quiz__opt { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.quiz__opt:hover { border-color: var(--red-line); }
.quiz__opt input { width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.quiz__opt.is-right { border-color: var(--green); background: #eaf7ef; }
.quiz__opt.is-wrong { border-color: var(--red); background: var(--red-tint); }
.quiz__q.is-ok { border-color: #bfe5cd; }
.quiz__q.is-bad { border-color: var(--red-line); }
.quiz__explain { font-size: .9rem; background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.quiz-result { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 20px; border-radius: 16px; }
.quiz-result--pass { background: #eaf7ef; border: 1px solid #bfe5cd; }
.quiz-result--fail { background: var(--red-tint); border: 1px solid var(--red-line); }
.quiz-result__score { font: 700 2.4rem/1 var(--font-head, inherit); color: var(--ink); }
.player--panel { background: var(--soft); display: grid; place-items: center; padding: 40px 20px; aspect-ratio: auto; min-height: 220px; }
.doc-viewer { width: 100%; height: min(78vh, 760px); border: 0; background: #fff; display: block; }
.doc-viewer { background: #525659; }
[dir="rtl"] .quiz__q > strong, [dir="rtl"] .quiz__q legend, [dir="rtl"] .quiz__opt > span:not([aria-hidden]), [dir="rtl"] .quiz__explain, [dir="rtl"] .file-card__name { unicode-bidi: plaintext; text-align: right; }
