/* ================================================================
   Avtomobil tuzilishi — asosiy uslublar

   Qoidalar:
   - Avval telefon ekrani, keyin kattaroq ekran (min-width).
   - Shriftlar saytning o'zidan beriladi (/fonts), tashqi xizmatga
     murojaat yo'q. Faqat ikki oila: sarlavhalar — Bricolage Grotesque,
     matn — Manrope. Raqamlar uchun tizimning monospace shrifti.
   - Hech qanday CSS kutubxonasi ulanmagan.

   Ko'rinish Claude Design maketidan olingan (2026-09-17, docs/dizayn.md):
   och qaymoq fon, deyarli qora matn, laym-yashil urg'u, qizg'ish-to'q
   sariq belgilar, katta yumaloq kartalar.
   ================================================================ */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-soft: #f9f8f5;
  --border: #e2ded7;
  --text: #0e1116;
  --text-muted: #5a6370;

  /* Asosiy rang — deyarli qora: to'q kartalar, faol tugmalar, raqamlar. */
  --primary: #0e1116;
  --primary-dark: #000000;
  --primary-soft: #ebe7e0;
  --on-primary: #f4f1ec;

  /* Urg'u — laym-yashil. Faqat fon sifatida, ustida qora matn. */
  --accent: #c8ff3d;
  --accent-hover: #d7ff6b;
  --accent-soft: #eefcc6;
  --accent-ink: #0e1116;

  /* Qizg'ish-to'q sariq: raqamlar, kichik sarlavhalar, havolalar. */
  --hot: #c73a0c;
  --hot-hover: #e0480f;
  --on-hot: #ffffff;
  --link: #b8330a;

  --ok: #15803d;
  --ok-soft: #e3f4e8;

  --header-bg: #f4f1ec;
  --header-text: #0e1116;
  --nav-bg: #f4f1ec;
  --nav-text: #3c4653;

  --danger: #b3261e;
  --danger-soft: #fdecea;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 12px 26px rgba(14, 17, 22, 0.05);
  --max-width: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #171c23;
    --surface-soft: #1d232b;
    --border: #2b323b;
    --text: #f4f1ec;
    --text-muted: #a3acb8;

    /* Qorong'ida "asosiy" rang ochiq tovushga o'tadi, ustidagi matn qora. */
    --primary: #f4f1ec;
    --primary-dark: #ffffff;
    --primary-soft: #232a33;
    --on-primary: #0e1116;

    --accent: #c8ff3d;
    --accent-hover: #d7ff6b;
    --accent-soft: #2a3313;
    --accent-ink: #0e1116;

    --hot: #ff7a4d;
    --hot-hover: #ff9670;
    --on-hot: #0e1116;
    --link: #ff8a5e;

    --ok: #4ade80;
    --ok-soft: #13291b;

    --header-bg: #0e1116;
    --header-text: #f4f1ec;
    --nav-bg: #0e1116;
    --nav-text: #c3cad3;

    --danger: #f2837b;
    --danger-soft: #3a201e;

    --shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
}

h1 { font-size: 1.85rem; letter-spacing: -0.035em; }
h2 { font-size: 1.3rem; }
h3 { font-weight: 700; }

::selection { background: var(--accent); color: var(--accent-ink); }

p { margin: 0 0 1rem; }

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--primary-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 48rem) {
  .container { padding: 0 1.75rem; }
}

.muted { color: var(--text-muted); }

/* --- Sarlavha paneli --------------------------------------------- */

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  color: var(--header-text);
}

.site-header .brand,
.site-header .user-name { color: var(--header-text); }

.site-header .brand small { color: var(--text-muted); }

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 12px;
  background: #0e1116;
  color: #c8ff3d;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
  .brand-mark { box-shadow: inset 0 0 0 1px #2b323b; }
}

.brand-mark-lg {
  width: 3rem;
  height: 3rem;
  font-size: 1.05rem;
  margin: 0 auto 0.75rem;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text small {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
}

.role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.site-header .role-badge {
  background: var(--primary);
  color: var(--accent);
  border-color: var(--primary);
}

@media (prefers-color-scheme: dark) {
  .site-header .role-badge { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
}

.logout-form { margin: 0; }

/* --- Tugmalar ---------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  /* Telefonda barmoq bilan bosish uchun yetarli balandlik. */
  min-height: 2.75rem;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }

.btn-dark {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-dark:hover { background: var(--primary-dark); color: var(--on-primary); }

.btn-hot {
  background: var(--hot);
  color: var(--on-hot);
}

.btn-hot:hover { background: var(--hot-hover); color: var(--on-hot); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text);
}

.btn-block {
  display: block;
  width: 100%;
}

:focus-visible {
  outline: 3px solid var(--hot);
  outline-offset: 2px;
}

/* --- Formalar ---------------------------------------------------- */

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  /* 16px dan kichik bo'lsa iPhone sahifani avtomatik kattalashtiradi. */
  font-size: 16px;
  min-height: 2.75rem;
}

