/* ============================================================
   Kelajakka ta'lim — dizayn tizimi
   Akademik ishonch + matematik grid signaturasi
   Display: Sora · Body: Manrope · Brend: ko'k + oltin
   ============================================================ */

:root {
  /* Brend ko'k shkalasi */
  --brand-900: #15365b;
  --brand-800: #1a4269;
  --brand-700: #1f4e79;   /* TZ: asosiy quyuq */
  --brand-600: #2864a0;
  --brand-500: #2e75b6;   /* TZ: yorqin */
  --brand-400: #5b97cf;
  --brand-300: #8fbbe2;
  --brand-200: #c4ddf2;
  --brand-100: #e6f0fa;
  --brand-50:  #f2f7fc;

  /* Oltin urg'u (gamifikatsiya, CTA) */
  --gold-600: #d6860a;
  --gold-500: #f5a524;
  --gold-400: #ffbe4d;
  --gold-100: #fdeccb;
  --gold-50:  #fff7e9;

  /* Matn (navy-asosli) */
  --ink-900: #11203a;
  --ink-700: #2b3a55;
  --ink-500: #5a6b86;
  --ink-400: #8593a9;
  --ink-300: #aab6c8;

  /* Yuza va fon */
  --bg: #ffffff;
  --bg-soft: #f5f8fc;
  --bg-tint: #eef4fb;
  --surface: #ffffff;
  --line: #e4ebf3;
  --line-strong: #d2dde9;
  --grid-line: rgba(31, 78, 121, 0.05);

  /* Holat ranglari */
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --danger: #c0392b;
  --danger-bg: #fcebe9;
  --warning: #b9770a;
  --warning-bg: #fdf2dc;
  --info: var(--brand-500);
  --info-bg: var(--brand-100);

  /* Tipografiya */
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;

  /* Shakl */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Soyalar (mayin, qatlamli) */
  --sh-xs: 0 1px 2px rgba(17, 32, 58, 0.06);
  --sh-sm: 0 2px 8px rgba(17, 32, 58, 0.06);
  --sh: 0 6px 20px rgba(17, 32, 58, 0.08);
  --sh-lg: 0 18px 48px rgba(17, 32, 58, 0.12);
  --sh-brand: 0 12px 30px rgba(31, 78, 121, 0.22);
  --sh-gold: 0 10px 26px rgba(214, 134, 10, 0.28);

  --container: 1140px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink-700);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--brand-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-700); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink-900); line-height: 1.18; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.02rem; }
p { color: var(--ink-600, var(--ink-700)); }
main { flex: 1; }

::selection { background: var(--brand-200); color: var(--brand-900); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand-700); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

