*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #FFFFFF;
  --ink: #14213D;
  --muted: #5B6B82;
  --soft: #8A97AB;
  --line: #E6EAF1;
  --tint: #F5F7FB;
  --brand: #2F5BEA;
  --brand-deep: #1F44C4;
  --paper-blue: #F0F3FD;
  --warm: #EE7B30;
}
html, body { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--onest);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--brand); }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  color: var(--ink);
}
.mark svg { width: 42px; height: 34px; color: var(--brand); }
.mark span { font-family: var(--onest); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }

.stage {
  flex: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
  font-family: var(--onest);
}
.page-title { margin: 0 0 32px; text-align: center; font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: -.03em; }

/* Course grid */
.courses {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.course { display: flex; flex-direction: column; }
.poster {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 24px 26px;
  border-radius: 14px;
  background: var(--paper-blue);
}
.when-big {
  margin-bottom: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--warm);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
}
.course.is-open .when-big { background: var(--brand); }
.course-title { margin: 0; font-weight: 800; font-size: 1.4rem; line-height: 1.18; letter-spacing: -.02em; color: var(--ink); }
.course-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: auto;
  padding-top: 22px;
}
.price { font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 34px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font: 600 1.02rem/1 var(--onest);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s;
}
.btn:hover { background: var(--brand-deep); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.btn[aria-disabled="true"], .btn:disabled { background: var(--tint); color: var(--soft); cursor: default; }

.empty { grid-column: 1 / -1; padding: 40px 24px; text-align: center; color: var(--muted); border-radius: 14px; background: var(--paper-blue); }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 800; font-size: 1.15rem; }

.fineprint { margin: 40px auto 0; max-width: 560px; text-align: center; font-size: .95rem; color: var(--muted); }

@media (max-width: 600px) {
  .stage { padding-top: 28px; }
  .page-title { margin-bottom: 20px; }
  .courses { grid-template-columns: 1fr; gap: 24px; }
  .poster { padding: 22px 18px 18px; }
  .course-title { font-size: 1.28rem; }
}

/* Legal footer: seller details LiqPay requires on the site. */
.legal {
  padding: 32px max(16px, calc((100% - 1180px) / 2)) 40px;
  border-top: 1px solid var(--line);
  background: var(--tint);
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.55;
}
.legal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 28px; }
@media (max-width: 860px) { .legal-grid { grid-template-columns: 1fr 1fr; } }
.legal b { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 600; }
.legal p { margin: 0; }
.legal a { text-underline-offset: .2em; }
.legal { font-family: var(--onest); }
@media (max-width: 520px) { .legal-grid { grid-template-columns: 1fr; } }

/* Checkout dialog */
.buy {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 40px 80px -24px rgba(15, 27, 46, .35);
}
.buy::backdrop { background: rgba(15, 27, 46, .32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.buy[open] { animation: rise .3s ease both; }
.buy-form { position: relative; display: grid; gap: 14px; padding: 28px 24px 24px; }
.buy-close { position: absolute; top: 18px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--tint); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.buy-close:hover { background: var(--line); }
.buy-kicker { margin: 0; color: var(--muted); font-size: .9rem; }
.buy-title { margin: -6px 0 0; padding-right: 36px; font-family: var(--onest); font-weight: 800; font-size: 1.3rem; line-height: 1.2; letter-spacing: -.02em; }
.buy-price { margin: -6px 0 4px; font-family: var(--onest); font-weight: 700; font-size: 1.1rem; }
.buy-field { display: grid; gap: 6px; }
.buy-field > span { font-weight: 600; font-size: .9rem; }
.buy-field i { font-style: normal; font-weight: 400; color: var(--soft); }
.buy-field small { color: var(--soft); font-size: .8rem; }
.buy-field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.3 var(--text);
}
.buy-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 79, 216, .15); }
.buy-error { margin: 0; color: #C2372F; font-weight: 600; font-size: .9rem; }
.buy-pay { width: 100%; height: 52px; margin-top: 4px; }
.buy-note { margin: 0; font-size: .78rem; color: var(--soft); text-align: center; }

/* Thank-you page */
.thanks { flex: 1; display: grid; place-items: center; padding: 24px 16px; background: var(--tint); }
.thanks-card { width: min(460px, 100%); padding: 36px 28px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 32px -16px rgba(15, 27, 46, .18); text-align: center; display: grid; gap: 12px; justify-items: center; }
.thanks-card h1 { margin: 0; font-family: var(--onest); font-weight: 800; font-size: 1.45rem; line-height: 1.2; letter-spacing: -.02em; }
.thanks-card p { margin: 0; color: var(--muted); }
.thanks-card b { color: var(--ink); }
.thanks-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #E3F6F1; color: #0E9F7E; font-size: 1.6rem; font-weight: 700; }
.thanks-icon.wait { background: #EAF0FF; color: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
.thanks-icon.bad { background: #FDECEA; color: #C2372F; }
.thanks-card .btn { margin-top: 8px; }
.thanks-card .back { margin: 6px 0 0; font-size: .9rem; text-decoration: none; font-weight: 600; }
@keyframes pulse { 50% { opacity: .5; } }

/* Offer page */
.doc { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 64px; }
.doc h1 { font-family: var(--onest); font-weight: 800; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; }
.doc h2 { font-family: var(--onest); font-weight: 800; font-size: 1.05rem; margin: 30px 0 8px; }
.doc p, .doc li { color: var(--muted); }
.doc ol, .doc ul { padding-left: 1.2em; }
.back { display: inline-block; margin-bottom: 24px; text-decoration: none; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .buy[open], .thanks-icon.wait { animation: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.buy-when { margin: -4px 0 0; color: var(--warm); font-weight: 600; font-size: .95rem; }
.buy-desc { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; white-space: pre-line; max-height: 40vh; overflow: auto; }
.buy-when.is-open { color: var(--brand); }
