/* ============================================================
   YouTube Career Mastery — premium SaaS stylesheet
   YouTube-inspired: red / white / near-black / light gray
   ============================================================ */

:root {
  --red: #f21b1b;
  --red-dark: #c40d0d;
  --red-soft: #fef2f2;
  --ink: #18181b;
  --ink-soft: #3f3f46;
  --gray: #71717a;
  --gray-light: #a1a1aa;
  --line: #e4e4e7;
  --bg: #f6f6f7;
  --card: #ffffff;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24,24,27,.05), 0 8px 24px -12px rgba(24,24,27,.12);
  --shadow-lg: 0 4px 12px rgba(24,24,27,.08), 0 24px 48px -24px rgba(24,24,27,.25);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --sidebar-w: 250px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; vertical-align: middle; }
svg { width: 20px; height: 20px; flex: none; }
a { color: var(--red-dark); text-decoration: none; }
a:hover { text-decoration: none; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .93em; }
.muted { color: var(--gray); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.mt { margin-top: 20px; }
.mt-s { margin-top: 12px; }
.mb { margin-bottom: 22px; }
hr.form__sep { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
  text-decoration: none; line-height: 1.3; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; box-shadow: 0 8px 20px -8px rgba(220, 20, 20, .55);
}
.btn--primary:hover { box-shadow: 0 12px 26px -8px rgba(220, 20, 20, .65); transform: translateY(-1px); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--gray-light); background: #fafafa; }
.btn--ghost.is-active { border-color: var(--red); color: var(--red-dark); background: var(--red-soft); }
.btn--danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn--danger:hover { background: #fef2f2; border-color: #fca5a5; }
.btn--lg { padding: 14px 28px; font-size: 16.5px; border-radius: 12px; }
.btn--sm { padding: 8px 15px; font-size: 13.5px; }
.btn--xs { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--send { padding: 11px 16px; }
.btn--telegram { background: #229ED9; color: #fff; }
.btn--telegram:hover { background: #1b8ec4; }
.btn--youtube { background: #282828; color: #fff; }
.btn--youtube:hover { background: #111; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: none;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background .15s ease; position: relative;
}
.icon-btn:hover { background: rgba(24,24,27,.06); }
.icon-btn .dot {
  position: absolute; top: 4px; right: 4px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; align-items: flex-start; }

/* ---------------- pills / badges ---------------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 99px;
  background: #f4f4f5; color: var(--ink-soft); line-height: 1.5;
}
.pill svg { width: 14px; height: 14px; }
.pill--sm { font-size: 11px; padding: 2px 9px; }
.pill--red { background: var(--red-soft); color: var(--red-dark); }
.pill--green { background: var(--green-soft); color: var(--green); }
.pill--amber { background: var(--amber-soft); color: var(--amber); }
.pill--gray { background: #f4f4f5; color: var(--gray); }
.pill--dark { background: var(--ink); color: #fff; }

.badge {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------------- brand / topbar ---------------- */

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 17px; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px -6px rgba(220,20,20,.6);
}
.brand__mark svg { width: 18px; height: 18px; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.topbar__inner { display: flex; align-items: center; gap: 14px; height: 64px; }
.topbar__title { font-weight: 800; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar--clean .topbar__inner { height: 72px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #e4e4e7, #d4d4d8);
  color: var(--ink-soft); font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--red { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; }

/* ---------------- app shell / sidebar ---------------- */

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  transition: transform .25s ease; z-index: 60;
}
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 18px; }
.sidebar__nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.sidebar__link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0;
  color: var(--ink-soft); font-weight: 600; font-size: 14.5px; border-radius: 10px;
  transition: background .15s ease, color .15s ease;
}
.sidebar__link svg { width: 19px; height: 19px; }
.sidebar__link:hover { background: #f4f4f5; color: var(--ink); }
.sidebar__link.is-active { background: var(--red-soft); color: var(--red-dark); }
.sidebar__link .badge { margin-left: auto; }
.sidebar__foot { padding: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sidebar__logout {
  display: flex; align-items: center; gap: 9px; background: none; border: none;
  color: var(--gray); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; padding: 8px 10px; border-radius: 8px;
}
.sidebar__logout:hover { background: #fef2f2; color: var(--red-dark); }
.sidebar__admin-name { font-size: 12.5px; color: var(--gray-light); font-weight: 700; padding: 0 10px; }
.sidebar__close { display: none; }
.drawer-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 26px 20px 40px; width: 100%; }

/* ---------------- hero / landing ---------------- */

.auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.auth-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 44px 20px; }

.hero { background:
  radial-gradient(1000px 420px at 85% -10%, rgba(242,27,27,.09), transparent 60%),
  linear-gradient(180deg, #fff, var(--bg)); }
.hero__inner {
  max-width: 1120px; margin: 0 auto; padding: 56px 20px 40px;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 44px; align-items: center;
}
.hero__title { font-size: clamp(30px, 4.5vw, 46px); line-height: 1.15; font-weight: 800; letter-spacing: -.5px; margin: 16px 0; }
.hero__sub { color: var(--gray); font-size: 17px; max-width: 540px; }
.hero__stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 26px; }
.stat-chip {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 16px; display: flex; flex-direction: column; align-items: center; min-width: 86px;
  box-shadow: var(--shadow);
}
.stat-chip__num { font-weight: 800; font-size: 19px; color: var(--red-dark); }
.stat-chip span:last-child { font-size: 12px; color: var(--gray); }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.stock-live {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700;
  color: var(--green); background: var(--green-soft); padding: 7px 15px; border-radius: 99px;
}
.stock-live__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
.stock-live--out { color: var(--red-dark); background: var(--red-soft); }
.stock-live--out .stock-live__dot { background: var(--red); animation: none; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,.35); } 50% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } }

.price-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 28px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
  animation: rise .5s ease both;
}
.price-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--red), var(--red-dark));
}
.price-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.price-card__name { font-weight: 800; font-size: 19px; display: block; }
.price-card__tag { font-size: 11.5px; font-weight: 800; color: var(--red-dark); background: var(--red-soft); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.price-card__price { font-size: 52px; font-weight: 800; letter-spacing: -2px; margin: 12px 0 6px; color: var(--ink); }
.price-card__list { list-style: none; margin: 16px 0 22px; display: grid; gap: 10px; }
.price-card__list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-soft); font-weight: 600; }
.price-card__list svg { color: var(--green); width: 18px; height: 18px; }