.field input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent);
}

/* --- Xabarlar ---------------------------------------------------- */

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid currentColor;
}

.notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* --- Kirish sahifasi --------------------------------------------- */

.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 24px 50px rgba(14, 17, 22, 0.08);
  padding: 2rem 1.6rem;
}

.auth-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-head h1 { font-size: 1.6rem; }
.auth-head p { margin: 0; font-size: 0.85rem; }

.auth-note {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  text-align: center;
}

/* --- Sahifalar --------------------------------------------------- */

.page {
  flex: 1;
  padding-top: 1.75rem;
  padding-bottom: 2.5rem;
}

.page-center { text-align: center; }

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
  h1 { font-size: 2.4rem; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.card p { font-size: 0.875rem; color: var(--text-muted); }
.card p:last-child { margin-bottom: 0; }

.card-muted { opacity: 0.85; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.error-code {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0;
  line-height: 1;
}

.tech-details {
  margin-top: 2rem;
  text-align: left;
  font-size: 0.8rem;
}

.tech-details pre {
  overflow-x: auto;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --- Pastki panel ------------------------------------------------ */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.4rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.site-footer p { margin: 0; }


/* ================================================================
   2-bosqich: navigatsiya, jadvallar, formalar, mavzular
   ================================================================ */

/* --- Navigatsiya -------------------------------------------------- */

.main-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-inner {
  display: flex;
  gap: 0.2rem;
  white-space: nowrap;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.main-nav a {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--nav-text);
}

.main-nav a:hover {
  color: var(--text);
  background: var(--primary-soft);
  text-decoration: none;
}

.main-nav a.active {
  background: var(--primary);
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .main-nav a.active { background: var(--accent); color: var(--accent-ink); }
}

/* --- Sahifa sarlavhasi -------------------------------------------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-head h1 { margin-bottom: 0.25rem; }
.page-head p { margin-bottom: 0; }

.page-narrow { max-width: 44rem; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a { color: var(--hot); font-weight: 700; }

.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.center { text-align: center; }

/* --- Xabarlar ----------------------------------------------------- */

.alert-success {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid currentColor;
}

.alert-info {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid currentColor;
}

.flash-list { margin-bottom: 1rem; }

/* --- Bo'sh holat -------------------------------------------------- */

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
}

.empty p:last-child { margin-bottom: 0; }

/* --- Raqamlar paneli ---------------------------------------------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 40rem) {
  .stat-row { grid-template-columns: repeat(4, 1fr); }
}

.stat {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  text-align: center;
  color: inherit;
}

.stat:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--hot);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Jadval ------------------------------------------------------- */

/* Tor ekranda jadval o'zi siljiydi, sahifa emas. */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 40rem;
}

.table th,
.table td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg);
}

.table tbody tr:last-child td { border-bottom: none; }

.col-num { width: 3rem; text-align: center; }
.col-mid { width: 9rem; }
.col-actions { width: 1%; white-space: nowrap; }

.cell-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.row-blocked { opacity: 0.55; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.row-actions form { margin: 0; }

/* --- Belgilar ----------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-ok { background: var(--primary-soft); color: var(--primary-dark); }

.badge-off {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.chip {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
  margin-right: 0.25rem;
}

.chip-muted {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* --- Tugmalar (qo'shimcha turlari) -------------------------------- */

.btn-small {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  min-height: 2.25rem;
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--surface);
}

/* --- Formalar (qo'shimcha) ---------------------------------------- */

.field textarea,
.field select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}

.field textarea {
  min-height: 12rem;
  resize: vertical;
  line-height: 1.5;
}

.field select { min-height: 2.75rem; }

.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent);
}

.field-narrow input { max-width: 10rem; }

.field-check label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 0.9rem;
  cursor: pointer;
}

.field-check input { width: 1.1rem; height: 1.1rem; }

.field input[type="file"] {
  padding: 0.5rem;
  font-size: 0.85rem;
}

