:root {
  --bg: #f2f3f8;
  --card: #ffffff;
  --ink: #1b1d2e;
  --ink-soft: #6b6f8a;
  --line: #e3e5f0;
  --purple: #7b3fe4;
  --purple-dark: #5f28c2;
  --purple-bg: #7a38d9;
  --lav: #f3ecff;
  --navy: #111c2e;
  --yellow: #ffd02e;
  --green: #22b24c;
  --red: #e5483b;
  --radius: 16px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12131f; --card: #1c1e30; --ink: #eef0ff; --ink-soft: #9a9dbd; --line: #2c2f48; --lav: #272347;
  }
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
body.task-mode { background: var(--purple-bg); }

/* ---------- üst panel ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 28px; }
.brand { text-decoration: none; }
.brand-badge {
  position: relative; display: inline-block; background: var(--purple); color: #fff;
  font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; padding: 4px 14px 6px; border-radius: 9px;
}
.brand-badge::after { content: ""; position: absolute; left: 16px; bottom: -7px; border: 7px solid transparent; border-top-color: var(--purple); border-bottom: 0; }
.topnav { display: flex; gap: 20px; flex: 1; }
.topnav a { text-decoration: none; font-weight: 700; color: var(--ink); }
.topnav a:hover { color: var(--purple); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user { display: flex; align-items: center; gap: 8px; }
.user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: inline-grid; place-items: center; background: var(--purple); color: #fff; font-weight: 700; }
.badge { background: var(--yellow); color: #3a2c00; font-weight: 800; font-size: .72rem; padding: 2px 9px; border-radius: 99px; }
.demo-banner { background: var(--yellow); color: #3a2c00; text-align: center; padding: 7px 16px; font-size: .88rem; font-weight: 700; }

/* ---------- düymələr ---------- */
.btn { font-weight: 700; cursor: pointer; border: 2px solid transparent; padding: 11px 20px; border-radius: 12px; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .12s, border-color .12s; }
.btn.primary { background: var(--purple); color: #fff; }
.btn.primary:hover { background: var(--purple-dark); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--purple); color: var(--purple); }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.small { padding: 7px 14px; font-size: .88rem; border-radius: 10px; }
.btn:disabled { opacity: .6; cursor: progress; }
.tools { display: flex; gap: 6px; }
.icon-btn { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; font-size: .9rem; line-height: 1; }
.icon-btn:hover { border-color: var(--purple); color: var(--purple); }

.view { min-height: 60vh; }
.empty { color: var(--ink-soft); }
.page { max-width: 1100px; margin: 0 auto; padding: 44px 24px 80px; }
.page-title { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; margin-bottom: 28px; letter-spacing: -.02em; }