.section { padding: 34px 20px 56px; }
.section--alt { background: #fafafa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__title { font-size: 27px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 22px; text-align: center; }
.section__sub { color: var(--gray); text-align: center; max-width: 620px; margin: 0 auto; font-size: 15px; }
.section__cta { text-align: center; margin-top: 26px; }
.container--narrow { max-width: 760px; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.feature-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card--sm { padding: 16px; box-shadow: none; }
.feature-card__icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--red-soft); color: var(--red-dark);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.feature-card h3 { font-size: 16.5px; margin-bottom: 8px; }
.feature-card p { color: var(--gray); font-size: 14px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; text-align: center; }
.step__num {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.step__icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--red-soft); color: var(--red-dark);
  display: inline-flex; align-items: center; justify-content: center; margin: 10px 0 12px;
}
.step h3 { font-size: 15.5px; margin-bottom: 6px; }
.step p { color: var(--gray); font-size: 13.5px; }

/* Curriculum preview */
.curriculum-preview-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.curriculum-preview-card__icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--blue-soft); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
}
.curriculum-preview-card h3 { font-size: 15.5px; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq__item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.faq__item summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: '+'; float: right; font-weight: 800; color: var(--red-dark); }
.faq__item[open] summary::after { content: '−'; }
.faq__item p { color: var(--gray); font-size: 14px; margin-top: 10px; }

/* Final CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  border-radius: var(--radius); padding: 44px 30px; text-align: center; display: grid; gap: 14px; justify-items: center;
}
.cta-banner h2 { font-size: 26px; font-weight: 800; }
.cta-banner p { max-width: 520px; opacity: .92; }
.cta-banner .btn--primary { background: #fff; color: var(--red-dark); }
.cta-banner .btn--primary:hover { background: #fff; box-shadow: none; opacity: .92; }

/* Quick actions grid (dashboard) */
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 10px;
  color: var(--ink); font-weight: 700; font-size: 13.5px; transition: transform .15s ease, box-shadow .15s ease;
}
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gray-light); }
.quick-action svg { width: 22px; height: 22px; color: var(--red-dark); }