.hint {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-name {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 45rem) {
  .filters { grid-template-columns: 2fr 1fr 1fr auto; }
}

.filters .field { margin-bottom: 0; }

/* --- Panel (forma ostidagi qo'shimcha bo'lim) --------------------- */

.panel {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel h2 { font-size: 1rem; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* --- Mavzular ro'yxati -------------------------------------------- */

.topic-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 44rem) {
  .topic-list { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
}

.topic-item { display: flex; }

.topic-link {
  display: flex;
  flex: 1;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1.2rem 1.25rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.topic-link:hover {
  border-color: var(--primary);
  text-decoration: none;
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .topic-link, .topic-link:hover { transition: none; transform: none; }
}

.topic-number {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.4rem;
  border-radius: 12px;
  background: var(--primary);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

@media (prefers-color-scheme: dark) {
  .topic-number { background: var(--primary-soft); color: var(--accent); }
}

.topic-body { display: block; min-width: 0; }

.topic-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.topic-summary {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.topic-meta { display: block; margin-top: 0.4rem; }

.topic-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 1.25rem 0;
}

/* Nazariy material: oddiy matn, qator ko'chirishlari saqlanadi. */
.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

@media (min-width: 48rem) {
  .prose { padding: 2rem 2.25rem; }
}

.topic-pager {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 2rem;
}

/* --- Sahifalash --------------------------------------------------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.pager a {
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: grid;
  place-items: center;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text);
}

.pager a:hover { border-color: var(--primary); text-decoration: none; }

.pager a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}


/* ================================================================
   Mavzu matni ichidagi rasmlar
   ================================================================ */

/* Matn bo'laklari: qator ko'chirishlar saqlanadi. Bu ilgari .prose
   ustida edi, endi faqat matn qismiga tegishli — rasm elementi
   pre-wrap ichida qolib ketmasin. */
.prose-text {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.prose-text + .prose-text { margin-top: 0.9rem; }

.prose-figure {
  margin: 1.5rem 0;
  text-align: center;
}

.prose-figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;   /* sxemalar oq fonda chizilgan */
}

.prose-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}


/* ================================================================
   Taqdimot slaydlari
   ================================================================ */


.slide-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

/* Kengroq ekranda ikkitadan — 16:9 slayd bir ustunda juda katta
   bo'lib ketmasin. */
@media (min-width: 52rem) {
  .slide-list { grid-template-columns: repeat(2, 1fr); }
}

.slide {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.slide figcaption { font-family: var(--font-mono); }

.slide img {
  display: block;
  width: 100%;
  height: auto;
  /* Slaydlar oq fonda chizilgan — qorong'i rejimda ham oq qolsin. */
  background: #fff;
}

.slide figcaption {
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}


/* ================================================================
   Yig'iladigan taqdimot bo'limi
   ================================================================ */

.slides-panel {
  margin: 0.85rem 0 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.slides-panel > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.3rem;
  cursor: pointer;
  /* Brauzerning standart uchburchagi o'rniga o'z belgimiz. */
  list-style: none;
  user-select: none;
}

/* Safari uchun */
.slides-panel > summary::-webkit-details-marker {
  display: none;
}

/* Chapdagi belgi: yopiqda o'ngga, ochiqda pastga qaraydi. */
.slides-panel > summary::before {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--hot);
  border-bottom: 2px solid var(--hot);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.slides-panel[open] > summary::before {
  transform: rotate(45deg);
}

.slides-panel > summary:hover {
  background: var(--primary-soft);
}

.slides-panel > summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.slides-panel-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.slides-panel-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hot);
  white-space: nowrap;
}

/* Slaydlar ro'yxati panel ichida */
.slides-panel .slide-list {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}


/* ================================================================
   3-bosqich: testlar
   ================================================================ */

/* --- Test paytidagi yuqori panel ---------------------------------- */

.quiz-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.quiz-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.quiz-bar-title strong { display: block; font-size: 0.9rem; }
.quiz-bar-title .muted { font-size: 0.75rem; }

.quiz-timer {
  text-align: right;
  flex-shrink: 0;
}

.quiz-timer-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.quiz-timer-value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--hot);
}

.quiz-timer.low .quiz-timer-value { color: var(--danger); }

.quiz-progress {
  height: 5px;
  background: var(--border);
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #d93c0c, #ff8a3d);
  transition: width 0.2s ease;
}

/* --- Savol ------------------------------------------------------- */

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 24px 50px rgba(14, 17, 22, 0.08);
}

@media (min-width: 48rem) {
  .question-card { padding: 2.25rem 2.5rem; }
}

