:root {
  color-scheme: light;
  --violet: #5536e8;
  --violet-d: #3f22cf;
  --violet-t: #efebff;
  --sun: #ffc83d;
  --coral: #ff7a66;
  --coral-d: #d6361f;
  --mint: #7fe3c4;
  --bg: #faf9ff;
  --text: #18152b;
  --muted: #5e5a78;
  --line: #e9e6f5;
  --shadow: 0 1px 2px rgba(40, 24, 120, .06), 0 8px 24px rgba(40, 24, 120, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 17px/1.6 "Noto Sans", system-ui, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1 { font-family: "Unbounded", sans-serif; line-height: 1.08; margin: 0; }
a { color: inherit; }
.s { color: var(--coral-d); }

/* Логотип: літера Ї з двома крапками */
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 20px "Unbounded", sans-serif; text-decoration: none; }
.logo-mark { position: relative; width: 34px; height: 34px; border-radius: 10px; background: var(--violet); flex: none; }
.logo-mark::after { content: ""; position: absolute; left: 14px; top: 13px; width: 6px; height: 15px; border-radius: 1.5px; background: #fff; }
.logo-mark i { position: absolute; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.logo-mark i + i { background: var(--coral); }
.logo-mark i:first-child { left: 8px; } .logo-mark i:last-child { right: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 12px 28px; border-radius: 16px;
  font: 700 17px "Noto Sans", sans-serif; text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:focus-visible, .top-link:focus-visible, .logo:focus-visible, .lesson:focus-visible, .tabs a:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.btn-sun { background: var(--sun); color: var(--text); box-shadow: 0 6px 0 #c9921a; }
.btn-sun:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #c9921a; }
.btn-sun:active { transform: translateY(4px); box-shadow: 0 2px 0 #c9921a; }
.btn-line { color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-line:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn-violet { width: 100%; background: var(--violet); color: #fff; }
.btn-violet:hover { background: var(--violet-d); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover, .btn:active { transform: none; } }
.top-link { font-weight: 700; text-decoration: none; padding: 8px 16px; border-radius: 12px; }

/* ---------- Головна ---------- */
.home-page { background: var(--violet); color: #fff; }
.home { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.home .top { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 32px 0; }
.home .logo-mark { background: #fff; }
.home .logo-mark::after { background: var(--violet); }
.home .top-link { color: #fff; border: 2px solid rgba(255, 255, 255, .35); }
.home .top-link:hover { background: #fff; color: var(--violet-d); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.copy { align-self: center; padding: 24px 0 48px; }
.kicker { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 700; font-size: 15px; color: #fff; }
.home h1 { font-size: clamp(40px, 6.2vw, 84px); font-weight: 800; letter-spacing: -.02em; }
.lead { max-width: 30em; margin: 22px 0 32px; font-size: clamp(17px, 1.6vw, 20px); color: #e6e0ff; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hint { margin: 16px 0 0; font-size: 15px; color: #cfc6ff; }

.photo { position: relative; align-self: end; height: min(84vh, 786px); height: min(84svh, 786px); display: flex; justify-content: center; }
.photo picture { position: relative; z-index: 1; height: 100%; }
.photo img { display: block; height: 100%; width: auto; }
.sun { position: absolute; left: 50%; bottom: 12%; width: min(88%, 470px); aspect-ratio: 1; border-radius: 50%; background: var(--sun); transform: translateX(-50%); }
.deco { position: absolute; border-radius: 999px; transform: rotate(35deg); }
.b1 { width: 34px; height: 170px; background: var(--coral); right: 2%; top: 12%; }
.b2 { width: 22px; height: 110px; background: var(--mint); left: 4%; top: 30%; }
.b3 { width: 16px; height: 70px; background: #fff; right: 14%; bottom: 8%; opacity: .9; }

@media (max-width: 820px) {
  .home .top { padding: 16px 20px 0; }
  .hero-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 0; padding: 0 20px; }
  .copy { padding: 18px 0 8px; }
  .kicker { margin-bottom: 12px; font-size: 14px; }
  .lead { margin: 14px 0 20px; }
  .actions { gap: 10px; }
  .actions .btn { flex: 1 1 0; min-height: 50px; padding: 10px 8px; font-size: 16px; }
  .hint { margin-top: 12px; font-size: 14px; }
  .photo { align-self: stretch; height: auto; min-height: 280px; }
  .photo picture { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); height: 100%; }
  .sun { width: auto; height: 66%; bottom: 4%; }
  .b1 { width: 24px; height: 110px; } .b2 { width: 16px; height: 80px; }
}
@media (max-width: 820px) and (max-height: 700px) {
  .lead { display: none; }
  .actions { margin-top: 18px; }
}

/* ---------- Вхід і реєстрація ---------- */
.auth-page { background: var(--violet); }
.auth { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 16px; }
.auth > .logo { color: #fff; }
.auth .logo-mark { background: #fff; }
.auth .logo-mark::after { background: var(--violet); }
.card { width: 100%; max-width: 440px; background: #fff; border-radius: 28px; padding: 28px clamp(20px, 5vw, 36px) 30px; box-shadow: 0 24px 60px rgba(20, 8, 90, .35); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px; border-radius: 14px; background: var(--violet-t); }
.tabs a { text-align: center; padding: 10px; border-radius: 10px; font-weight: 700; color: var(--violet-d); text-decoration: none; }
.tabs a.on { background: var(--violet); color: #fff; }
.card h1 { font-size: 24px; }
.sub { margin: 8px 0 20px; color: var(--muted); }
.error { margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; background: #ffe9e4; color: #8f2414; font-weight: 600; }
form label { display: block; margin-bottom: 14px; font-weight: 700; font-size: 15px; }
form input { display: block; width: 100%; margin-top: 6px; min-height: 52px; padding: 10px 16px; font: inherit; font-weight: 400; color: var(--text); border: 2px solid var(--line); border-radius: 14px; background: #fff; }
form input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-t); }
.note { margin: -8px 0 16px; font-size: 14px; color: var(--muted); }
form .btn { margin-top: 6px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.switch { margin: 18px 0 0; text-align: center; color: var(--muted); }
.switch a { color: var(--violet-d); font-weight: 700; }

/* ---------- Тренажер НМТ: список уроків ---------- */
.bar { display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); background: #fff; border-bottom: 1px solid var(--line); }
.bar .logo { margin-right: auto; }
.bar .top-link { color: var(--violet-d); border: 2px solid var(--line); }
.bar .top-link:hover { border-color: var(--violet); }
.who { font-weight: 600; color: var(--muted); }
@media (max-width: 480px) { .who { display: none; } }
.lessons { max-width: 1120px; margin: 0 auto; padding: 48px 16px 80px; }
.lessons h1 { font-size: clamp(32px, 5vw, 52px); }
.lessons h1::after { content: ""; display: block; width: 56px; height: 6px; border-radius: 3px; background: var(--sun); margin-top: 14px; }
.lessons .sub { font-size: 18px; margin: 18px 0 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.lesson { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; min-height: 260px; padding: 26px; border-radius: 24px; background: var(--violet); color: #fff; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s; }
a.lesson:hover { transform: translateY(-3px); }
a.lesson::after { content: ""; position: absolute; right: -10px; top: -30px; width: 30px; height: 150px; border-radius: 999px; background: var(--sun); transform: rotate(35deg); }
.lesson-title { font: 800 34px "Unbounded", sans-serif; }
.lesson .s { color: var(--sun); }
.lesson-text { color: #e6e0ff; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.facts span { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-weight: 700; font-size: 14px; }
.open { margin-top: auto; align-self: flex-start; padding: 10px 20px; border-radius: 12px; background: var(--sun); color: var(--text); font-weight: 700; }
.soon { background: transparent; color: var(--muted); border: 2px dashed #cfc8ee; box-shadow: none; }
.soon .lesson-title { color: #b3abd9; }
.soon .lesson-text { color: var(--muted); }
.prose { max-width: 760px; }

/* ---------- Підтвердження виходу ---------- */
.btn-ghost { background: #fff; color: var(--violet-d); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--violet); }
.confirm { width: min(440px, calc(100% - 32px)); border: 0; border-radius: 24px; padding: 28px; box-shadow: 0 24px 60px rgba(20, 8, 90, .35); color: var(--text); }
.confirm::backdrop { background: rgba(24, 12, 90, .55); }
.confirm h2 { margin: 0 0 8px; font: 700 22px/1.2 "Unbounded", sans-serif; }
.confirm p { margin: 0 0 22px; color: var(--muted); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .btn { width: 100%; min-height: 50px; padding: 10px; }
.card .confirm-actions { margin-top: 8px; }

/* ---------- Форми: пароль ---------- */
.notice { margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; background: #dcf6ec; color: #0b5c46; font-weight: 600; }
.pass { position: relative; display: block; }
.pass input { padding-right: 104px; }
.eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin-top: 3px; border: 0; background: var(--violet-t); color: var(--violet-d); font: 700 14px "Noto Sans", sans-serif; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.eye:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.rules { list-style: none; margin: -4px 0 18px; padding: 0; font-size: 14px; color: var(--muted); }
.rules li { position: relative; padding-left: 24px; margin-bottom: 4px; }
.rules li::before { content: "○"; position: absolute; left: 4px; }
.rules li.ok { color: #0b7c5f; }
.rules li.ok::before { content: "✓"; font-weight: 800; }
.rules.show-bad li:not(.ok) { color: #b42318; font-weight: 600; }
.rules.show-bad li:not(.ok)::before { content: "✗"; }

/* ---------- Прогрес у картці уроку ---------- */
.progress { display: grid; gap: 6px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .12); }
.p-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.p-row b { color: var(--sun); white-space: nowrap; }
.p-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.p-bar i { display: block; height: 100%; border-radius: 99px; background: var(--sun); }

.lesson-num { font: 700 13px "Unbounded", sans-serif; color: var(--sun); }
.lesson-title { overflow-wrap: anywhere; }
.cards .lesson:not(.soon) .lesson-title { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; }