/* ---------------- cards ---------------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
  animation: fadeUp .35s ease both;
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.card__head h2 { font-size: 17.5px; font-weight: 800; letter-spacing: -.2px; }
.card__icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: #f4f4f5; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.card__icon--red { background: var(--red-soft); color: var(--red-dark); }
.card__icon--green { background: var(--green-soft); color: var(--green); }
.card__icon--amber { background: var(--amber-soft); color: var(--amber); }
.card__icon--blue { background: var(--blue-soft); color: var(--blue); }
.card__body { padding: 22px; }
.card__head > div:not(.card__icon) { min-width: 0; }

.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.dash-grid > .card { margin-bottom: 0; }
.dash-grid { margin-bottom: 20px; }
.dash-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }

.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.metric { text-align: center; padding: 14px; }
.metric__num { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.metric__label { font-size: 12.5px; color: var(--gray); font-weight: 600; }

.progress { height: 10px; background: #e4e4e7; border-radius: 99px; overflow: hidden; }
.progress--lg { height: 14px; }
.progress__bar {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--red), var(--red-dark));
  transition: width .8s cubic-bezier(.22,1,.36,1);
  animation: grow .9s cubic-bezier(.22,1,.36,1) both;
}
@keyframes grow { from { width: 0 !important; } }

/* ---------------- page hero ---------------- */

.page-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.page-hero h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.5px; }
.page-hero p { color: var(--gray); max-width: 560px; }
.page-hero__stat { text-align: right; }

/* ---------------- forms ---------------- */

.form { display: grid; gap: 16px; }
.form__row { display: grid; gap: 14px; }
.form__row--2 { grid-template-columns: 1fr 1fr; }
.form__row--3 { grid-template-columns: repeat(3, 1fr); }
.form__group { display: grid; gap: 6px; }
.form__label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.form__hint { font-size: 12.5px; color: var(--gray-light); }
.form__hint--center { text-align: center; }
.form__check { display: flex; align-items: center; gap: 10px; }
.form__check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
.form__check label { font-weight: 600; font-size: 14px; }
.form--inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.input {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(242,27,27,.12); }
.input:disabled { background: #f4f4f5; color: var(--gray); }
.input--sm { padding: 8px 11px; font-size: 13.5px; }
.input--otp { text-align: center; font-size: 26px; letter-spacing: 14px; font-weight: 800; padding: 14px; }
.input--file { padding: 9px; }
.input--search { max-width: 300px; }
textarea.input { resize: vertical; min-height: 44px; }
select.input { appearance: auto; }

/* ---------------- auth card ---------------- */

.auth-card {
  width: 100%; max-width: 440px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 34px 30px; box-shadow: var(--shadow-lg);
  animation: rise .45s ease both;
}
.auth-card--key, .auth-card--otp { max-width: 480px; }
.auth-card__title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; display: flex; align-items: center; gap: 10px; }
.auth-card__sub { color: var(--gray); margin: 8px 0 22px; font-size: 14.5px; }
.auth-card__alt { margin-top: 18px; text-align: center; font-size: 14px; color: var(--gray); }

.state { text-align: center; padding: 26px 10px; display: grid; gap: 10px; justify-items: center; }
.state__icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--green-soft); color: var(--green);
  display: inline-flex; align-items: center; justify-content: center;
}
.state__icon svg { width: 26px; height: 26px; }
.state__icon--error { background: var(--red-soft); color: var(--red-dark); }
.state h3 { font-size: 17px; }
.state p { color: var(--gray); font-size: 14px; max-width: 420px; }
.state--warn { background: var(--amber-soft); border-radius: 12px; padding: 14px 16px; text-align: left; display: flex; gap: 10px; align-items: flex-start; }
.state--warn svg { color: var(--amber); flex: none; margin-top: 2px; }
.state--warn p { color: #92400e; font-weight: 600; font-size: 13.5px; }
.state--slim { padding: 10px 14px; margin-bottom: 16px; }
.state--empty { color: var(--gray-light); }
.state--empty svg { width: 34px; height: 34px; opacity: .5; }

/* ---------------- checkout ---------------- */

.checkout-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.qr-wrap { text-align: center; margin-bottom: 18px; }
.qr-wrap__img { width: 210px; height: 210px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 8px; }
.qr-wrap__placeholder {
  width: 210px; height: 210px; margin: 0 auto; border: 2px dashed var(--line); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--gray-light);
}
.qr-wrap__placeholder svg { width: 40px; height: 40px; }
.qr-wrap__hint { font-size: 12.5px; color: var(--gray); margin-top: 8px; }