:focus-visible { outline: 3px solid var(--brand-400); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section--soft { background: var(--bg-soft); }
.section__head { max-width: 640px; margin-bottom: 40px; }
.section__head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-size: .76rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brand-600);
  background: var(--brand-100); padding: 6px 13px; border-radius: var(--r-full); margin-bottom: 16px;
}
.lead { font-size: 1.12rem; color: var(--ink-500); }
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.graph-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand-700); --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: .96rem;
  padding: 12px 22px; border-radius: var(--r-full); border: 1.5px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg);
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, color .2s, border-color .2s;
  white-space: nowrap; line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { --btn-bg: linear-gradient(135deg, var(--brand-600), var(--brand-800)); box-shadow: var(--sh-brand); color: #fff; }
.btn--primary:hover { color: #fff; box-shadow: 0 16px 34px rgba(31,78,121,.32); }
.btn--accent { --btn-bg: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: #3a2600; box-shadow: var(--sh-gold); }
.btn--accent:hover { color: #3a2600; }
.btn--outline { background: transparent; border-color: var(--line-strong); color: var(--ink-700); }
.btn--outline:hover { border-color: var(--brand-500); color: var(--brand-700); background: var(--brand-50); }
.btn--ghost { background: transparent; color: var(--ink-700); }
.btn--ghost:hover { background: var(--brand-50); color: var(--brand-700); }
.btn--sm { padding: 9px 16px; font-size: .88rem; }
.btn--lg { padding: 15px 30px; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.navbar__inner { display: flex; align-items: center; gap: 20px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 800; font-size: 1.16rem; color: var(--ink-900); }
.brand:hover { color: var(--ink-900); }
.brand__mark { display: grid; place-items: center; filter: drop-shadow(0 4px 10px rgba(31,78,121,.25)); }
.brand__logo { height: 42px; width: auto; display: block; }
.brand__chip { display: grid; place-items: center; background: #fff; border-radius: 11px; padding: 5px; box-shadow: var(--sh-sm); }
.brand__chip .brand__logo { height: 34px; }
.brand__accent { color: var(--brand-600); }
.navbar__links { display: flex; align-items: center; gap: 4px; margin-left: 8px; margin-right: auto; }
.navlink {
  font-family: var(--font-display); font-weight: 600; font-size: .93rem; color: var(--ink-700);
  padding: 8px 14px; border-radius: var(--r-full); transition: background .15s, color .15s;
}
.navlink:hover { background: var(--brand-50); color: var(--brand-700); }
.navlink--manage { color: var(--gold-600); }
.navlink--manage:hover { background: var(--gold-50); color: var(--gold-600); }
.navbar__actions { display: flex; align-items: center; gap: 12px; }

.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-full); background: var(--bg-soft); border: 1px solid var(--line); font-size: 1.05rem; }
.icon-btn:hover { background: var(--brand-50); border-color: var(--brand-200); }
.dot-badge {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; font-size: .68rem; font-weight: 700; color: #fff;
  background: var(--danger); border-radius: var(--r-full); border: 2px solid #fff;
}
.xp-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--ink-700);
  background: var(--gold-50); border: 1px solid var(--gold-100); padding: 6px 12px; border-radius: var(--r-full);
}
.xp-chip b { color: var(--gold-600); font-family: var(--font-display); }
.xp-chip__lvl { font-family: var(--font-display); font-weight: 700; font-size: .72rem; color: #fff; background: var(--gold-500); padding: 2px 7px; border-radius: var(--r-full); }

.avatar {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800)); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .92rem; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--btn { border: 2px solid #fff; box-shadow: var(--sh-sm); }
.avatar--lg { width: 76px; height: 76px; font-size: 1.5rem; }

/* User menu */
.usermenu { position: relative; }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.usermenu.open .usermenu__panel { opacity: 1; visibility: visible; transform: translateY(0); }
.usermenu__head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.usermenu__head strong { font-family: var(--font-display); color: var(--ink-900); }
.usermenu__head span { font-size: .8rem; color: var(--ink-400); }
.usermenu__panel a, .usermenu__logout {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: .92rem; color: var(--ink-700); background: none; border: none;
}
.usermenu__panel a:hover, .usermenu__logout:hover { background: var(--brand-50); color: var(--brand-700); }
.usermenu__logout { color: var(--danger); font-weight: 600; }

/* Hamburger + drawer */
.hamburger { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; align-items: center; justify-content: center; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm); }
.hamburger span { width: 20px; height: 2px; background: var(--ink-700); border-radius: 2px; transition: transform .25s, opacity .2s; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.drawer {
  position: fixed; top: var(--nav-h); right: 0; bottom: 0; width: min(82vw, 320px); z-index: 99;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--sh-lg);
  transform: translateX(100%); transition: transform .3s var(--ease); overflow-y: auto;
}
.drawer:not([hidden]) { display: block; }
.drawer.open { transform: translateX(0); }
.drawer__nav { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.drawer__nav a { padding: 13px 14px; border-radius: var(--r-sm); font-family: var(--font-display); font-weight: 600; color: var(--ink-700); }
.drawer__nav a:hover { background: var(--brand-50); }
.drawer__nav .btn { margin-top: 8px; }
.drawer__nav form { margin-top: 8px; }
.drawer-scrim { position: fixed; inset: 0; z-index: 98; background: rgba(17,32,58,.4); opacity: 0; transition: opacity .3s; }
.drawer-scrim.open { opacity: 1; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 24px; }
.card--pad-lg { padding: 32px; }
.card--hover { transition: transform .2s var(--ease), box-shadow .25s, border-color .2s; }
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--sh); border-color: var(--brand-200); }

.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .25s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.feature-card__icon { width: 54px; height: 54px; display: grid; place-items: center; font-size: 1.6rem; border-radius: var(--r); background: var(--brand-100); margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--ink-500); font-size: .96rem; }

