/* ============================================================
   ISKO DEKOR — Ishchilar Qabul, O'quv va Imtihon Tizimi (app.css)
   tokens.css dan keyin ulanadi. Navy + Oltin rasmiy brend uslubi.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 48px 0; }
.bg-cream { background: var(--cream); }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: "Della Respira", var(--font-logo);
  font-weight: 700; font-size: 1.18rem; letter-spacing: 2.4px;
  color: var(--navy); text-transform: uppercase;
}
.brand-sub { font-size: .75rem; font-weight: 700; color: var(--gold-deep); letter-spacing: .8px; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Navy Hero + Naqsh ---------- */
.navy-sec {
  background: var(--navy-grad); color: #fff; position: relative; overflow: hidden;
}
.navy-sec::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("../assets/naqsh-tile.png");
  background-size: 480px auto; background-repeat: repeat;
  opacity: .075; pointer-events: none;
}
.navy-sec > * { position: relative; z-index: 1; }

.hero-banner { padding: 42px 0 46px; text-align: center; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(239,196,162,.55);
  color: var(--gold-2); font-weight: 800; font-size: .78rem;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 7px 16px; border-radius: var(--radius-pill); margin-bottom: 14px;
}
.hero-banner h1 {
  font-size: clamp(1.45rem, 3.2vw, 2.35rem); font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; max-width: 820px; margin: 0 auto;
}
.hero-banner p {
  color: var(--on-navy-soft); max-width: 680px; margin: 12px auto 0; font-size: .98rem;
}
.ornament {
  width: 190px; height: 24px; margin: 14px auto 0;
  background: url("../assets/ornament.svg") no-repeat center / contain;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 800; font-size: .94rem;
  padding: 13px 24px; border-radius: var(--radius-pill);
  transition: transform .15s, box-shadow .2s, background .2s, color .2s, opacity .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-sm { padding: 8px 16px; font-size: .82rem; }
.btn-lg { padding: 16px 32px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold-grad); color: var(--gold-ink); box-shadow: var(--shadow-gold); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold-hover); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.btn-navy:hover { transform: translateY(-2px); background: var(--navy-2); }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--navy); background: var(--navy-soft); }
.btn-ok { background: #1c8a4a; color: #fff; }
.btn-ok:hover { background: #156f3a; transform: translateY(-1px); }
.btn-err { background: #b83b35; color: #fff; }
.btn-err:hover { background: #962d28; transform: translateY(-1px); }

/* ---------- Badges & Chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 800; padding: 5px 12px;
  border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: .4px;
  background: var(--navy-soft); color: var(--navy);
}
.badge-gold { background: var(--gold-grad); color: var(--gold-ink); }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-err { background: var(--err-bg); color: var(--err-fg); }
.badge-wait { background: #fff4db; color: #9a6500; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  padding: 9px 18px; border-radius: var(--radius-pill); font-weight: 800; font-size: .86rem;
  background: #fff; color: var(--muted); border: 1.5px solid var(--line); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Panels & Forms ---------- */
.panel {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 28px;
}
.panel-narrow { max-width: 680px; margin: 0 auto; }
.panel-mid { max-width: 860px; margin: 0 auto; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: .9rem; font-weight: 800; margin-bottom: 7px; color: var(--ink); }
.field .req { color: #b83b35; margin-left: 3px; }
.input, select.input, textarea.input {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface-input); color: var(--ink); font-size: .96rem; transition: border-color .15s, background .15s;
}
textarea.input { min-height: 92px; resize: vertical; }
.input:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(229,169,124,.18); }

.msg { padding: 13px 16px; border-radius: 12px; margin: 14px 0; font-size: .92rem; font-weight: 700; }
.msg.ok { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid rgba(28,138,74,.25); }
.msg.err { background: var(--err-bg); color: var(--err-fg); border: 1px solid rgba(184,59,53,.25); }
.msg.info { background: var(--navy-soft); color: var(--navy); border: 1px solid rgba(18,58,134,.18); }

/* ---------- Returning worker check bar ---------- */
.returning-box {
  background: var(--cream); border: 1.5px dashed var(--gold); border-radius: var(--radius-md);
  padding: 16px 20px; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.returning-form { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 10px; }
.returning-form .input { flex: 1; min-width: 200px; background: #fff; }

/* ---------- Waiting Screen (2-eshik kutilmoqda) ---------- */
.wait-card { text-align: center; padding: 40px 26px; }
.pulse-ring {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--gold-grad); color: var(--gold-ink);
  display: grid; place-items: center; font-size: 2rem;
  box-shadow: 0 0 0 0 rgba(229,169,124,.6);
  animation: pulseGold 2s infinite;
}
@keyframes pulseGold {
  0% { box-shadow: 0 0 0 0 rgba(229,169,124,.55); }
  70% { box-shadow: 0 0 0 18px rgba(229,169,124,0); }
  100% { box-shadow: 0 0 0 0 rgba(229,169,124,0); }
}

/* ---------- 1-XONA: Stepper Navigation ---------- */
.stage-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px;
}
.stage-tab {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius-md);
  padding: 15px 14px; text-align: left; cursor: pointer; transition: .18s;
  display: flex; align-items: flex-start; gap: 12px; position: relative;
}
.stage-tab:hover { border-color: var(--gold); transform: translateY(-2px); }
.stage-tab.active {
  background: var(--navy-grad); color: #fff; border-color: var(--navy); box-shadow: var(--shadow);
}
.stage-num {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--navy-soft); color: var(--navy); font-weight: 800; font-size: .95rem;
  display: grid; place-items: center;
}
.stage-tab.active .stage-num { background: var(--gold-grad); color: var(--gold-ink); }
.stage-tab.done .stage-num { background: #1c8a4a; color: #fff; }
.stage-info strong { display: block; font-size: .92rem; font-weight: 800; line-height: 1.25; }
.stage-info span { display: block; font-size: .76rem; opacity: .78; margin-top: 3px; }

/* ---------- Model Study Cards (1-Etap) ---------- */
.models-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px;
}
.mcard {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .2s;
}
.mcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.mcard-media {
  aspect-ratio: 4/3; background: var(--surface-img); position: relative; overflow: hidden; cursor: zoom-in;
}
.mcard-media img { width: 100%; height: 100%; object-fit: contain; background: #f5f6fa; padding: 6px; }
.mcard-switch {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  display: flex; gap: 6px; justify-content: center; pointer-events: none;
}
.mcard-switch button {
  pointer-events: auto; border: 0; cursor: pointer;
  padding: 5px 11px; border-radius: var(--radius-pill); font-size: .72rem; font-weight: 800;
  background: rgba(16, 32, 68, 0.78); color: #fff; backdrop-filter: blur(4px);
}
.mcard-switch button.on { background: var(--gold-grad); color: var(--gold-ink); }
.mcard-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mcard-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.mcard-body h3 { font-size: 1.08rem; font-weight: 800; color: var(--ink); }
.mcard-spec { font-size: .83rem; color: var(--navy); font-weight: 700; background: var(--navy-soft); padding: 6px 10px; border-radius: 8px; }
.mcard-desc { font-size: .86rem; color: var(--muted); line-height: 1.5; }

/* ---------- Interactive Quiz & Exam UI ---------- */
.quiz-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.progress-track {
  width: 100%; height: 9px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 22px;
}
.progress-fill { height: 100%; background: var(--gold-grad); transition: width .28s ease; }

.quiz-prompt { font-size: 1.18rem; font-weight: 800; color: var(--ink); margin-bottom: 16px; line-height: 1.35; }
.quiz-main-img {
  max-width: 440px; width: 100%; aspect-ratio: 4/3; margin: 0 auto 20px;
  background: #f5f6fa; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; cursor: zoom-in; position: relative;
}
.quiz-main-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.zoom-hint {
  position: absolute; bottom: 8px; right: 10px; background: rgba(18,58,134,.78); color: #fff;
  font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px;
}

/* Text options list */
.opt-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt-btn {
  text-align: left; padding: 15px 18px; border-radius: var(--radius-md);
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 700; font-size: .95rem; cursor: pointer; transition: .15s;
  display: flex; align-items: center; gap: 12px;
}
.opt-btn:hover:not(:disabled) { border-color: var(--navy); background: var(--navy-soft); }
.opt-letter {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: var(--cream); color: var(--navy); font-weight: 800; font-size: .85rem;
  display: grid; place-items: center;
}
.opt-btn.selected { border-color: var(--navy); background: var(--navy-soft); }
.opt-btn.selected .opt-letter { background: var(--navy); color: #fff; }
.opt-btn.correct { border-color: #1c8a4a !important; background: #eaf8f0 !important; color: #125e32; }
.opt-btn.correct .opt-letter { background: #1c8a4a; color: #fff; }
.opt-btn.wrong { border-color: #b83b35 !important; background: #fdf0ef !important; color: #8c2520; }
.opt-btn.wrong .opt-letter { background: #b83b35; color: #fff; }

/* Image options 2x2 grid (Stage 3: Nom -> Variant rasmlar) */
.opt-img-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.opt-img-card {
  border: 2.5px solid var(--line); border-radius: var(--radius-md); background: #fff;
  overflow: hidden; cursor: pointer; transition: .16s; padding: 0; text-align: center;
}
.opt-img-card:hover:not(:disabled) { border-color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow); }
.opt-img-card .pic { aspect-ratio: 4/3; background: #f5f6fa; overflow: hidden; }
.opt-img-card .pic img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.opt-img-card .cap {
  padding: 9px 12px; font-weight: 800; font-size: .85rem; color: var(--ink);
  border-top: 1px solid var(--line); background: var(--surface-input);
}
.opt-img-card.selected { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(18,58,134,.18); }
.opt-img-card.selected .cap { background: var(--navy); color: #fff; }
.opt-img-card.correct { border-color: #1c8a4a !important; }
.opt-img-card.correct .cap { background: #1c8a4a !important; color: #fff !important; }
.opt-img-card.wrong { border-color: #b83b35 !important; }
.opt-img-card.wrong .cap { background: #b83b35 !important; color: #fff !important; }

/* ---------- Exam Result Breakdown ---------- */
.score-circle {
  width: 132px; height: 132px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800;
  border: 6px solid var(--gold); background: var(--navy-grad); color: #fff;
}
.score-circle strong { font-size: 2.1rem; line-height: 1; }
.score-circle span { font-size: .78rem; color: var(--gold-2); margin-top: 4px; }

.review-list { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; text-align: left; }
.review-item {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff;
  display: flex; gap: 14px; align-items: flex-start;
}
.review-item.ok { border-left: 5px solid #1c8a4a; }
.review-item.bad { border-left: 5px solid #b83b35; background: #fffafa; }
.review-thumb { width: 76px; height: 64px; object-fit: contain; background: #f5f6fa; border-radius: 8px; border: 1px solid var(--line); flex-shrink: 0; }

/* ---------- Admin Panel Layout ---------- */
.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat-card .num { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-card .lbl { font-size: .82rem; font-weight: 700; color: var(--muted); margin-top: 4px; }

.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; border-bottom: 2px solid var(--line); padding-bottom: 12px; }
.admin-tab {
  padding: 10px 18px; border-radius: var(--radius-pill); border: 1.5px solid var(--line);
  background: #fff; font-weight: 800; font-size: .88rem; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.admin-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.admin-tab .cnt {
  background: var(--gold-grad); color: var(--gold-ink); padding: 1px 8px; border-radius: 99px; font-size: .74rem;
}

.cand-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 6px 20px rgba(12,30,74,.06);
}
.cand-card.pending { border-left: 5px solid #e5a97c; }
.cand-card.accepted { border-left: 5px solid #1c8a4a; }
.cand-card.rejected { border-left: 5px solid #b83b35; opacity: .82; }
.cand-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cand-qa {
  margin-top: 12px; background: var(--surface-input); border-radius: 10px; padding: 12px 14px;
  display: grid; gap: 8px; font-size: .88rem;
}
.cand-qa div strong { color: var(--navy); display: block; font-size: .82rem; }

.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--navy-soft); color: var(--navy); font-weight: 800; font-size: .8rem; text-transform: uppercase; }
.tbl tr:last-child td { border-bottom: 0; }

/* Upload preview thumbs */
.thumb-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.thumb-box {
  width: 84px; height: 84px; border-radius: 10px; border: 1.5px solid var(--line);
  position: relative; overflow: hidden; background: #f5f6fa;
}
.thumb-box img { width: 100%; height: 100%; object-fit: contain; }
.thumb-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px;
  border-radius: 50%; border: 0; background: #b83b35; color: #fff;
  font-weight: 800; font-size: .75rem; cursor: pointer; line-height: 1;
}

/* ---------- Modal / Lightbox ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(10, 26, 62, 0.72);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-card {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg); position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--cream);
  cursor: pointer; font-weight: 800; font-size: 1.1rem;
}
.lightbox-img { max-width: 92vw; max-height: 85vh; border-radius: 12px; background: #fff; padding: 8px; }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-3); color: rgba(255,255,255,.76);
  padding: 26px 0; text-align: center; font-size: .86rem; margin-top: 50px;
}

/* ---------- Responsive (Telefon uchun) ---------- */
@media (max-width: 860px) {
  .stage-tabs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  :root { --gutter: 15px; --header-h: 64px; }
  .panel { padding: 18px 16px; }
  .stage-tabs { grid-template-columns: 1fr; gap: 8px; }
  .opt-list { grid-template-columns: 1fr; }
  .opt-img-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .brand-name { font-size: 1rem; letter-spacing: 1.6px; }
  .brand img { width: 38px; height: 38px; }
}
