/* ============================================================
   ai.topsmm.uz — landing sahifasi dizayn tizimi.
   BITTA manba — barcha ranglar :root token sifatida, light/dark
   ikkalasi ham to'liq belgilangan (prefers-color-scheme). Tailwind
   build bosqichiga bog'liq EMAS — sof CSS, hech qanday build kerak
   emas, to'g'ridan-to'g'ri <link> bilan ulanadi.
   ============================================================ */

:root {
  /* ---- Rang: LIGHT (default) ---- */
  --brand: #2563eb;          /* mavjud asosiy ko'k — saqlangan */
  --brand-dark: #1d4ed8;
  --brand-soft: #eef2ff;
  --amber: #f59e0b;          /* iliq accent — CTA/urg'u */
  --amber-dark: #d97706;

  --bg: #fafafa;
  --bg-alt: #f3f4f6;
  --surface: #ffffff;
  --ink: #0a0a0b;
  --ink-2: #3f434c;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);

  --font-head: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(.22, .68, 0, 1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b;
    --bg-alt: #131417;
    --surface: #17181c;
    --ink: #fafafa;
    --ink-2: #cbced4;
    --ink-3: #8b8f99;
    --line: #26282e;
    --line-2: #34363d;
    --brand-soft: rgba(37, 99, 235, .16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
@media (max-width: 720px) { .section { padding: 56px 0; } }

.eyebrow {
  font-size: 13px; font-weight: 700; color: var(--brand);
  letter-spacing: .04em; text-transform: uppercase; margin: 0 0 10px;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.section-head p { color: var(--ink-3); font-size: 16px; margin: 12px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .15s, border-color .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(37,99,235,.28); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s, padding .25s;
}
.nav.is-scrolled { border-color: var(--line); box-shadow: var(--shadow-sm); }
.nav-inner { display: flex; align-items: center; gap: 24px; padding: 18px 0; transition: padding .25s; }
.nav.is-scrolled .nav-inner { padding: 12px 0; }
.nav-logo { font-family: var(--font-head); font-weight: 800; font-size: 18px; text-decoration: none; color: var(--ink); }
.nav-links { display: flex; gap: 4px; margin: 0 auto; }
.nav-links a {
  font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none;
  padding: 8px 12px; border-radius: 8px; transition: background-color .15s, color .15s;
}
.nav-links a:hover { background: var(--bg-alt); color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { position: relative; }
.lang-switch button {
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-2);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 6px; display: none; min-width: 120px;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu button {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
}
.lang-menu button:hover { background: var(--bg-alt); color: var(--ink); }
.nav-login { font-size: 14px; font-weight: 700; text-decoration: none; color: var(--ink-2); padding: 8px 6px; white-space: nowrap; }
.nav-login:hover { color: var(--ink); }
@media (max-width: 860px) { .nav-links { display: none; } }
/* Tor ekranlarda (mobil) nav'dagi 4 element (logo, til, Kirish, CTA) siqilib, tugma 2 qatorga
   bo'linib qolmasligi uchun — bo'shliq va o'lcham qisqartiriladi, "Kirish" so'zi kichik ikonga
   almashtiriladi (havola O'ZGARMAYDI, faqat ko'rinishi). */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .nav-inner { gap: 10px; }
  .nav-actions { gap: 8px; }
  .nav-logo { font-size: 15px; }
  .lang-switch button { padding: 6px 9px; font-size: 12px; }
  .nav-login { padding: 8px 2px; font-size: 13px; }
  .nav-actions .btn { padding: 9px 14px; font-size: 13px; }
}

/* ============================================================
   HERO + AGENT ROLLARI — ikkalasi bitta 2-ustunli maydon,
   o'ng ustun (demo) `position: sticky` — role kartalari
   bosilganda demo shu yerda, ko'z oldida yangilanadi.
   ============================================================ */
/* Grid-areas — demo (o'ng ustun) HERO va ROL kartochkalarining IKKALASI balandligicha
   sticky bo'lib qoladi (desktop). Mobilda esa aniq tartib kerak: sarlavha -> DEMO -> rol
   kartochkalari ("hero ostida" spesifikatsiyasi — rol kartochkalaridan OLDIN, ko'p
   scroll qilmasdan ko'rinishi kerak) — shuning uchun DOM tartibiga emas, aniq
   grid-template-areas'ga tayaniladi. */
.hero-wrap {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  grid-template-areas: "intro demo" "roles demo";
  gap: 40px 56px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 72px;
}
.hero-intro { grid-area: intro; padding-top: 12px; }
.hero-roles { grid-area: roles; }
.hero-right { grid-area: demo; position: sticky; top: 96px; }
@media (max-width: 980px) {
  .hero-wrap {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "demo" "roles";
    gap: 32px;
  }
  .hero-right { position: static; }
}

.hero-intro h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.08; }
.hero-intro h1 .accent { color: var(--brand); }
.hero-intro p.lead { font-size: 17px; color: var(--ink-3); max-width: 460px; margin: 20px 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-trust { margin: 22px 0 0; font-size: 13px; color: var(--ink-3); font-weight: 500; }

.roles-heading { margin: 0 0 20px; }
.roles-heading h2 { font-size: clamp(22px, 2.6vw, 28px); }
.roles-heading p { color: var(--ink-3); margin: 8px 0 0; font-size: 15px; }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .role-grid { grid-template-columns: 1fr; } }

.role-card {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-md); padding: 16px; cursor: pointer; color: inherit;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.role-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.role-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.role-icon {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.role-card.active .role-icon { background: var(--brand); color: #fff; }
.role-name { font-family: var(--font-head); font-weight: 800; font-size: 14.5px; margin-bottom: 3px; color: var(--ink); }
.role-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }

/* ---- Demo ramkasi (ikkinchi ustun) ---- */
.demo-frame {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid var(--line); max-width: 380px; margin: 0 auto;
}
.demo-header { padding: 14px 16px; display: flex; align-items: center; gap: 10px; color: #fff; transition: background .35s ease; }
.demo-header .icon { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.demo-header .titles { min-width: 0; flex: 1; }
.demo-header .title { font-family: var(--font-head); font-weight: 800; font-size: 14px; line-height: 1.2; }
.demo-header .subtitle { font-size: 11.5px; opacity: .85; margin-top: 1px; }
.demo-badge { font-size: 10px; font-weight: 700; letter-spacing: .03em; background: rgba(255,255,255,.25); padding: 3px 8px; border-radius: 999px; flex-shrink: 0; }

.demo-body { height: 320px; background: var(--bg-alt); padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scroll-behavior: smooth; }
.demo-body::-webkit-scrollbar { width: 4px; }
.demo-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.42; animation: msgIn .28s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .cursor { display: inline-block; width: 2px; height: 13px; background: currentColor; margin-left: 1px; vertical-align: -2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.typing-dots { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; border-bottom-left-radius: 4px; padding: 11px 14px; display: flex; gap: 4px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); animation: bounce 1.1s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.msg.card { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; padding: 12px 13px; max-width: 86%; }
.msg.card .card-title { font-family: var(--font-head); font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.msg.card .card-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; line-height: 1.4; }
.msg.card .card-cta { display: inline-block; background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 700; padding: 7px 13px; border-radius: 9px; text-decoration: none; }

.channel-tabs { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.channel-tab {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent;
  background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: border-color .15s, transform .15s;
}
.channel-tab.active { border-color: var(--ink); transform: scale(1.08); }
.demo-disclaimer { text-align: center; font-size: 11px; color: var(--ink-3); margin: 10px 0 0; }

@media (prefers-reduced-motion: reduce) { .msg { animation: none; } .cursor { animation: none; opacity: 1; } }

/* ============================================================
   KANALLAR
   ============================================================ */
.channel-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 980px) { .channel-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .channel-grid { grid-template-columns: repeat(2, 1fr); } }
.channel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px 14px; text-align: center; }
.channel-card .badge-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.channel-card h3 { font-size: 14px; margin-bottom: 6px; }
.channel-card .method { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; min-height: 34px; }
.channel-card .time { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; }

/* ============================================================
   QANDAY ISHLAYDI
   ============================================================ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step-num { font-family: var(--font-head); font-size: 44px; font-weight: 800; color: var(--brand-soft); line-height: 1; margin-bottom: 12px; }
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--ink-3); font-size: 14.5px; }

/* ============================================================
   NAZORAT SIZDA
   ============================================================ */
.control-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 860px; margin: 0 auto; }
@media (max-width: 700px) { .control-list { grid-template-columns: 1fr; } }
.control-item { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; }
.control-item .check {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.control-item p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }

/* ============================================================
   KO'P BIZNES
   ============================================================ */
.multi-banner {
  max-width: 860px; margin: 0 auto; background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: var(--radius-lg); padding: 40px; color: #fff; text-align: center;
}
.multi-banner h2 { color: #fff; font-size: clamp(22px, 3vw, 28px); }
.multi-banner p { color: rgba(255,255,255,.85); max-width: 520px; margin: 12px auto 0; font-size: 15px; }

/* ============================================================
   NARXLAR
   ============================================================ */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 860px) { .pricing-grid { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; } }
.price-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 28px 24px; display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--brand); box-shadow: var(--shadow-lg); position: relative; }
.price-badge { display: inline-block; background: var(--amber); color: #1a1200; font-size: 11.5px; font-weight: 800; padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; align-self: flex-start; }
.price-card h3 { font-size: 18px; }
.price-value { font-family: var(--font-head); font-size: 30px; font-weight: 800; margin: 10px 0 18px; }
.price-features { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.price-features li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.price-features li svg { flex-shrink: 0; margin-top: 2px; color: var(--brand); }

/* ============================================================
   FAQ (accordion)
   ============================================================ */
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: transparent; border: none; text-align: left; padding: 20px 4px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: 15.5px; color: var(--ink);
}
.faq-q .plus { flex-shrink: 0; width: 22px; height: 22px; position: relative; transition: transform .25s var(--ease); }
.faq-q .plus::before, .faq-q .plus::after { content: ''; position: absolute; background: var(--ink-3); border-radius: 2px; }
.faq-q .plus::before { width: 14px; height: 2px; top: 10px; left: 4px; }
.faq-q .plus::after { width: 2px; height: 14px; top: 4px; left: 10px; transition: opacity .2s; }
.faq-item.open .plus { transform: rotate(90deg); }
.faq-item.open .plus::after { opacity: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.faq-a p { margin: 0 4px 20px; color: var(--ink-3); font-size: 14.5px; line-height: 1.55; max-width: 620px; }
.faq-q:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ============================================================
   YAKUNIY CTA + FOOTER
   ============================================================ */
.final-cta { text-align: center; }
.final-cta h2 { font-size: clamp(26px, 3.6vw, 40px); }
.final-cta .btn { margin-top: 26px; }

footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { text-decoration: none; color: var(--ink-3); }
.footer-links a:hover { color: var(--ink); }

/* ============================================================
   REVEAL (IntersectionObserver bilan boshqariladi — CSS faqat holat)
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-stagger.in-view { transition-delay: var(--stagger-delay, 0ms); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