/* Lesson card */
.lesson-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; transition: transform .2s var(--ease), box-shadow .25s, border-color .2s; }
.lesson-card:hover { transform: translateY(-4px); box-shadow: var(--sh); border-color: var(--brand-200); }
.lesson-card__body { padding: 20px 22px; flex: 1; display: flex; flex-direction: column; }
.lesson-card__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.lesson-card__num { font-family: var(--font-display); font-weight: 700; font-size: .78rem; color: var(--brand-600); background: var(--brand-100); width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); }
.lesson-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.lesson-card p { font-size: .9rem; color: var(--ink-500); margin-bottom: 16px; }
.lesson-card__foot { margin-top: auto; }

/* Stat tile */
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-sm); }
.stat-tile__val { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--brand-700); line-height: 1; }
.stat-tile__label { font-size: .86rem; color: var(--ink-500); margin-top: 6px; }
.stat-tile--gold .stat-tile__val { color: var(--gold-600); }

/* ---------- Chips, pills, badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: var(--r-full); background: var(--bg-soft); color: var(--ink-600, var(--ink-700)); border: 1px solid var(--line); }
.chip--brand { background: var(--brand-100); color: var(--brand-700); border-color: transparent; }
.chip--gold { background: var(--gold-50); color: var(--gold-600); border-color: var(--gold-100); }
.chip--easy { background: var(--success-bg); color: var(--success); border-color: transparent; }
.chip--medium { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.chip--hard { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; font-family: var(--font-display); padding: 4px 11px; border-radius: var(--r-full); }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill--completed { background: var(--success-bg); color: var(--success); }
.status-pill--in_progress { background: var(--info-bg); color: var(--brand-700); }
.status-pill--not_started { background: var(--bg-tint); color: var(--ink-400); }

.medal { font-family: var(--font-display); font-weight: 800; }
.medal--1 { color: var(--gold-600); }
.medal--2 { color: #8a99ad; }
.medal--3 { color: #b87333; }

/* Badge (gamification) */
.badge-card { text-align: center; padding: 20px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); transition: transform .2s; }
.badge-card.earned { background: linear-gradient(160deg, var(--gold-50), #fff); border-color: var(--gold-100); }
.badge-card.locked { opacity: .55; filter: grayscale(.5); }
.badge-card:hover { transform: translateY(-3px); }
.badge-card__icon { font-size: 2.4rem; line-height: 1; margin-bottom: 8px; }
.badge-card h4 { font-size: .92rem; }
.badge-card small { color: var(--ink-400); font-size: .76rem; }

/* ---------- Progress bar ---------- */
.progress { height: 9px; background: var(--bg-tint); border-radius: var(--r-full); overflow: hidden; }
.progress__bar { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); transition: width .5s var(--ease); }
.progress__bar--gold { background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); }
.progress--lg { height: 13px; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress { flex: 1; }
.progress-row__val { font-family: var(--font-display); font-weight: 700; font-size: .84rem; color: var(--ink-700); min-width: 38px; text-align: right; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 18px; }
.form-field label, .form-label { display: block; font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--ink-900); margin-bottom: 7px; }
.form-field input, .form-field select, .form-field textarea,
input.input, select.input, textarea.input,
.form-field input[type="text"], .form-field input[type="password"], .form-field input[type="email"], .form-field input[type="number"] {
  width: 100%; padding: 12px 15px; font-family: var(--font-body); font-size: .98rem; color: var(--ink-900);
  background: var(--bg-soft); border: 1.5px solid var(--line-strong); border-radius: var(--r); transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--brand-500); background: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field .helptext, .helptext { display: block; font-size: .8rem; color: var(--ink-400); margin-top: 6px; }