.pay-details { display: grid; gap: 10px; margin-bottom: 18px; }
.pay-details > div { display: flex; justify-content: space-between; gap: 14px; font-size: 14.5px; flex-wrap: wrap; }
.pay-details dt { color: var(--gray); font-weight: 600; }
.pay-details dd { text-align: right; }

.summary-list { list-style: none; display: grid; gap: 12px; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.summary-list__total { border-top: 1px solid var(--line); padding-top: 12px; font-size: 16.5px; font-weight: 800; }

.key-reveal { text-align: center; margin-bottom: 20px; }
.key-code {
  display: inline-block; font-family: ui-monospace, monospace; font-size: 24px; font-weight: 800;
  letter-spacing: 3px; background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 12px;
  margin: 10px 0; cursor: pointer; user-select: all;
}
.key-regen, .otp-resend { margin-top: 14px; text-align: center; }

/* ---------------- curriculum / lesson ---------------- */

.lesson-list { list-style: none; }
.lesson-list__item {
  display: flex; align-items: center; gap: 14px; padding: 13px 6px; border-bottom: 1px solid var(--line);
  color: var(--ink); transition: background .15s ease;
}
.lesson-list__item:hover { background: #fafafa; }
.lesson-list__item:last-child { border-bottom: none; }
.lesson-list__num {
  width: 30px; height: 30px; flex: none; border-radius: 9px; background: #f4f4f5;
  color: var(--ink-soft); font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lesson-list__title { flex: 1; min-width: 0; font-weight: 600; }
.lesson-list__title .pill { margin-left: 8px; }

.lesson-head { margin-bottom: 18px; }
.lesson-head__back { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; color: var(--gray); margin-bottom: 10px; }
.lesson-head__back:hover { color: var(--red-dark); }
.lesson-head__title { font-size: clamp(21px, 3vw, 28px); font-weight: 800; letter-spacing: -.4px; margin-bottom: 10px; }
.lesson-head__meta { display: flex; gap: 8px; flex-wrap: wrap; }

.lesson {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 34px); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.lesson__block { margin-bottom: 26px; }
.lesson__block h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.lesson__block h2 svg { color: var(--red-dark); width: 21px; height: 21px; }
.lesson__block p { font-size: 15.5px; color: var(--ink-soft); }
.lesson__block--example { background: var(--blue-soft); border-radius: 12px; padding: 18px; }
.lesson__block--example h2 svg { color: var(--blue); }
.lesson__block--mistakes { background: var(--red-soft); border-radius: 12px; padding: 18px; }
.lesson__block--mistakes h2 svg { color: var(--red-dark); }
.lesson__block--tips { background: var(--green-soft); border-radius: 12px; padding: 18px; }
.lesson__block--tips h2 svg { color: var(--green); }
.lesson__block--task { border: 2px dashed var(--red); border-radius: 12px; padding: 18px; }

.steps { list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { display: flex; gap: 13px; align-items: flex-start; }
.steps__num {
  counter-increment: step; content: counter(step);
  width: 28px; height: 28px; flex: none; border-radius: 9px;
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.tick-list { list-style: none; display: grid; gap: 10px; }
.tick-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.tick-list svg { width: 18px; height: 18px; color: var(--green); flex: none; margin-top: 3px; }
.tick-list--cross svg { color: var(--red-dark); }

/* content protection */
.lesson--protected { position: relative; }
.lesson__watermark {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-around;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.lesson__watermark span {
  transform: rotate(-24deg); white-space: nowrap; text-align: center;
  color: rgba(24,24,27,.045); font-size: 15px; font-weight: 700; user-select: none;
}
.lesson--protected > *:not(.lesson__watermark) { position: relative; z-index: 1; }
.no-select { user-select: none; -webkit-user-select: none; }
@media print { .no-print { display: none !important; } }

.lesson-controls {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 20px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow);
}
.lesson-controls__mid { display: flex; gap: 10px; flex-wrap: wrap; }

/* bonus */
.bonus-card { color: var(--ink); transition: transform .18s ease, box-shadow .18s ease; }
.bonus-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--ink); }
.bonus-doc p { font-size: 15px; color: var(--ink-soft); margin: 6px 0; }
.bonus-doc__section { font-size: 18px; font-weight: 800; margin: 20px 0 10px; color: var(--red-dark); }
.bonus-doc__item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.bonus-doc__num {
  min-width: 26px; font-weight: 800; color: var(--red-dark); font-size: 13px;
}
.bonus-doc__check { display: flex; gap: 10px; padding: 7px 0; align-items: flex-start; }
.bonus-doc__check svg { color: var(--green); width: 17px; height: 17px; flex: none; margin-top: 3px; }

/* ---------------- community chat ---------------- */

.chat { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat__scroll { padding: 20px; max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.msg__row { display: flex; gap: 10px; }
.msg--mine .msg__row { flex-direction: row-reverse; }
.msg__bubble {
  background: #f4f4f5; border-radius: 4px 16px 16px 16px; padding: 10px 14px; max-width: 78%;
  min-width: 0;
}
.msg--mine .msg__bubble { background: var(--red-soft); border-radius: 16px 4px 16px 16px; }
.msg--announcement .msg__bubble { background: var(--amber-soft); border: 1px solid #fde68a; max-width: 100%; }
.msg__head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.msg__head strong { font-size: 13.5px; }
.msg__head time { font-size: 11px; color: var(--gray-light); }
.msg__text { font-size: 14.5px; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg__pin { display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 800; color: var(--amber); margin-bottom: 4px; }
.msg__pin svg { width: 13px; height: 13px; }
.msg__reply { display: flex; gap: 6px; align-items: center; font-size: 12.5px; background: rgba(24,24,27,.05); border-radius: 8px; padding: 5px 9px; margin-bottom: 6px; }
.msg__reply svg { width: 13px; height: 13px; color: var(--gray); }
.msg__reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg__foot { display: flex; gap: 4px; margin-top: 7px; align-items: center; flex-wrap: wrap; }
.msg__spacer { flex: 1; }
.react-btn {
  border: none; background: transparent; cursor: pointer; font-size: 13px; padding: 3px 7px;
  border-radius: 99px; color: var(--gray); transition: background .15s ease;
}
.react-btn:hover { background: rgba(24,24,27,.06); }
.react-btn.has-count { background: #f4f4f5; }
.react-btn.is-mine { background: var(--red-soft); }
.react-btn b { font-size: 11.5px; font-weight: 800; }

.chat__composer { border-top: 1px solid var(--line); padding: 14px 18px; background: #fafafa; }
.chat__row { display: flex; gap: 10px; }
.chat__replying { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; font-size: 13px; color: var(--gray); }
.chat__replying span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- notifications / sessions ---------------- */

.notif-list { list-style: none; }
.notif-list__item { display: flex; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif-list__item:last-child { border-bottom: none; }
.notif-list__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 8px; flex: none; }
.notif-list__item.is-unread .notif-list__dot { background: var(--red); }
.notif-list__item time { margin-left: auto; font-size: 12px; color: var(--gray-light); white-space: nowrap; }
.notif-list__item strong { font-size: 14.5px; }
.notif-list__item p { font-size: 13.5px; }

.session-list { list-style: none; display: grid; gap: 12px; }
.session-list__item { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.session-list__item:last-child { border-bottom: none; padding-bottom: 0; }

/* ---------------- referral ---------------- */

.referral-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.referral-box__link {
  flex: 1; min-width: 220px; background: #f4f4f5; border-radius: 10px; padding: 12px 14px;
  font-family: ui-monospace, monospace; font-size: 14px; word-break: break-all;
}

/* ---------------- tables / admin ---------------- */

.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow);
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--gray); padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #fafafa; }
.table--admin-pay { min-width: 900px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-grid--tight { grid-template-columns: repeat(6, 1fr); }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; gap: 13px; align-items: center;
  animation: fadeUp .35s ease both;
}
.stat-card__icon {
  width: 42px; height: 42px; flex: none; border-radius: 12px; background: #f4f4f5; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-card__icon--red { background: var(--red-soft); color: var(--red-dark); }
.stat-card__icon--green { background: var(--green-soft); color: var(--green); }
.stat-card__icon--amber { background: var(--amber-soft); color: var(--amber); }
.stat-card__icon--blue { background: var(--blue-soft); color: var(--blue); }
.stat-card__num { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; }
.stat-card__label { font-size: 12px; color: var(--gray); font-weight: 600; }

.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination__link {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px;
  color: var(--ink-soft); background: #fff;
}
.pagination__link.is-active { background: var(--red); border-color: var(--red); color: #fff; }

.mini-list { list-style: none; display: grid; gap: 8px; }
.mini-list li { font-size: 13.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.mini-list li:last-child { border-bottom: none; }

.lang-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.lang-tabs__tab {
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.lang-tabs__tab.is-active { background: var(--red); border-color: var(--red); color: #fff; }
.lang-tab-panel.is-hidden { display: none; }

.product-admin-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.product-admin-row__name { min-width: 200px; }
.dash-grid--settings { grid-template-columns: repeat(2, 1fr); }
.qr-preview { width: 160px; height: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }

/* ---------------- toasts / modal / skeleton ---------------- */

.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 36px)); }
.toast {
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: slideIn .3s cubic-bezier(.22,1,.36,1) both;
  display: flex; align-items: center; gap: 10px;
}
.toast--success { background: var(--green); }
.toast--error { background: #dc2626; }
.toast--info { background: var(--blue); }
.toast.hide { animation: slideOut .25s ease both; }

.modal { position: fixed; inset: 0; background: rgba(24,24,27,.5); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
.modal[hidden] { display: none; }
.modal__box { background: #fff; border-radius: 18px; padding: 22px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); animation: pop .25s cubic-bezier(.22,1,.36,1); }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal__head h3 { font-size: 17px; }

.skeleton { display: grid; gap: 10px; padding: 16px; }
.skeleton__line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton__line--80 { width: 80%; }
.skeleton__line--60 { width: 60%; }

/* ---------------- error pages ---------------- */

.error-page { text-align: center; padding: 70px 20px; max-width: 480px; margin: 0 auto; }
.error-page__code { font-size: 90px; font-weight: 800; letter-spacing: -4px; color: var(--red); line-height: 1; }
.error-page__code svg { width: 90px; height: 90px; }
.error-page h1 { font-size: 24px; margin: 16px 0 8px; }
.error-page p { color: var(--gray); margin-bottom: 22px; }

/* ---------------- footer / global buttons ---------------- */

.footer { background: #fff; border-top: 1px solid var(--line); margin-top: 40px; }
.app-body .footer { margin-top: auto; }
.footer__inner { padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.footer__brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.footer__by { color: var(--gray-light); font-weight: 600; font-size: 13px; }
.footer__copy { font-size: 13px; color: var(--gray-light); }
.lang-switch--footer select { min-width: 160px; }
.global-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------------- animations ---------------- */

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid--tight { grid-template-columns: repeat(3, 1fr); }
  .dash-grid--settings { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; gap: 30px; padding-top: 40px; }
  .checkout-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }

  /* sidebar -> drawer */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-104%);
    box-shadow: var(--shadow-lg); height: 100dvh;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar__close { display: inline-flex; }
  .drawer-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(24,24,27,.45); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .js-drawer-open { display: inline-flex; }
  .content { padding: 20px 16px 34px; }
}

@media (min-width: 861px) {
  .js-drawer-open { display: none; }
}

@media (max-width: 640px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step__num { display: none; }
  .stat-grid, .stat-grid--tight { grid-template-columns: repeat(2, 1fr); }
  .form__row--2, .form__row--3 { grid-template-columns: 1fr; }
  .page-hero { align-items: flex-start; }
  .page-hero__stat { text-align: left; }
  .msg__bubble { max-width: 88%; }
  .lesson-controls { flex-direction: column; align-items: stretch; }
  .lesson-controls__mid { flex-direction: column; }
  .lesson-controls .btn { width: 100%; }
  .table { font-size: 13px; }
  .input--otp { letter-spacing: 9px; font-size: 22px; }
}

@media (max-width: 400px) {
  .stat-grid, .stat-grid--tight { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; }
  .price-card__price { font-size: 44px; }
}