.question-number {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.question-text {
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

@media (min-width: 48rem) {
  .question-text { font-size: 1.85rem; }
}

.question-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.option-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
  cursor: pointer;
  font-weight: 600;
  /* Barmoq bilan bosish uchun yetarli baland. */
  min-height: 3.4rem;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.option:hover { border-color: var(--primary); }

.option input {
  accent-color: var(--primary);
  margin: 0;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: var(--accent-soft);
}

.option-letter {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 11px;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.option:has(input:checked) .option-letter {
  background: var(--accent);
  color: var(--accent-ink);
}

.option-text { flex: 1; }

.question-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

/* --- Savollar bo'yicha o'tish ------------------------------------ */

.quiz-nav {
  margin: 1.5rem 0;
}

.quiz-nav-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.quiz-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.quiz-nav-item {
  display: grid;
  place-items: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-family: var(--font-mono);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.quiz-nav-item:hover { text-decoration: none; border-color: var(--primary); }

.quiz-nav-item.answered {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.quiz-nav-item.current {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .quiz-nav-item.current { color: var(--on-primary); }
}

.quiz-finish-link {
  text-align: center;
  font-size: 0.9rem;
}

/* --- Test kirish sahifasi ---------------------------------------- */

.quiz-rules {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.quiz-rules h2 { font-size: 1rem; }

.rule-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 0 0 1rem;
}

@media (min-width: 34rem) {
  .rule-list { grid-template-columns: repeat(4, 1fr); }
}

.rule-list dt {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rule-list dd {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hot);
}

.rule-notes {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rule-notes li { margin-bottom: 0.3rem; }

.quiz-start {
  background: var(--primary);
  color: var(--on-primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.quiz-history { margin-top: 2rem; }
.quiz-history h2 { font-size: 1rem; }

.badge-fail {
  background: var(--danger-soft);
  color: var(--danger);
}

/* --- Natija ------------------------------------------------------ */

.result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 1.5rem;
  border-radius: 28px;
  background: #0e1116;
  color: #f4f1ec;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .result-summary { background: var(--surface); border: 1px solid var(--border); }
}

.result-score-value {
  display: block;
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.result-summary.passed .result-score-value { color: #c8ff3d; }
.result-summary.failed .result-score-value { color: #ff8a5e; }

.result-score-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(244, 241, 236, 0.65);
  margin-top: 0.4rem;
}

.result-verdict p { color: rgba(244, 241, 236, 0.8); }

.result-verdict strong { font-size: 1.05rem; }
.result-verdict p { margin: 0.25rem 0 0; font-size: 0.85rem; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}



/* --- Javoblar tahlili -------------------------------------------- */

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.2rem 1.3rem;
}

.review-item.correct { border-left-color: var(--ok); }
.review-item.wrong { border-left-color: var(--danger); }

.review-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.review-number {
  font-weight: 700;
  color: var(--text-muted);
}

.review-question {
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.review-options {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.review-option {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.review-option.is-correct {
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
}

.review-option.is-chosen:not(.is-correct) {
  background: var(--danger-soft);
  color: var(--danger);
}

.review-mark {
  width: 1rem;
  flex-shrink: 0;
  font-weight: 700;
}

.review-option-text { flex: 1; }

.review-tag {
  font-size: 0.7rem;
  opacity: 0.75;
  white-space: nowrap;
}

.review-explanation {
  font-size: 0.88rem;
  padding: 0.2rem 0 0.2rem 0.9rem;
  border-left: 3px solid var(--accent);
}

/* --- Savollar banki (admin) -------------------------------------- */

.bank-status {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  border: 1px solid currentColor;
}

.bank-status.ok { background: var(--primary-soft); color: var(--primary-dark); }
.bank-status.low { background: var(--danger-soft); color: var(--danger); }
.bank-status .hint { color: inherit; opacity: 0.85; }

.question-bank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.bank-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.bank-item.inactive { opacity: 0.6; }

.bank-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.bank-item-text {
  font-weight: 600;
  margin: 0;
  flex: 1 1 20rem;
}

.bank-item-badges { flex-shrink: 0; }

.bank-options {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  font-size: 0.875rem;
}

.bank-options li {
  display: flex;
  gap: 0.5rem;
  padding: 0.2rem 0;
  color: var(--text-muted);
}

.bank-options li.is-correct {
  color: var(--primary-dark);
  font-weight: 600;
}

.bank-explanation {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* --- Savol formasi ----------------------------------------------- */

.options-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.options-editor legend {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0 0.4rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.option-correct {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.option-correct input { width: 1.15rem; height: 1.15rem; }

.option-row input[type="text"] {
  flex: 1;
  min-height: 2.5rem;
}


/* --- Tinglovchi progressi ---------------------------------------- */

.progress-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.75rem;
}

.progress-numbers {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.progress-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--hot);
}

.progress-label { font-size: 0.85rem; color: var(--text-muted); }

.progress-track {
  height: 12px;
  background: var(--primary-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d93c0c, #ff8a3d);
  border-radius: 999px;
}

.topic-number.done {
  background: var(--accent);
  color: var(--accent-ink);
}

.final-exam { margin-top: 2rem; }
.final-exam h2 { font-size: 1.05rem; }

.topic-quiz {
  margin: 2rem 0;
  padding: 1.6rem 1.4rem;
  background: #0e1116;
  color: #f4f1ec;
  border-radius: 26px;
}

@media (prefers-color-scheme: dark) {
  .topic-quiz { background: var(--surface); border: 1px solid var(--border); }
}

@media (min-width: 48rem) {
  .topic-quiz { padding: 2.25rem 2.5rem; }
}

.topic-quiz h2 { font-size: 1.7rem; }
.topic-quiz .muted { color: rgba(244, 241, 236, 0.7); }
.topic-quiz a:not(.btn) { color: #c8ff3d; }

.chip-warn {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ================================================================
   Diagrammalar va hisobot bloklari (4-bosqich)

   Diagramma — server yasagan SVG. Ranglar shu yerda beriladi, ya'ni
   qorong'i rejimga o'tganda diagramma ham o'zgaradi.
   ================================================================ */

.chart-block { margin: 2rem 0; }

.chart-note {
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.chart {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
}

.chart-track { fill: var(--border); }
.chart-bar   { fill: var(--hot); }

.chart-bar-muted {
  fill: var(--text-muted);
  opacity: 0.3;
}

.chart-label,
.chart-value {
  font-family: inherit;
  font-size: 11px;
}

.chart-label { fill: var(--text-muted); }
.chart-value { fill: var(--text); }

/* --- Halqa diagramma --- */

.donut {
  width: 5.5rem;
  height: 5.5rem;
  flex: none;
}

.donut-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.donut-value {
  fill: none;
  stroke: var(--hot);
  stroke-width: 10;
  stroke-linecap: round;
}

.donut-num {
  font-family: inherit;
  font-size: 26px;
  font-weight: 700;
  fill: var(--text);
}

.donut-den {
  font-family: inherit;
  font-size: 14px;
  fill: var(--text-muted);
}

.chart-donut-block {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.chart-donut-block p:last-child { margin-bottom: 0; }

/* ================================================================
   Sertifikat (5-bosqich)
   ================================================================ */

.cert-card { text-align: center; }

.cert-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.cert-valid .cert-badge { background: var(--accent); color: var(--accent-ink); }
.cert-revoked .cert-badge { background: var(--danger-soft); color: var(--danger); }
.cert-revoked { border-color: var(--danger); }

.cert-number {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.cert-facts {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
  text-align: left;
}

.cert-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.cert-facts dt { color: var(--text-muted); }
.cert-facts dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

.cert-steps { padding-left: 1.25rem; }
.cert-steps li { margin-bottom: 0.4rem; color: var(--text-muted); }
.cert-steps li.done { color: var(--text); }
.cert-steps li.done::marker { content: "✓  "; color: var(--ok); }
.cert-steps li.current { color: var(--text); font-weight: 600; }

.cert-preview {
  max-width: 12rem;
  max-height: 6rem;
  padding: 0.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
}

.cert-card { margin-bottom: 1.5rem; }

.cert-card .lead {
  color: var(--text);
  font-weight: 600;
  font-size: 1.15rem;
}

/* ================================================================
   Video darslar (6-bosqich)
   ================================================================ */

.video-list {
  display: grid;
  gap: 1.25rem;
  padding: 0.75rem 0;
}

.video-item { margin: 0; }

.video-item video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  background: #000;
  border-radius: 6px;
}

.video-item figcaption {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

.video-hint { margin: 0; }

.video-admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.video-admin-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.video-admin-item p { margin-bottom: 0.4rem; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.inline-form input[type="text"],
.inline-form select {
  flex: 1 1 12rem;
  min-width: 0;
}

/* ================================================================
   AI Ustoz (6-bosqich)
   ================================================================ */

.ai-conversation-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ai-conversation-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.ai-title { font-size: 1.25rem; }

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }

.ai-bubble {
  max-width: 92%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  overflow-wrap: anywhere;
}

.ai-msg-user .ai-bubble {
  background: var(--primary);
  color: var(--on-primary);
  white-space: pre-wrap;
  border-bottom-right-radius: 4px;
}

.ai-msg-assistant .ai-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.ai-answer p { margin: 0 0 0.6rem; }
.ai-answer ul, .ai-answer ol { margin: 0 0 0.6rem; padding-left: 1.25rem; }
.ai-answer code {
  padding: 0 0.25rem;
  border-radius: 4px;
  background: var(--primary-soft);
  font-size: 0.9em;
}

/* Uzun formula ekrandan chiqib ketmasin — o'z ichida suriladi */
.ai-answer .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

.ai-disclaimer {
  margin: 0.4rem 0 0;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================================================================
   Tanishtiruv (bosh) sahifa

   Kirishsiz ochiladigan yagona katta sahifa, Claude Design maketi
   asosida. Avval telefon ekrani uchun yozilgan. JavaScript faqat
   bir nechta rasm bo'lganda (almashtirish uchun) ulanadi; «bosib
   ko'ring» sxemasi CSS bilan ishlaydi.
   ================================================================ */

.landing-body { background: var(--bg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.landing-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 5;
}

.landing-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.7rem;
  flex-wrap: wrap;
}

.landing-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.landing-actions .btn { white-space: nowrap; }

/* Tor telefonda sarlavha ikki qatorga tushmasin: institut nomi va «Kirish»
   yashiriladi — kirish havolasi hero ichida «Hisobim bor» bo'lib turibdi. */
@media (max-width: 30rem) {
  .landing-header .brand small,
  .landing-actions .btn-ghost { display: none; }
  .landing-header-inner { flex-wrap: nowrap; }
}

.btn-big { padding: 0.85rem 1.6rem; font-size: 1rem; }

/* To'q fon ustidagi shaffof tugma */
.btn-glass {
  background: rgba(244, 241, 236, 0.12);
  border-color: rgba(244, 241, 236, 0.32);
  color: #f4f1ec;
}

.btn-glass:hover { background: rgba(244, 241, 236, 0.22); color: #f4f1ec; }

.pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.pill-accent { background: #c8ff3d; color: #0e1116; }
.pill-glass { background: rgba(244, 241, 236, 0.14); color: #f4f1ec; }

.pill-line {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
}

.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--hot);
}

.kicker-dark {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #0e1116;
  color: #c8ff3d;
}

/* --- Hero --- */

.hero-wrap { padding: 0.75rem 0.75rem 0; }

.hero {
  position: relative;
  max-width: 84rem;
  min-height: 27rem;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(ellipse at 75% 110%, rgba(200, 255, 61, 0.18), rgba(14, 17, 22, 0) 60%), #0e1116;
  color: #f4f1ec;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Rasm bo'lmaganda — avtomobil chizmasi yuqorida, matn pastda.
   To'q kuzov to'q fonda ko'rinishi uchun orqasida yorug' dog'. */
.hero:not(.has-photo)::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -10%;
  width: 90%;
  height: 70%;
  background: radial-gradient(ellipse at 50% 50%, rgba(244, 241, 236, 0.12), rgba(244, 241, 236, 0) 65%);
  pointer-events: none;
}

.hero-car {
  position: absolute;
  top: 1.2rem;
  right: -8%;
  width: 90%;
  max-width: 44rem;
  height: auto;
  opacity: 0.9;
}

.hero .hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.hero .hero-slide.is-active { opacity: 1; }

/* Fotosurat ustidagi matn o'qilishi uchun qoraytirish. */
.hero.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(190deg, rgba(14, 17, 22, 0.6) 0%, rgba(14, 17, 22, 0.2) 34%, rgba(14, 17, 22, 0.9) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 11rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.hero.has-photo .hero-content { padding-top: 6rem; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; }

.hero h1 {
  margin: 0;
  max-width: 15ch;
  color: #f4f1ec;
  font-size: 2.35rem;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero h1 .hl { color: #c8ff3d; }

.hero-bottom { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: flex-end; }

.hero-lead {
  margin: 0;
  max-width: 42ch;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(244, 241, 236, 0.82);
}

.hero-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }

.hero-dots { display: flex; gap: 0.2rem; }

/* Nuqta kichik ko'rinadi, lekin bosiladigan maydon barmoqqa yetarli. */
.hero-dots button {
  width: 1.9rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.hero-dots button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.2rem;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.28rem;
  border-radius: 999px;
  background: rgba(244, 241, 236, 0.45);
  transition: width 0.3s ease, background 0.3s ease;
}

.hero-dots button[aria-current="true"]::after {
  width: 1.5rem;
  background: #c8ff3d;
}

/* --- Yuguruvchi qator --- */

.marquee {
  overflow: hidden;
  margin-top: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-right: 1.4rem;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.marquee-star { color: var(--hot); }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --- Bo'limlar --- */

.band { padding-block: 2.5rem; }
.band-tight { padding-top: 0; }
.band-last { padding-top: 0; padding-bottom: 3.5rem; }

/* Yopishqoq sarlavha bo'lim boshini yopib qo'ymasin. */
.landing-body section[id] { scroll-margin-top: 5rem; }

.band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.4rem;
}

.band-title {
  font-size: 1.75rem;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0.8rem 0 1.1rem;
}

.band-head .band-title { margin-bottom: 0; }

.band-lead {
  margin: 0;
  max-width: 34ch;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* --- «Bosib ko'ring» sxemasi --- */

.systems { display: grid; gap: 1rem; }

.sys-radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.systems-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 15rem;
  padding: 1.5rem 1rem;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(244, 241, 236, 0.1), rgba(244, 241, 236, 0) 60%),
    radial-gradient(ellipse at 55% 95%, rgba(200, 255, 61, 0.16), rgba(11, 15, 20, 0) 65%),
    linear-gradient(160deg, #151b23, #0b0f14);
}

.systems-car { position: relative; width: 100%; max-width: 40rem; }
.systems-car img { display: block; width: 100%; height: auto; }

.hotspot {
  position: absolute;
  width: 2.2rem;
  height: 2.2rem;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.hotspot::before {
  content: "";
  position: absolute;
  inset: 0.2rem;
  border-radius: 50%;
  background: #f4f1ec;
  animation: hotspot-pulse 2.4s ease-out infinite;
}

.hotspot-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: #f4f1ec;
  color: #0e1116;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

@keyframes hotspot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.7); opacity: 0; }
}

.hs-1 { left: 21%; top: 57%; }
.hs-2 { left: 47%; top: 71%; }
.hs-3 { left: 33%; top: 74%; }
.hs-4 { left: 79%; top: 74%; }
.hs-5 { left: 41%; top: 45%; }
.hs-6 { left: 29%; top: 44%; }

.sys-panel {
  display: none;
  flex-direction: column;
  padding: 1.4rem 1.3rem 1.5rem;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 44px rgba(14, 17, 22, 0.07);
}

.sys-panel h3 { font-size: 1.7rem; letter-spacing: -0.03em; margin: 0.6rem 0 0.7rem; }
.sys-panel p { color: var(--text-muted); line-height: 1.7; }
.sys-facts { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.sys-panel .btn { align-self: flex-start; margin-top: auto; }

/* Tanlangan tizim: o'z kartasi ko'rinadi, o'z nuqtasi yashil bo'ladi. */
#tizim-1:checked ~ .systems-panels .sys-panel:nth-child(1),
#tizim-2:checked ~ .systems-panels .sys-panel:nth-child(2),
#tizim-3:checked ~ .systems-panels .sys-panel:nth-child(3),
#tizim-4:checked ~ .systems-panels .sys-panel:nth-child(4),
#tizim-5:checked ~ .systems-panels .sys-panel:nth-child(5),
#tizim-6:checked ~ .systems-panels .sys-panel:nth-child(6) { display: flex; }

#tizim-1:checked ~ .systems-stage .hs-1 .hotspot-core,
#tizim-2:checked ~ .systems-stage .hs-2 .hotspot-core,
#tizim-3:checked ~ .systems-stage .hs-3 .hotspot-core,
#tizim-4:checked ~ .systems-stage .hs-4 .hotspot-core,
#tizim-5:checked ~ .systems-stage .hs-5 .hotspot-core,
#tizim-6:checked ~ .systems-stage .hs-6 .hotspot-core {
  background: #c8ff3d;
  box-shadow: 0 0 0 4px rgba(200, 255, 61, 0.3);
}

#tizim-1:checked ~ .systems-stage .hs-1::before,
#tizim-2:checked ~ .systems-stage .hs-2::before,
#tizim-3:checked ~ .systems-stage .hs-3::before,
#tizim-4:checked ~ .systems-stage .hs-4::before,
#tizim-5:checked ~ .systems-stage .hs-5::before,
#tizim-6:checked ~ .systems-stage .hs-6::before { background: #c8ff3d; }

/* Klaviatura bilan tanlanganda nuqta ko'rinib tursin. */
#tizim-1:focus-visible ~ .systems-stage .hs-1 .hotspot-core,
#tizim-2:focus-visible ~ .systems-stage .hs-2 .hotspot-core,
#tizim-3:focus-visible ~ .systems-stage .hs-3 .hotspot-core,
#tizim-4:focus-visible ~ .systems-stage .hs-4 .hotspot-core,
#tizim-5:focus-visible ~ .systems-stage .hs-5 .hotspot-core,
#tizim-6:focus-visible ~ .systems-stage .hs-6 .hotspot-core {
  outline: 3px solid #ff8a5e;
  outline-offset: 3px;
}

/* --- «Qanday o'qiladi» kartalari --- */

.how-grid { display: grid; gap: 0.85rem; }

.how-card {
  padding: 1.5rem 1.4rem 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.how-card h3 { font-size: 1.25rem; letter-spacing: -0.02em; margin: 0.8rem 0 0.5rem; }
.how-card p { margin: 0; color: var(--text-muted); font-size: 0.93rem; line-height: 1.65; }

.how-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hot);
}

.how-card-accent { background: #c8ff3d; border-color: #c8ff3d; color: #0e1116; }
.how-card-accent p { color: #1d2530; }
.how-card-accent .how-num { color: #0e1116; }

/* --- Kurs dasturi va mustaqil ta'lim --- */

.program {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.program li,
.materials-home a {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.program-num {
  flex: 0 0 2.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  color: var(--hot);
}

.materials-home { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 0.6rem; }
.materials-home a:hover { border-color: var(--text); text-decoration: none; }
.materials-note { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* --- Sertifikat --- */

.cert-band { display: grid; gap: 1rem; }
.cert-info .band-title { margin-top: 0.6rem; }
.cert-info p { color: var(--text-muted); }

.cert-check {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.4rem;
  align-self: start;
}

.cert-check h3 { font-size: 1.25rem; margin: 0 0 0.35rem; }
.cert-check p { color: var(--text-muted); }

.cert-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.cert-form input {
  flex: 1 1 10rem;
  min-width: 0;
  min-height: 2.9rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

/* --- Yakuniy chaqiruv --- */

.cta {
  display: grid;
  gap: 1.25rem;
  align-items: end;
  padding: 1.75rem 1.4rem;
  border-radius: 26px;
  background: radial-gradient(ellipse at 90% 120%, rgba(200, 255, 61, 0.22), rgba(14, 17, 22, 0) 55%), #0e1116;
  color: #f4f1ec;
}

.cta h2 { margin: 0; color: #f4f1ec; font-size: 1.9rem; line-height: 1.02; letter-spacing: -0.035em; }
.cta p { margin: 0.7rem 0 0; color: rgba(244, 241, 236, 0.8); }
.cta-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}

.auth-tagline {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

@media (min-width: 40rem) {
  .hero-wrap { padding: 1rem 1.25rem 0; }
  .hero { border-radius: 30px; min-height: 30rem; }
  .hero-content { padding: 13rem 2.25rem 2.25rem; }
  .hero h1 { font-size: 3.4rem; }
  .how-grid { grid-template-columns: repeat(3, 1fr); }
  .program, .materials-home { grid-template-columns: repeat(2, 1fr); }
  .band-title { font-size: 2.3rem; }
  .cta { grid-template-columns: 1fr auto; padding: 2.5rem 2.25rem; }
  .cta h2 { font-size: 2.5rem; }
}

@media (min-width: 60rem) {
  .hero { border-radius: 34px; min-height: 34rem; }
  .hero-car { top: 1.5rem; right: 3%; width: 56%; }
  .hero-content { padding: 3.25rem; min-height: 34rem; justify-content: flex-end; }
  .hero h1 { font-size: 4.25rem; }
  .band { padding-block: 4rem; }
  .band-tight, .band-last { padding-top: 0; }
  .band-title { font-size: 2.75rem; }
  .systems {
    grid-template-columns: 1.1fr 1fr;
    gap: 1.6rem;
    align-items: stretch;
  }
  .systems-stage { padding: 1.5rem; min-height: 22rem; }
  .hotspot { width: 2.6rem; height: 2.6rem; }
  .hotspot-core { width: 1.65rem; height: 1.65rem; }
  .sys-panel { padding: 2rem 2.1rem; height: 100%; }
  .sys-panel h3 { font-size: 2.3rem; }
  .cert-band { grid-template-columns: 1.3fr 1fr; gap: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .hotspot::before { animation: none; }
  .hero .hero-slide, .hero-dots button::after { transition: none; }
}

/* --- Ro'yxatdan o'tish: rol tanlash ------------------------------ */

.role-choice {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem 0.5rem;
  margin: 0 0 1rem;
}

.role-choice legend {
  font-weight: 600;
  padding: 0 0.3rem;
}

/* .field label va .field input umumiy uslublari (blok, 100% kenglik,
   balandlik) radio tugmaga to'g'ri kelmaydi — shu yerda bekor qilinadi. */
.field .choice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 400;
}

.field .choice input[type="radio"] {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  margin: 0.2rem 0 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--hot);
}

/* Tanlangan rolga qarab maydonlar ko'rinadi. JavaScript kerak emas:
   :has() eski brauzerda ishlamasa, hamma maydon ko'rinib qoladi —
   forma baribir to'g'ri ishlaydi, chunki tekshiruv serverda. */
.role-teacher-note { display: none; }
form:has(input[name="role"][value="teacher"]:checked) .role-teacher-note { display: block; }
form:has(input[name="role"][value="teacher"]:checked) .student-only { display: none; }


/* ================================================================
   Mustaqil ta'lim
   ================================================================ */

.topic-number.material-code { width: auto; min-width: 2rem; padding: 0 0.35rem; }

/* Slaydlar bitta ustunda, ketma-ket o'qiladi. */
.material-slides {
  display: grid;
  gap: 1rem;
  max-width: 60rem;
}

/* To'q bloklar ichidagi yordamchi matn fon rangiga moslashadi. */
.quiz-start .muted,
.result-summary .muted { color: inherit; }

/* --- Mavzu va material sahifasining sarlavhasi (to'q karta) --------- */

.lesson-head {
  position: relative;
  margin-bottom: 0.85rem;
  padding: 1.6rem 1.4rem;
  border-radius: 26px;
  overflow: hidden;
  background: radial-gradient(ellipse at 95% 120%, rgba(200, 255, 61, 0.2), rgba(14, 17, 22, 0) 55%), #0e1116;
  color: #f4f1ec;
}

.lesson-head h1 { color: #f4f1ec; margin: 0.8rem 0 0; max-width: 24ch; }
.lesson-head .lead { color: rgba(244, 241, 236, 0.78); margin: 0.9rem 0 0; max-width: 52ch; }
.lesson-head .topic-resources { margin: 1.3rem 0 0; }

@media (prefers-color-scheme: dark) {
  .lesson-head { background: radial-gradient(ellipse at 95% 120%, rgba(200, 255, 61, 0.14), rgba(14, 17, 22, 0) 55%), var(--surface); border: 1px solid var(--border); }
}

@media (min-width: 48rem) {
  .lesson-head { padding: 2.6rem 2.8rem; }
}

.kicker-accent { color: #c8ff3d; }

/* Uzun matn o'qilishi uchun qator juda uzun bo'lmasin. */
.prose { max-width: 56rem; }