.form-field .errorlist, .errorlist { list-style: none; padding: 0; margin: 7px 0 0; color: var(--danger); font-size: .84rem; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: var(--danger); }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input[type="checkbox"], .check-row input[type="radio"] { width: 18px; height: 18px; accent-color: var(--brand-600); }

/* Auth layout */
.auth-wrap { display: grid; place-items: center; padding: 48px 20px; min-height: calc(100vh - var(--nav-h)); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: 38px; }
.auth-card__head { text-align: center; margin-bottom: 28px; }
.auth-card__head h1 { font-size: 1.7rem; }
.auth-card__head p { color: var(--ink-500); margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: .92rem; color: var(--ink-500); }

/* ---------- Toasts / messages ---------- */
.toast-stack { position: fixed; top: calc(var(--nav-h) + 14px); right: 18px; z-index: 150; display: flex; flex-direction: column; gap: 10px; max-width: min(92vw, 380px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: #fff; box-shadow: var(--sh-lg); border-left: 4px solid var(--brand-500); animation: toast-in .3s var(--ease); }
.toast span { flex: 1; font-size: .92rem; color: var(--ink-700); }
.toast__close { background: none; border: none; font-size: 1.3rem; color: var(--ink-300); line-height: 1; }
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--gold-500); }
.toast.hide { animation: toast-out .25s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Tables (leaderboard, reports) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; min-width: 480px; }
.table th, .table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { font-family: var(--font-display); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--brand-50); }
.table tr.is-me { background: var(--gold-50); }
.table tr.is-me:hover { background: var(--gold-100); }
.rank-cell { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }

/* ---------- Lesson content blocks ---------- */
.lesson-block { margin-bottom: 28px; }
.lb-text { font-size: 1.04rem; line-height: 1.8; color: var(--ink-700); }
.lb-text p { margin-bottom: 14px; }
.lb-formula { background: var(--brand-50); border: 1px solid var(--brand-100); border-left: 4px solid var(--brand-500); border-radius: var(--r); padding: 22px 24px; overflow-x: auto; font-size: 1.1rem; }
.lb-video { position: relative; padding-top: 56.25%; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh); background: #000; }
.lb-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lb-image img { border-radius: var(--r-lg); box-shadow: var(--sh-sm); margin-inline: auto; }
.lb-interactive { position: relative; padding-top: 70%; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.lb-interactive iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lb-caption { text-align: center; font-size: .85rem; color: var(--ink-400); margin-top: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--brand-50), #fff); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 30px 30px; mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}
.hero::after { content: ""; position: absolute; top: -160px; right: -120px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(46,117,182,.18), transparent 65%); z-index: 0; }
.hero__inner { position: relative; z-index: 1; padding-block: clamp(56px, 9vw, 110px); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--brand-600), var(--gold-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { font-size: 1.18rem; color: var(--ink-600, var(--ink-500)); max-width: 520px; margin-bottom: 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__art { position: relative; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: 26px; }
.hero-card__formula { background: var(--brand-50); border-radius: var(--r); padding: 18px; text-align: center; font-size: 1.3rem; margin-bottom: 16px; border: 1px dashed var(--brand-200); }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-strip__item { text-align: center; }
.stat-strip__num { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--brand-700); }
.stat-strip__num span { color: var(--gold-500); }
.stat-strip__label { font-size: .86rem; color: var(--ink-500); }

/* ---------- Dashboard ---------- */
.page { padding-block: clamp(28px, 5vw, 48px); }
.page__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.page__head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.page__sub { color: var(--ink-500); margin-top: 4px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .86rem; color: var(--ink-400); margin-bottom: 18px; }
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs span.sep { color: var(--ink-300); }

.split-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.sticky-side { position: sticky; top: calc(var(--nav-h) + 20px); }

.level-ring { display: flex; align-items: center; gap: 18px; }
.level-ring__badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold-500) calc(var(--p,0)*1%), var(--bg-tint) 0); position: relative; }
.level-ring__badge::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.level-ring__num { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 800; color: var(--gold-600); }

