:root {
  --bg: #FFFFFF;
  --soft: #F4F6FA;
  --soft2: #EEF2F8;
  --line: #E1E6EE;
  --ink: #13203A;
  --muted: #5D6779;
  --navy: #1B3B6E;
  --navy-h: #234B88;
  --ok: #17734A;
  --ok-bg: #EAF6EF;
  --ok-line: #8FCDAA;
  --no: #B0362A;
  --no-bg: #FCEEEB;
  --no-line: #EFB1A7;
  --warn: #7A5200;
  --warn-bg: #FFF5DB;
}

/* keng ekranda maket mutanosib kattalashadi (1440 px da 1rem = 16px) */
html { font-size: max(100%, 100vw / 90); -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--navy); }
.in { width: 100%; max-width: 58rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
main.in { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }
.loading { color: var(--muted); }

/* ---------- shapka ---------- */
.top { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.top .in { display: flex; align-items: center; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--ink); }
.brand img { width: 3rem; height: 3rem; flex: none; }
.brand b { display: block; font-size: 1rem; font-weight: 600; letter-spacing: -.005em; }
.brand small { display: block; font-size: .8125rem; color: var(--muted); }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.foot .in { padding-top: 1.1rem; padding-bottom: 1.4rem; }
.w-ic { color: #B07A00; }

/* ---------- bosh sahifa ---------- */
.hero { margin-bottom: 1.75rem; }
.eyebrow { font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); margin: 0 0 .5rem; }
h1.title { font-size: 1.875rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .6rem; }
.lead { color: var(--muted); margin: 0; max-width: 40rem; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.sec {
  display: flex; flex-direction: column; text-align: left; cursor: pointer;
  background: var(--soft); border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem 1.25rem 1.1rem;
  text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s;
}
.sec:hover { border-color: #B9C6DB; background: var(--soft2); }
.sec:focus-visible, .btn:focus-visible, .opt:focus-visible, .seg button:focus-visible { outline: 3px solid #9DB4DA; outline-offset: 2px; }
.sec .num { font-size: .8125rem; font-weight: 600; color: var(--navy); }
.sec h2 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; margin: .35rem 0 .25rem; letter-spacing: -.01em; }
.sec .cnt { color: var(--muted); font-size: .875rem; margin-bottom: 1rem; }
.sec .bot { margin-top: auto; }
.meter { height: .375rem; background: #DFE5EE; border-radius: 1rem; overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }
.meter .m-ok { background: var(--ok); }
.meter .m-no { background: #D9826F; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .8125rem; color: var(--muted); margin-top: .5rem; }
.legend b { color: var(--ink); font-weight: 600; }
.resume { margin-top: .75rem; font-size: .8125rem; font-weight: 600; color: var(--navy); }

/* ---------- tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.4rem; border-radius: .75rem; border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, opacity .15s;
}
.btn-p { background: var(--navy); color: #fff; }
.btn-p:hover { background: var(--navy-h); }
.btn-s { background: #fff; color: var(--navy); border-color: #C4CFE0; }
.btn-s:hover { border-color: var(--navy); }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- bo'lim sozlamalari ---------- */
.back { display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; font-weight: 500; text-decoration: none; color: var(--muted); margin-bottom: 1rem; }
.back:hover { color: var(--navy); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.stat { background: var(--soft); border: 1px solid var(--line); border-radius: .875rem; padding: .9rem 1rem; }
.stat b { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat span { font-size: .8125rem; color: var(--muted); }
.stat.ok b { color: var(--ok); }
.stat.no b { color: var(--no); }

.form { border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; margin-bottom: 1.25rem; }
.field + .field { margin-top: 1.1rem; }
.field > label, .field > .lbl { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
.seg { display: flex; flex-wrap: wrap; gap: .5rem; }
.seg button {
  min-height: 2.5rem; padding: .45rem .95rem; border-radius: .625rem; cursor: pointer;
  background: #fff; border: 1px solid #CDD6E3; font-size: .9375rem; font-weight: 500;
}
.seg button small { color: var(--muted); font-weight: 400; margin-left: .25rem; }
.seg button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg button[aria-pressed="true"] small { color: #C8D4EA; }
.seg button[disabled] { opacity: .4; cursor: default; }
.note { font-size: .875rem; color: var(--muted); margin: .9rem 0 0; }

/* ---------- test ---------- */
.tbar { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.tbar .back { margin: 0; }
.tbar .pos { margin-left: auto; font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.score { display: flex; gap: .6rem; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.score .s-ok { color: var(--ok); }
.score .s-no { color: var(--no); }
.track { height: .25rem; background: var(--soft2); border-radius: 1rem; overflow: hidden; margin-bottom: 1.5rem; }
.track i { display: block; height: 100%; background: var(--navy); transition: width .3s; }

.qmeta { font-size: .8125rem; color: var(--muted); margin-bottom: .5rem; }
.qmeta b { color: var(--navy); font-weight: 600; }
.qtext { font-size: 1.3125rem; line-height: 1.45; font-weight: 600; letter-spacing: -.01em; margin: 0 0 1.25rem; }

.opts { display: grid; gap: .625rem; }
.opt {
  display: flex; align-items: flex-start; gap: .85rem; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid #D3DBE7; border-radius: .875rem; padding: .85rem 1rem;
  font-size: 1rem; line-height: 1.45; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--navy); background: #F8FAFD; }
.opt .l {
  flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft2); color: var(--navy); font-size: .8125rem; font-weight: 700; margin-top: -.05rem;
}
.opt .t { flex: 1; padding-top: .05rem; }
.opt.no { border-color: var(--no-line); background: var(--no-bg); color: #7A2A21; cursor: default; }
.opt.no .l { background: var(--no); color: #fff; }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); color: #0F4D31; cursor: default; }
.opt.ok .l { background: var(--ok); color: #fff; }
.opt.dim { opacity: .55; cursor: default; }
.opt.dim:hover { border-color: #D3DBE7; background: #fff; }
.opt.shake { animation: shake .28s; }
@keyframes shake { 0%,100% { transform: none; } 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .opt.shake { animation: none; } .track i { transition: none; } }

.fb { min-height: 1.5rem; margin-top: 1rem; }
.fb .msg { font-weight: 600; font-size: .9375rem; }
.fb .msg.no { color: var(--no); }
.fb .msg.ok { color: var(--ok); }
.full { margin-top: .75rem; background: var(--soft); border-radius: .875rem; padding: .9rem 1rem; font-size: .9375rem; }
.full .k { display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem; }
.warn { margin-top: .6rem; background: var(--warn-bg); color: var(--warn); border-radius: .75rem; padding: .6rem .9rem; font-size: .875rem; }
.next-row { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.hint { font-size: .8125rem; color: var(--muted); margin-right: auto; }

/* ---------- natija ---------- */
.result { text-align: center; padding: 1rem 0 1.5rem; }
.big { font-size: 3.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--navy); }
.result p { color: var(--muted); margin: .6rem 0 0; }
.result .row { justify-content: center; margin-top: 1.5rem; }
.mist { margin-top: 2rem; }
.mist h2 { font-size: 1.125rem; margin: 0 0 .75rem; }
.mitem { border: 1px solid var(--line); border-radius: .875rem; padding: .9rem 1rem; }
.mitem + .mitem { margin-top: .6rem; }
.mitem .q { font-weight: 600; font-size: .9375rem; }
.mitem .a { margin-top: .35rem; font-size: .9375rem; color: var(--ok); }
.mitem .n { font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }

/* ---------- mobil ---------- */
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1.title { font-size: 1.5rem; }
  .qtext { font-size: 1.125rem; }
  .hint { display: none; }
  .next-row .btn { width: 100%; }
  main.in { padding-top: 1.25rem; }
  .in { padding-left: 1rem; padding-right: 1rem; }
  .brand img { width: 2.5rem; height: 2.5rem; }
  .brand b { font-size: .9375rem; }
}
