/* ============================================
   ILMWAY — Sinov testlari
   styles.css tokenlaridan foydalanadi
   ============================================ */

.test-body { min-height: 100vh; }

/* ---------- Yuqori panel ---------- */
.tbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 36px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.tbar__back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 11px; font-weight: 600; font-size: 13.5px;
  color: var(--text-2); border: 1px solid var(--border); background: var(--surface);
  transition: all .18s var(--ease);
}
.tbar__back:hover { color: var(--text); border-color: var(--border-strong); transform: translateX(-2px); }
.tbar__crumb { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.tbar__crumb .brand__name { font-size: 17px; }
.tbar__crumb .sep { color: var(--text-3); font-weight: 400; }
.tbar__crumb .now { color: var(--teal-600); }
[data-theme="dark"] .tbar__crumb .now { color: var(--teal-500); }
.tbar__theme { margin-left: auto; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
.ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: block; }

/* ---------- Hub ---------- */
.thub { width: 100%; max-width: 1040px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 36px) 70px; }

.thero {
  background:
    radial-gradient(circle at 90% 10%, rgba(20,184,166,.14), transparent 45%),
    radial-gradient(circle at 8% 92%, rgba(14,165,233,.12), transparent 42%),
    var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 40px; box-shadow: var(--shadow-sm);
}
.thero__eyebrow { display: inline-flex; font-size: 12.5px; font-weight: 700; color: var(--teal-600); background: rgba(20,184,166,.12); padding: 6px 13px; border-radius: 999px; }
.thero h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); font-weight: 800; margin: 16px 0 0; letter-spacing: -.03em; }
.thero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.thero p { color: var(--text-2); font-size: 15.5px; margin-top: 14px; max-width: 640px; }
.thero__rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.rule { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.rule__ic { font-size: 22px; }
.rule b { display: block; font-size: 14px; font-weight: 700; }
.rule span { font-size: 12.5px; color: var(--text-3); }

.thub__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 42px 0 20px; flex-wrap: wrap; }
.thub__head h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; }
.tabs { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.tab { padding: 8px 15px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--text-2); transition: all .18s var(--ease); }
.tab.is-active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -8px rgba(14,165,233,.7); }
.tab:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Test kartalari ---------- */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.tcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.tcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tcard__bar { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.tcard__top { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 12px; }
.tcard__subj { font-size: 11.5px; font-weight: 700; color: var(--blue-600); background: rgba(14,165,233,.1); padding: 4px 11px; border-radius: 999px; }
.tcard__lvl { font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 14px; color: var(--teal-600); }
.tcard h3 { font-size: 1.2rem; font-weight: 700; }
.tcard p { color: var(--text-2); font-size: 13.5px; margin-top: 5px; min-height: 38px; }
.tcard__meta { display: flex; gap: 16px; margin: 14px 0; }
.tcard__meta span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); font-weight: 600; }
.tcard__meta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.tcard__best { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--teal-600); }
.tcard__best svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tcard__best--none { color: var(--text-3); }
.btn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.btn--sm { padding: 9px 15px; font-size: 13px; border-radius: 11px; }
.btn--soft { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.btn--soft:hover { background: var(--surface); color: var(--text); }
.tcard--soon { opacity: .72; }
.tcard--soon:hover { transform: none; box-shadow: var(--shadow-sm); }

/* ============================================
   IMTIHON
   ============================================ */
.exam { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: none; flex-direction: column; }
.exam.is-open { display: flex; }

.exam__top { display: flex; align-items: center; gap: 14px; padding: 12px clamp(14px, 4vw, 28px); border-bottom: 1px solid var(--border); background: var(--surface); }
.exam__close { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.exam__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.exam__title { font-family: "Plus Jakarta Sans"; font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam__timer {
  display: inline-flex; align-items: center; gap: 7px; font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 16px;
  padding: 8px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.exam__timer svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.exam__timer.low { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #ef4444; animation: tpulse 1s infinite; }
@keyframes tpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.exam__progress { height: 4px; background: var(--surface-2); }
.exam__progress span { display: block; height: 100%; background: var(--grad); transition: width .3s var(--ease); }

.exam__main { flex: 1; overflow-y: auto; padding: 30px clamp(16px, 5vw, 40px); }
.exam__q { max-width: 720px; margin: 0 auto; }
.exam__count { font-size: 13px; font-weight: 700; color: var(--text-3); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.flagtag { display: inline-flex; align-items: center; gap: 5px; color: var(--amber-500); }
.flagtag svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.exam__text { font-family: "Plus Jakarta Sans"; font-weight: 700; font-size: clamp(1.15rem, 2.6vw, 1.5rem); line-height: 1.4; margin-bottom: 22px; }
.exam__opts { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 16px 18px; border-radius: var(--r); border: 2px solid var(--border); background: var(--surface);
  transition: all .16s var(--ease);
}
.opt:hover { border-color: var(--blue-500); transform: translateX(3px); }
.opt__l { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; font-family: "Plus Jakarta Sans"; font-weight: 800; background: var(--surface-2); color: var(--text-2); }
.opt__t { font-size: 15.5px; font-weight: 500; }
.opt.is-sel { border-color: var(--blue-500); background: var(--grad-soft); }
.opt.is-sel .opt__l { background: var(--grad); color: #fff; }

.exam__palette { display: flex; gap: 8px; padding: 12px clamp(14px, 4vw, 28px); overflow-x: auto; border-top: 1px solid var(--border); background: var(--surface); }
.pchip {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; font-family: "Plus Jakarta Sans"; font-weight: 700; font-size: 14px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); position: relative; transition: all .15s;
}
.pchip.is-ans { background: var(--grad); color: #fff; border-color: transparent; }
.pchip.is-cur { box-shadow: 0 0 0 3px var(--blue-500); color: var(--text); }
.pchip.is-cur.is-ans { color: #fff; }
.pchip.is-flag::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber-500); border: 2px solid var(--surface); }

.exam__foot { display: flex; align-items: center; gap: 10px; padding: 14px clamp(14px, 4vw, 28px) calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); }
.exam__foot .btn svg { fill: none; stroke: currentColor; stroke-width: 2; }
.exam__foot #exFlag { margin-left: auto; }
.exam__foot #exFlag.is-on { color: var(--amber-500); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.1); }
.exam__foot #exNext { min-width: 130px; justify-content: center; }
.exam__foot .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Tasdiqlash dialogi ---------- */
.dlg { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; }
.dlg__backdrop { position: absolute; inset: 0; background: rgba(4,15,24,.55); backdrop-filter: blur(3px); }
.dlg__box { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; width: min(420px, 92vw); box-shadow: var(--shadow-lg); animation: slideUp .25s var(--ease); }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg__box h4 { font-size: 1.2rem; font-weight: 800; }
.dlg__box p { color: var(--text-2); font-size: 14px; margin-top: 8px; }
.dlg__btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ============================================
   NATIJA
   ============================================ */
.result { position: fixed; inset: 0; z-index: 82; background: var(--bg); display: none; overflow-y: auto; }
.result.is-open { display: block; }
.result__wrap { max-width: 820px; margin: 0 auto; padding: 40px clamp(16px, 5vw, 40px) 70px; }

.result__head { display: flex; align-items: center; gap: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 34px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.ring { --p: 0; --rc: #0ea5e9; width: 150px; height: 150px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring__in { width: 116px; height: 116px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; align-content: center; box-shadow: var(--shadow-sm); }
.ring__in b { font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 2.1rem; }
.ring__in span { font-size: 13px; color: var(--text-3); font-weight: 600; }
.result__sum { flex: 1; min-width: 240px; }
.result__badge { display: inline-block; color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.result__sum h2 { font-size: 1.8rem; font-weight: 800; margin: 12px 0 4px; }
.result__sum p { color: var(--text-2); font-size: 14.5px; }
.result__stats { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.result__stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 18px; }
.result__stats b { display: block; font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 1.4rem; }
.result__stats span { font-size: 12px; color: var(--text-3); font-weight: 600; }

/* ---------- Tahlil ---------- */
.review { margin-top: 34px; }
.review h3 { font-size: 1.4rem; font-weight: 800; }
.review__hint { color: var(--text-2); font-size: 14px; margin: 6px 0 20px; }
.ritem { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--r); padding: 20px; margin-bottom: 14px; }
.ritem--ok { border-left-color: var(--emerald-500); }
.ritem--no { border-left-color: #ef4444; }
.ritem__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ritem__ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.ritem__ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.ritem--ok .ritem__ic { background: var(--emerald-500); }
.ritem--no .ritem__ic { background: #ef4444; }
.ritem__n { font-weight: 700; font-size: 14px; }
.ritem__tag { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-left: auto; }
.ritem__tag.ok { background: rgba(16,185,129,.14); color: var(--teal-600); }
.ritem__tag.no { background: rgba(239,68,68,.12); color: #ef4444; }
.ritem__q { font-family: "Plus Jakarta Sans"; font-weight: 700; font-size: 1.02rem; line-height: 1.45; }
.ritem__ans { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.ritem__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.ritem__lbl { color: var(--text-3); font-weight: 600; font-size: 13px; }
.ra { font-weight: 600; padding: 5px 12px; border-radius: 9px; font-size: 14px; }
.ra--ok { background: rgba(16,185,129,.14); color: var(--teal-600); }
.ra--no { background: rgba(239,68,68,.12); color: #ef4444; text-decoration: line-through; }
.ra--skip { background: var(--surface-2); color: var(--text-3); }
.ritem__ex { background: var(--surface-2); border-radius: var(--r-sm); padding: 14px 16px; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.ritem__ex b { color: var(--text); }

.result__actions { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .thero { padding: 26px; }
  .thero__rules { grid-template-columns: 1fr; }
  .result__head { gap: 22px; }
}
@media (max-width: 600px) {
  .exam__title { display: none; }
  .exam__foot { flex-wrap: wrap; }
  .exam__foot #exFlag { margin-left: 0; order: 3; flex: 1; justify-content: center; }
  .exam__foot #exPrev { flex: 1; justify-content: center; }
  .exam__foot #exNext { flex: 2; }
  .ring { width: 128px; height: 128px; }
  .ring__in { width: 98px; height: 98px; }
}