/* Empty state */
.empty { text-align: center; padding: 56px 24px; color: var(--ink-400); }
.empty__icon { font-size: 3rem; margin-bottom: 12px; }
.empty h3 { color: var(--ink-700); margin-bottom: 6px; }

/* Practice / quiz */
.quiz-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--sh-sm); margin-bottom: 20px; }
.quiz-q__num { font-family: var(--font-display); font-weight: 700; color: var(--brand-600); font-size: .82rem; }
.quiz-q__text { font-size: 1.1rem; color: var(--ink-900); margin: 8px 0 18px; }
.option { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r); margin-bottom: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--brand-300); background: var(--brand-50); }
.option input { accent-color: var(--brand-600); width: 18px; height: 18px; }
.option.correct { border-color: var(--success); background: var(--success-bg); }
.option.wrong { border-color: var(--danger); background: var(--danger-bg); }
.feedback { margin-top: 14px; padding: 13px 16px; border-radius: var(--r); font-size: .92rem; }
.feedback--ok { background: var(--success-bg); color: var(--success); }
.feedback--no { background: var(--danger-bg); color: var(--danger); }
.timer { font-family: var(--font-display); font-weight: 700; color: var(--brand-700); background: var(--brand-100); padding: 8px 16px; border-radius: var(--r-full); }

/* Result */
.result-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin-inline: auto; background: conic-gradient(var(--c, var(--brand-500)) calc(var(--p,0)*1%), var(--bg-tint) 0); position: relative; }
.result-ring::after { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.result-ring__val { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--ink-900); }

