/* ===========================================================================
   Bosh sahifa, auth, dashboard, resurslar, qidiruv, FAQ
   =========================================================================== */

/* --- Hero (sytle.txt §5) -------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--s-20) var(--s-24);
  background: linear-gradient(165deg, var(--brand-900) 0%, var(--brand-800) 45%, var(--violet-600) 100%);
  color: #fff;
}

.hero__bg {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  width: 620px;
  height: 620px;
  right: -180px;
  top: -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 65%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--s-12);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: var(--s-5);
}

.hero__title {
  font-size: clamp(2rem, 5vw, var(--fs-5xl));
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: var(--s-5);
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--cyan-300), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  font-size: var(--fs-lg);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  max-width: 52ch;
  margin-bottom: var(--s-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.hero .btn--primary {
  --btn-bg: #fff;
  --btn-fg: var(--brand-800);
}

.hero .btn--primary:hover {
  --btn-bg: var(--brand-50);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.hero .btn--secondary {
  --btn-bg: rgba(255, 255, 255, 0.08);
  --btn-fg: #fff;
  --btn-border: rgba(255, 255, 255, 0.28);
}

.hero .btn--secondary:hover {
  --btn-bg: rgba(255, 255, 255, 0.16);
}

.hero__visual {
  position: relative;
}

.hero__visual svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.28));
}

/* Molekulyar tarmoq - juda nozik animatsiya */
.molecule-pulse {
  animation: molecule-float 7s ease-in-out infinite;
  transform-origin: center;
}

@keyframes molecule-float {
  50% {
    transform: translateY(-9px);
  }
}

@media (max-width: 960px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--s-8);
  }

  .hero__visual {
    max-width: 380px;
    margin-inline: auto;
    order: -1;
  }

  .hero {
    padding-block: var(--s-12) var(--s-16);
  }
}

/* --- Bo'lim sarlavhasi ---------------------------------------------------- */

.section {
  padding-block: var(--s-20);
}

.section--tight {
  padding-block: var(--s-12);
}

.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 62ch;
  margin-bottom: var(--s-10);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head__eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: var(--s-2);
}

.section-head__title {
  font-size: clamp(var(--fs-xl), 3.2vw, var(--fs-3xl));
  margin-bottom: var(--s-3);
}

.section-head__lead {
  font-size: var(--fs-md);
  color: var(--text-muted);
  line-height: 1.7;
}

/* Statistika polosasi */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  padding: var(--s-6);
  margin-top: calc(-1 * var(--s-12));
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 720px) {
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
    margin-top: calc(-1 * var(--s-8));
  }
}

/* --- Auth sahifalari ------------------------------------------------------ */

.auth {
  display: grid;
  place-items: center;
  padding-block: var(--s-12) var(--s-20);
  min-height: calc(100vh - var(--header-h) - 200px);
}

.auth__card {
  width: 100%;
  max-width: 440px;
  padding: var(--s-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.auth__head {
  text-align: center;
  margin-bottom: var(--s-7);
}

.auth__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--s-4);
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-600), var(--violet-600));
  color: #fff;
}

.auth__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s-2);
}

.auth__lead {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.auth__foot {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* --- Dashboard (sytle.txt §14) -------------------------------------------- */

.dash-hero {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  padding: var(--s-8);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--brand-700), var(--violet-600));
  color: #fff;
  box-shadow: var(--shadow-brand);
  margin-bottom: var(--s-8);
}

.dash-hero__body {
  flex: 1;
  min-width: 0;
}

.dash-hero__eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--s-2);
}

.dash-hero__title {
  font-size: var(--fs-xl);
  color: #fff;
  margin-bottom: var(--s-2);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dash-hero__meta {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.75);
}

.dash-hero .btn {
  --btn-bg: #fff;
  --btn-fg: var(--brand-700);
  flex: none;
}

.dash-subject {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  padding: var(--s-6);
}

.dash-subject__body {
  flex: 1;
  min-width: 0;
}

.dash-subject__bars {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.dash-bar__head {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--s-1);
}

@media (max-width: 720px) {
  .dash-hero,
  .dash-subject {
    flex-direction: column;
    text-align: center;
    align-items: stretch;
  }

  .dash-subject .progress-ring {
    margin-inline: auto;
  }
}

/* --- Resurslar (sytle.txt §13) -------------------------------------------- */

.library {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: var(--s-8);
  align-items: start;
}

.library__nav {
  position: sticky;
  top: calc(var(--header-h-compact) + var(--s-5));
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.library-group + .library-group {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}

.library-group__title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--s-3);
}

.library-group ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.library-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 0.5rem 0.7rem;
  font-size: var(--fs-sm);
  color: var(--ink-600);
  border-radius: var(--radius-xs);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.library-link:hover {
  background: var(--surface-2);
  color: var(--ink-900);
}

.library-link.is-active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

.library-link__count {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

@media (max-width: 900px) {
  .library {
    grid-template-columns: 1fr;
  }

  .library__nav {
    position: static;
  }
}

/* --- Qidiruv overlay ------------------------------------------------------ */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding: 12vh var(--s-4) var(--s-8);
  animation: fade-in var(--dur-fast) var(--ease);
}

.search-overlay[hidden] {
  display: none;
}

.search-panel {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in var(--dur) var(--ease-out);
}

.search-panel__input {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}

.search-panel__input svg {
  width: 20px;
  height: 20px;
  color: var(--ink-400);
  flex: none;
}

.search-panel__input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--fs-md);
  background: transparent;
}

.search-results {
  max-height: min(56vh, 480px);
  overflow-y: auto;
  padding: var(--s-2);
}

.search-group__title {
  padding: var(--s-3) var(--s-3) var(--s-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-subtle);
}

.search-hit {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--radius-sm);
  color: var(--ink-700);
}

.search-hit:hover,
.search-hit.is-active {
  background: var(--brand-50);
  color: var(--brand-800);
}

.search-hit__icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--ink-500);
}

.search-hit__icon svg {
  width: 16px;
  height: 16px;
}

.search-hit__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.4;
}

.search-hit__meta {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-hit mark {
  background: var(--warning-bg);
  color: inherit;
  font-weight: 600;
  border-radius: 2px;
}

.search-panel__foot {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

/* --- FAQ ------------------------------------------------------------------ */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-width: var(--container-narrow);
  margin-inline: auto;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease);
}

.faq-item[open] {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-sm);
}

.faq-item__q {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-900);
  cursor: pointer;
  list-style: none;
}

.faq-item__q::-webkit-details-marker {
  display: none;
}

.faq-item__q::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: auto;
  flex: none;
  border-right: 2px solid var(--ink-400);
  border-bottom: 2px solid var(--ink-400);
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease);
}

.faq-item[open] .faq-item__q::after {
  transform: rotate(-135deg);
}

.faq-item__a {
  padding: 0 var(--s-5) var(--s-5);
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-muted);
}

/* --- Sertifikat ----------------------------------------------------------- */

.cert-verify {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
  padding: var(--s-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.cert-verify__seal {
  width: 76px;
  height: 76px;
  margin: 0 auto var(--s-5);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  border: 3px solid var(--success-border);
}

.cert-verify__code {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand-700);
  padding: var(--s-3) var(--s-5);
  background: var(--brand-50);
  border-radius: var(--radius);
  display: inline-block;
  margin-block: var(--s-4);
}

.cert-rows {
  text-align: left;
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}

.cert-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-2) 0;
  font-size: var(--fs-sm);
}

.cert-row dt {
  color: var(--text-subtle);
}

.cert-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink-800);
  text-align: right;
}