/* ---------- siniflər ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.class-tile { position: relative; border-radius: 22px; min-height: 150px; color: #fff; }
.class-tile .tools { position: absolute; top: 10px; right: 10px; }
.class-link { display: flex; align-items: flex-end; min-height: 150px; height: 100%; padding: 20px; text-decoration: none; color: inherit; border-radius: 22px; transition: transform .15s; }
.class-link:hover { transform: translateY(-3px); }
.class-name { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.t1 { background: #7b3fe4; } .t2 { background: #f5a623; } .t3 { background: #1fb58f; } .t4 { background: #ef5b8b; } .t5 { background: #3b8bf0; }
.add-tile { background: transparent; border: 3px dashed var(--line); color: var(--ink-soft); cursor: pointer; padding: 20px; display: flex; align-items: flex-end; }
.add-tile:hover { border-color: var(--purple); color: var(--purple); }

/* ---------- kurs ---------- */
.course { max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.side { background: var(--card); border-radius: 22px; padding: 16px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.course-card { display: flex; align-items: center; gap: 14px; background: var(--lav); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.course-card > div:nth-child(2) { flex: 1; }
.course-mark { width: 52px; height: 52px; background: var(--purple); border-radius: 50% 50% 50% 12px; flex: none; }
.course-name { font-weight: 800; font-size: 1.15rem; }
.course-sub { color: var(--ink-soft); font-size: .9rem; }
.module-list { display: flex; flex-direction: column; gap: 10px; }
.module-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); text-decoration: none; font-weight: 800; font-size: .9rem; text-transform: uppercase; line-height: 1.25; }
.module-item:hover { border-color: var(--purple); }
.module-item.active { border-color: var(--purple); color: var(--purple); }
.module-no { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lav); color: var(--purple); display: inline-grid; place-items: center; font-size: .85rem; }
.module-item.active .module-no { background: var(--purple); color: #fff; }
.module-add { padding: 12px; border: 2px dashed var(--line); background: transparent; color: var(--ink-soft); border-radius: 14px; font-weight: 700; cursor: pointer; }
.module-add:hover { border-color: var(--purple); color: var(--purple); }
.side-back { display: inline-block; margin: 14px 4px 2px; font-weight: 700; color: var(--purple); text-decoration: none; font-size: .92rem; }

.main { background: var(--card); border-radius: 22px; padding: 32px clamp(20px, 3vw, 44px) 44px; min-height: 420px; }
.main-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--line); margin-bottom: 8px; }
.main-head h1 { font-size: clamp(1.25rem, 2.4vw, 1.7rem); font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; }
.lesson { padding: 30px 0 34px; border-bottom: 1px solid var(--line); }
.lesson:last-of-type { border-bottom: 0; }
.lesson-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 22px; }
.lesson-head h2 { font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; }
.nodes { display: flex; flex-wrap: wrap; gap: 30px 36px; }
.node-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 150px; }
.node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; text-align: center; width: 100%; }
.circle { width: 100px; height: 100px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-size: 2.8rem; font-weight: 800; transition: transform .15s, box-shadow .15s; }
.node:hover .circle { transform: scale(1.06); box-shadow: 0 8px 22px rgba(123, 63, 228, .35); }
.node.kind-star .circle { color: var(--yellow); font-size: 3.4rem; }
.count { position: absolute; top: -4px; right: 14px; font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.node-label { font-size: .92rem; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.node-add { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 150px; color: var(--ink-soft); }
.node-add .circle { background: transparent; border: 3px dashed var(--line); color: var(--ink-soft); font-size: 2.4rem; }
.node-add:hover .circle { border-color: var(--purple); color: var(--purple); }
.add-lesson { margin-top: 12px; }

/* ---------- tapşırıq səhifəsi ---------- */
.taskbar { position: sticky; top: 0; z-index: 10; background: var(--navy); display: flex; align-items: center; gap: 16px; padding: 10px 18px; }
.back { flex: none; width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--navy); display: grid; place-items: center; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.steps { flex: 1; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; justify-content: center; scrollbar-width: thin; }
.step { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #2f3b52; color: #cfd6e6; display: grid; place-items: center; text-decoration: none; font-weight: 800; font-size: .85rem; border: 0; cursor: pointer; }
.step:hover { background: #46557a; }
.step.current { background: var(--yellow); color: #3a2c00; }
.step.add { background: transparent; border: 2px dashed #5b6a8c; color: #cfd6e6; font-size: 1.2rem; }
.taskbar-title { flex: none; max-width: 26vw; color: #fff; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--purple); padding: 7px 14px; border-radius: 9px; }

.stage { display: grid; grid-template-columns: 56px minmax(0, 860px) 56px; justify-content: center; gap: 16px; padding: 44px 16px 80px; align-items: start; }
.nav-arrow { position: sticky; top: 45vh; width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .22); color: #fff; display: grid; place-items: center; text-decoration: none; font-size: 1.8rem; line-height: 1; padding-bottom: 4px; }
.nav-arrow:hover { background: rgba(255, 255, 255, .38); }
.nav-arrow.off { visibility: hidden; }
.nav-arrow.next { justify-self: end; }
.task-card { background: var(--card); border-radius: 18px; padding: 28px 32px 0; box-shadow: 0 18px 50px rgba(30, 10, 80, .3); overflow: hidden; }
.task-card > :last-child { margin-bottom: 0; }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.task-no { color: var(--purple); font-weight: 800; }
.task-tools { display: flex; gap: 8px; }
.task-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 14px; overflow-wrap: anywhere; }
.prose { margin: 0 0 16px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.pics { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 20px; }
.pics img { max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.task-card > .task-title:last-child, .task-card > .btn { margin-bottom: 28px; }

.solution-bar { margin: 26px -32px 0; }
.solution-bar summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; background: var(--green); color: #fff; font-weight: 800; padding: 14px 32px; user-select: none; }
.solution-bar summary::-webkit-details-marker { display: none; }
.solution-bar .tick { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--green); display: inline-grid; place-items: center; font-size: .8rem; }
.solution-bar .chev { margin-left: auto; transition: transform .2s; font-size: 1.1rem; }
.solution-bar[open] .chev { transform: rotate(180deg); }
.solution-body { background: #f1fbf4; color: #16301f; padding: 22px 32px 28px; }
@media (prefers-color-scheme: dark) { .solution-body { background: #17301f; color: #e4f7ea; } }
.solution-body .prose:last-child, .solution-body .pics:last-child { margin-bottom: 0; }
.solution-bar.none { background: var(--bg); color: var(--ink-soft); text-align: center; padding: 14px; font-weight: 600; font-size: .92rem; }

.code-wrap { position: relative; }
.code-wrap pre { margin: 0; background: var(--navy); color: #eaf0ff; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font: 500 .92rem/1.7 var(--mono); tab-size: 4; }
.copy { position: absolute; top: 8px; right: 8px; border: 0; border-radius: 8px; padding: 4px 10px; font-weight: 700; font-size: .78rem; cursor: pointer; background: rgba(255, 255, 255, .16); color: #fff; }
.copy:hover { background: rgba(255, 255, 255, .3); }

/* ---------- modal ---------- */
.modal { border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 20px)); background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(20, 15, 60, .45); }
.modal.wide { width: min(760px, calc(100vw - 20px)); }
.modal::backdrop { background: rgba(20, 15, 60, .6); }
.modal-form { padding: 26px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 36px); overflow: auto; }
.modal-form h2 { font-size: 1.5rem; font-weight: 800; }
.modal-body { display: flex; flex-direction: column; gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: -26px; background: var(--card); padding: 12px 0 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: .92rem; }
.field-hint { color: var(--ink-soft); font-size: .82rem; }
.field input, .field textarea, .field select { font: inherit; width: 100%; padding: 11px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--purple); outline: none; }
.field textarea.mono { font-family: var(--mono); font-size: .9rem; tab-size: 4; }
.group { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 14px; border: 2px solid var(--line); }
.group h3 { font-size: 1rem; font-weight: 800; color: var(--purple); }
.solution-group { border-color: #bfe8cb; }
.solution-group h3 { color: var(--green); }
.gallery { display: flex; flex-direction: column; gap: 10px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.thumb-x:hover { background: var(--red); }
.gallery-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgba(10, 8, 30, .85); }
.lightbox img { display: block; max-width: 96vw; max-height: 94vh; border-radius: 10px; background: #fff; cursor: zoom-out; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* ---------- mobil ---------- */
@media (max-width: 900px) {
  .course { grid-template-columns: 1fr; padding: 14px; }
  .side { position: static; max-height: none; }
  .topbar-inner { padding: 10px 14px; gap: 14px; }
  .user-name { display: none; }
  .stage { grid-template-columns: minmax(0, 1fr); padding: 20px 12px 90px; }
  .nav-arrow { position: fixed; top: auto; bottom: 18px; z-index: 5; background: rgba(17, 28, 46, .85); }
  .nav-arrow.prev { left: 14px; }
  .nav-arrow.next { right: 14px; }
  .task-card { padding: 22px 18px 0; }
  .solution-bar { margin-left: -18px; margin-right: -18px; }
  .solution-bar summary, .solution-body { padding-left: 18px; padding-right: 18px; }
  .taskbar-title { display: none; }
  .circle { width: 84px; height: 84px; font-size: 2.3rem; }
  .node-wrap, .node-add { width: 128px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ================= Alqoritmika üslubu + ikonlar + sürüşdürmə ================= */
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn { display: inline-grid; place-items: center; }
.icon-btn .ico { width: 15px; height: 15px; }
.icon-btn:hover.danger-ico, .tools .icon-btn:last-child:hover { color: var(--red); border-color: var(--red); }
.hint { color: var(--ink-soft); font-size: .86rem; margin: -14px 0 22px; }
.side .hint { margin: 12px 4px 0; }
.side-back { display: inline-flex; align-items: center; gap: 8px; }
.side-back .ico { width: 16px; height: 16px; }

.topbar { box-shadow: 0 1px 0 var(--line); }
.topbar-inner { padding: 10px 24px; }
.main { border-radius: 22px; }
.lesson-head h2 { color: var(--ink); }

.module-row { display: flex; align-items: center; gap: 6px; }
.module-row .module-item { flex: 1; min-width: 0; }
.module-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-row .tools .icon-btn { width: 28px; height: 28px; }

.node.kind-star .circle .ico { width: 54px; height: 54px; color: var(--yellow); }
.node-add .circle .ico, .node-add .circle { font-size: 2.4rem; }
.node-add .circle .ico { width: 36px; height: 36px; }

/* tapşırıq səhifəsi: açıq fon, tünd üst panel, yaşıl dairələr */
body.task-mode { background: var(--bg); }
.back .ico { width: 20px; height: 20px; }
.step { background: var(--green); color: #fff; }
.step:hover { background: #1a9a3f; }
.step.current { background: #000; color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.step.add { background: transparent; border: 2px dashed #5b6a8c; color: #cfd6e6; }
.step.add .ico { width: 16px; height: 16px; }
.step.add:hover { background: #2f3b52; }
.taskbar-title { display: inline-flex; align-items: center; gap: 6px; }
.taskbar-title .ico { color: var(--yellow); }
.stage { grid-template-columns: 52px minmax(0, 1040px) 52px; padding: 28px 16px 80px; }
.stage-col { min-width: 0; }
.task-card { border-radius: 10px; box-shadow: 0 2px 12px rgba(20, 20, 60, .07); }
.nav-arrow { width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--navy); box-shadow: 0 4px 14px rgba(20, 20, 60, .16); padding: 0; transition: background .15s, color .15s, transform .15s; }
.nav-arrow:hover { background: var(--purple); color: #fff; transform: scale(1.06); }
.nav-arrow .ico { width: 22px; height: 22px; stroke-width: 2.6; }
.task-foot { display: flex; justify-content: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.foot-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 26px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.foot-btn .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.foot-btn.prev { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.foot-btn.prev:hover { border-color: var(--purple); color: var(--purple); }
.foot-btn.next { background: var(--yellow); color: #1b1d2e; flex: 0 1 400px; min-width: 200px; }
.foot-btn.next:hover { background: #ffc400; }
.solution-bar .tick .ico { width: 13px; height: 13px; stroke-width: 3; }
.solution-bar .chev { display: inline-flex; }
.solution-bar .chev .ico { width: 20px; height: 20px; }
.thumb-x { display: grid; place-items: center; padding: 0; }
.thumb-x .ico { width: 14px; height: 14px; stroke-width: 3; }

/* sürüşdürmə */
.sortable > [data-sid] { cursor: grab; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.sort-drag { opacity: .25; }
.sort-ghost { position: fixed; z-index: 300; pointer-events: none; margin: 0; opacity: .95; transform: scale(1.04) rotate(1.2deg); box-shadow: 0 18px 40px rgba(30, 10, 80, .35); border-radius: 16px; }
.sort-ghost:not(.class-tile):not(.step) { background: var(--card); }
body.sorting, body.sorting * { cursor: grabbing !important; user-select: none; }
@media (max-width: 900px) { .nav-arrow { display: none; } .stage { padding-top: 18px; } .foot-btn.next { flex: 1 1 auto; } }

/* ================= giriş səhifəsi ================= */
body.login-mode { background: #fff; }
body.login-mode .demo-banner { display: none !important; }
.login { display: grid; grid-template-columns: 440px 1fr; min-height: 100vh; }
.login-side { display: flex; flex-direction: column; padding: 28px 32px; background: #fff; color: #1b1d2e; }
.login-side .brand-badge { align-self: flex-start; }
.login-box { margin: auto 0; padding-bottom: 12vh; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.login-sub { margin: 0 0 8px; color: #6b6f8a; font-size: .95rem; }
.g-btn, .guest-btn { height: 48px; border-radius: 10px; font: 700 1rem var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: background .12s, border-color .12s; }
.g-btn { background: #fff; color: #1b1d2e; border: 1px solid #d9dbe8; }
.g-btn:hover { border-color: var(--purple); background: #faf7ff; }
.g-btn svg { width: 20px; height: 20px; }
.guest-btn { background: var(--purple); color: #fff; border: 0; }
.guest-btn:hover { background: var(--purple-dark); }
.login-or { display: flex; align-items: center; gap: 12px; color: #9a9dbd; font-size: .85rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: #e3e5f0; }
.login-note { margin: 4px 0 0; color: #9a9dbd; font-size: .82rem; }
.login-art { background: linear-gradient(180deg, #774ac9 0%, #8d57e2 55%, #a76cee 100%); display: grid; place-items: center; padding: 40px; }
.login-art svg { width: min(100%, 760px); height: auto; filter: drop-shadow(0 24px 40px rgba(30, 10, 80, .3)); }
.guest-tag { background: var(--lav); color: var(--purple); font-weight: 800; font-size: .75rem; padding: 3px 10px; border-radius: 99px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } .login-box { padding-bottom: 0; margin: 40px 0; } }
@media (prefers-color-scheme: dark) { body.login-mode { background: #fff; } }

/* ================= giriş səhifəsi: əsas dizayna uyğun ================= */
body.login-mode, body.login-mode { background: var(--bg); }
.login { display: flex; flex-direction: column; grid-template-columns: none; min-height: 100vh; }
.login .topbar { position: static; }
.login-body { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 24px; }
.login-side { background: var(--card); color: var(--ink); border-radius: 22px; padding: 36px; display: flex; align-items: center; }
.login-box { margin: 0; padding: 0; width: 100%; }
.login-head { width: 84px; height: 84px; border-radius: 50%; background: var(--lav); margin-bottom: 4px; }
.login-box h1 { font-size: 2rem; }
.login-art { position: relative; overflow: hidden; min-height: 540px; border-radius: 22px; padding: 0; display: block; background: linear-gradient(180deg, #7b3fe4 0%, #8f55ea 60%, #a56df0 100%); }
.art-mascot { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(68%, 440px); height: auto; filter: drop-shadow(0 18px 24px rgba(30, 10, 80, .35)); }
.bubble { position: absolute; left: 50%; top: 9%; transform: translateX(8%); background: #fff; color: var(--purple); font-weight: 800; font-size: 1.15rem; padding: 10px 20px; border-radius: 16px 16px 16px 4px; box-shadow: 0 10px 24px rgba(30, 10, 80, .2); animation: bob 4s ease-in-out infinite; }
.fl { position: absolute; display: grid; place-items: center; font-weight: 800; box-shadow: 0 10px 24px rgba(30, 10, 80, .22); animation: bob 5s ease-in-out infinite; }
.fl-num { left: 9%; top: 18%; width: 84px; height: 84px; border-radius: 50%; background: #fff; color: var(--purple); font-size: 2.6rem; }
.fl-star { right: 10%; top: 34%; width: 84px; height: 84px; border-radius: 50%; background: var(--yellow); color: var(--purple); animation-delay: -1.5s; }
.fl-star svg { width: 42px; height: 42px; }
.fl-code { left: 8%; bottom: 20%; padding: 12px 20px; border-radius: 14px; background: #fff; color: var(--purple); font: 800 1.5rem var(--mono); animation-delay: -3s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .bubble, .fl { animation: none; } }
@media (max-width: 900px) { .login-body { grid-template-columns: 1fr; padding: 14px; } .login-art { display: none; } .login-side { padding: 26px 22px; } }

/* ana səhifə və kurs kartında maskot */
.page { position: relative; }
.page-title { min-height: 110px; display: flex; align-items: center; margin-bottom: 4px; padding-right: 170px; }
.page .hint { margin: 0 0 22px; }
.page-mascot { position: absolute; right: 24px; top: 24px; width: 140px; height: auto; pointer-events: none; }
.course-mark { width: 56px; height: 56px; border-radius: 50%; background: #fff url(../img/mascot-head.png) center / cover no-repeat; }
@media (max-width: 600px) { .page-mascot { width: 84px; top: 36px; } .page-title { min-height: 90px; padding-right: 96px; } }

/* ================= yüklənmə, maskot, mobil ================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes barMove { 0% { left: -40%; } 100% { left: 100%; } }
.view > * { animation: fadeIn .28s ease both; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid var(--lav); border-top-color: var(--purple); animation: spin .8s linear infinite; }
.loader { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; pointer-events: none; opacity: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(2px); transition: opacity .2s; }
.loader.on { opacity: 1; }
.loader-bar { position: absolute; top: 0; left: 0; right: 0; height: 4px; overflow: hidden; }
.loader-bar::after { content: ""; position: absolute; top: 0; width: 40%; height: 100%; background: var(--purple); border-radius: 4px; animation: barMove 1s ease-in-out infinite; }
.busy { pointer-events: none; opacity: .85; }
.busy::before { content: ""; width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }

.page-title { min-height: 0; padding-right: 0; margin-bottom: 20px; }
.peek { position: fixed; left: 0; bottom: 5vh; z-index: 20; width: 220px; pointer-events: none; }
.peek img { display: block; width: 100%; height: auto; pointer-events: auto; cursor: pointer; transform: translateX(-66%); transition: transform .6s cubic-bezier(.34, 1.45, .64, 1); filter: drop-shadow(0 10px 16px rgba(30, 10, 80, .28)); -webkit-tap-highlight-color: transparent; }
.peek.out img { transform: translateX(0); }
.peek-bubble { position: absolute; left: 150px; top: -6px; background: var(--purple); color: #fff; font-weight: 800; font-size: .95rem; padding: 8px 14px; border-radius: 14px 14px 14px 4px; white-space: nowrap; opacity: 0; transform: translateX(-14px) scale(.9); transition: opacity .25s .2s, transform .35s .2s; }
.peek.out .peek-bubble { opacity: 1; transform: none; }
@media (hover: hover) {
  .peek:hover img { transform: translateX(0); }
  .peek:hover .peek-bubble { opacity: 1; transform: none; }
}
.fl-num { font-size: 1.6rem; }
@media (prefers-reduced-motion: reduce) { .view > *, .spinner, .loader-bar::after, .busy::before { animation: none; } .peek img { transition: none; } }

/* mobil */
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
.steps > :first-child { margin-left: auto; }
.steps > :last-child { margin-right: auto; }
@media (max-width: 900px) {
  .page { padding: 28px 16px 90px; }
  .class-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .class-tile, .class-link { min-height: 120px; }
  .class-name { font-size: 1.35rem; }
  .main { padding: 22px 16px 32px; border-radius: 18px; }
  .lesson-head { flex-wrap: wrap; }
  .nodes { gap: 24px 22px; justify-content: flex-start; }
  .taskbar { padding: 8px 12px; gap: 10px; }
  .step, .back { width: 34px; height: 34px; }
  .modal-form { padding: 18px; }
  .modal-actions { bottom: -18px; }
  .peek { width: 150px; bottom: 3vh; }
  .peek-bubble { left: 100px; font-size: .85rem; }
  .module-row .tools .icon-btn, .tools .icon-btn { width: 34px; height: 34px; }
}
@media (max-width: 480px) {
  .topbar-inner { gap: 10px; }
  .brand-badge { font-size: 1.05rem; }
  .task-card { padding: 18px 14px 0; }
  .solution-bar { margin-left: -14px; margin-right: -14px; }
  .solution-bar summary, .solution-body { padding-left: 14px; padding-right: 14px; }
  .task-foot { gap: 10px; }
  .foot-btn { flex: 1 1 calc(50% - 10px); padding: 0 14px; }
  .foot-btn.next { flex: 1 1 100%; }
  .circle { width: 76px; height: 76px; font-size: 2.1rem; }
  .node-wrap, .node-add { width: 112px; }
}