/* Docs (about) */
.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 720px; margin-inline: auto; }
.doc-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .25s, border-color .2s; }
.doc-card:hover { transform: translateY(-4px); box-shadow: var(--sh); border-color: var(--brand-200); }
.doc-card__top { position: relative; aspect-ratio: 16/11; overflow: hidden; display: grid; place-items: center; background: var(--bg-soft); }
.doc-card__thumb { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .4s var(--ease); }
.doc-card:hover .doc-card__thumb { transform: scale(1.05); }
.doc-card__filetype { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(150deg, #fdecea, #f9d2cc); }
.doc-card__filetype svg { filter: drop-shadow(0 10px 22px rgba(192, 57, 43, .22)); }
.doc-card__tag { position: absolute; top: 12px; right: 12px; font-family: var(--font-display); font-weight: 700; font-size: .72rem; letter-spacing: .04em; padding: 4px 11px; border-radius: var(--r-full); background: rgba(255, 255, 255, .92); color: var(--ink-700); box-shadow: var(--sh-xs); backdrop-filter: blur(4px); }
.doc-card__tag--pdf { background: var(--danger); color: #fff; }
.doc-card__body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.doc-card__head { display: flex; align-items: center; gap: 10px; }
.doc-card__head h4 { font-size: 1.02rem; line-height: 1.25; }
.doc-card__ic { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.doc-card__body p { font-size: .85rem; color: var(--ink-500); flex: 1; margin: 0; }
.doc-card__body .btn { align-self: flex-start; margin-top: 4px; }
@media (max-width: 560px) { .doc-grid { grid-template-columns: 1fr; max-width: 360px; } }

/* Team */
.team-card { text-align: center; padding: 26px 20px; }
.team-card .avatar { margin-inline: auto; margin-bottom: 14px; }
.team-card h4 { font-size: 1.02rem; }
.team-card small { color: var(--brand-600); font-weight: 600; }

/* ---------- Utilities ---------- */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; } .gap { gap: 16px; } .wrap { flex-wrap: wrap; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.text-center { text-align: center; } .text-muted { color: var(--ink-500); }
.text-sm { font-size: .88rem; } .text-lg { font-size: 1.1rem; }
.fw-700 { font-weight: 700; } .display { font-family: var(--font-display); }
.hide { display: none !important; }
.divider { height: 1px; background: var(--line); margin-block: 24px; border: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: var(--brand-50); }
.notif-item__icon { font-size: 1.3rem; }
.notif-item__time { font-size: .78rem; color: var(--ink-400); }

/* ---------- Footer ---------- */
.footer { background: var(--brand-900); color: rgba(255,255,255,.72); margin-top: auto; padding-top: 56px; }
.footer a { color: rgba(255,255,255,.72); }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.7fr 1fr 1.4fr 1.1fr; gap: 40px; padding-bottom: 44px; }
.footer__brand p { margin-top: 12px; font-size: .92rem; color: rgba(255,255,255,.7); max-width: 320px; }
.footer__muted { color: rgba(255,255,255,.5) !important; font-size: .85rem; margin-top: 10px; line-height: 1.5; }
.brand--footer, .brand--footer .brand__text { color: #fff; }
.brand--footer .brand__accent { color: var(--brand-300); }
.footer__col { display: flex; flex-direction: column; gap: 11px; }
.footer__col h4 { color: #fff; font-family: var(--font-display); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.footer__col a { font-size: .92rem; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .84rem; color: rgba(255,255,255,.5); }
.footer__dev { color: rgba(255,255,255,.55); }
.incode { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; color: var(--gold-400); }
.incode:hover { color: var(--gold-500); text-decoration: underline; }
@media (max-width: 880px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 480px; }
  .split-2 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .navbar__links { display: none; }
  .hamburger { display: flex; }
  .xp-chip, .navlink--manage { display: none; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
  .auth-card { padding: 28px 22px; }
  .page__head { align-items: flex-start; }
}
@media (max-width: 480px) {
  .grid--4 { grid-template-columns: 1fr; }
  .brand__text { font-size: 1.05rem; }
  .toast-stack { left: 12px; right: 12px; max-width: none; }
}

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

/* ---------- Manage panel ---------- */
.manage-layout { display: grid; grid-template-columns: 230px 1fr; gap: 28px; align-items: start; }
.manage-side { position: sticky; top: calc(var(--nav-h) + 20px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-sm); }
.manage-side__title { font-family: var(--font-display); font-weight: 800; color: var(--ink-900); padding: 6px 12px 12px; }
.manage-side nav { display: flex; flex-direction: column; gap: 2px; }
.manage-side nav a { padding: 10px 12px; border-radius: var(--r-sm); font-size: .92rem; font-weight: 600; color: var(--ink-700); }
.manage-side nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.manage-side nav a.active { background: var(--brand-700); color: #fff; }
.manage-main { min-width: 0; }
.manage-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.manage-head h1 { font-size: 1.6rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh-xs); }
.kpi__val { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; color: var(--brand-700); line-height: 1; }
.kpi__label { font-size: .82rem; color: var(--ink-500); margin-top: 6px; }
.kpi--warn .kpi__val { color: var(--gold-600); }
.kpi--danger .kpi__val { color: var(--danger); }
.block-form { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; background: var(--bg-soft); }
.block-form__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-family: var(--font-display); font-weight: 700; font-size: .85rem; color: var(--ink-500); }

@media (max-width: 880px) {
  .manage-layout { grid-template-columns: 1fr; }
  .manage-side { position: static; }
  .manage-side nav { flex-direction: row; flex-wrap: wrap; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Page-load reveal (yengil) */
.reveal { opacity: 0; transform: translateY(16px); animation: reveal .6s var(--ease) forwards; }
.reveal[style*="--d"] { animation-delay: calc(var(--d) * 1ms); }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
