/* ===================================================================
   Danny Khreet — Training & Exams engine (shared styles)
   One unified look & feel for every exam in the training center.
   Builds on the site theme tokens (navy + gold) from styles.css.
   =================================================================== */

.exam-main { padding: clamp(20px, 4vw, 40px) 0 72px; }
.exam-main .container { max-width: 880px; }

/* screens */
.ex-screen { display: none; }
.ex-screen.is-active { display: block; animation: exFade .4s var(--ease) both; }
@keyframes exFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes exPop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

.ex-back { margin-bottom: 18px; }

/* ---------- HOME hero ---------- */
.ex-hero {
  position: relative; overflow: hidden; color: #eaf0f7; border-radius: var(--radius);
  background:
    radial-gradient(900px 460px at 88% -20%, rgba(200,164,92,.20), transparent 60%),
    linear-gradient(155deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  padding: clamp(28px, 5vw, 46px) clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}
.ex-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .3;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 26px 26px;
}
.ex-kicker {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--gold-soft);
  background: rgba(200,164,92,.12); border: 1px solid rgba(200,164,92,.40);
  padding: 6px 15px; border-radius: 999px; margin-bottom: 18px;
}
.ex-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.ex-hero h1 { position: relative; z-index: 1; color: #fff; font-size: clamp(24px, 4.4vw, 38px); line-height: 1.3; margin-bottom: 12px; }
.ex-lead { position: relative; z-index: 1; color: #b9c7d8; font-size: clamp(15px, 2.2vw, 17.5px); max-width: 60ch; }

.ex-stats {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-top: 26px;
}
.ex-stat {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm); padding: 14px 10px; text-align: center;
}
.ex-stat b { display: block; font-family: var(--font-head); font-weight: 800; color: var(--gold); font-size: clamp(22px, 3.4vw, 30px); line-height: 1.05; }
.ex-stat span { display: block; color: #aebccd; font-size: 12.5px; margin-top: 5px; }

/* ---------- section heads ---------- */
.ex-h2 {
  font-size: clamp(18px, 2.6vw, 22px); color: var(--navy-800); margin: 34px 2px 16px;
  display: flex; align-items: center; gap: 11px;
}
.ex-h2::before { content: ""; width: 7px; height: 22px; border-radius: 4px; background: linear-gradient(var(--gold), var(--gold-soft)); flex: none; }

/* ---------- mode cards ---------- */
.ex-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.ex-mode {
  display: flex; gap: 14px; align-items: flex-start; text-align: right; width: 100%;
  background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 18px; cursor: pointer; font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.ex-mode:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-soft); }
.ex-mode .ex-mic { flex: none; width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--bg-soft); color: var(--navy-700); }
.ex-mode:hover .ex-mic { background: var(--navy-800); color: var(--gold); }
.ex-mode .ex-mic svg { width: 24px; height: 24px; }
.ex-mode h3 { font-size: 16.5px; color: var(--navy-800); margin-bottom: 3px; }
.ex-mode p { font-size: 13px; color: var(--slate); margin: 0; }

/* ---------- category chips ---------- */
.ex-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ex-chip {
  background: var(--white); border: 1px solid var(--line); color: var(--navy-700);
  border-radius: 999px; padding: 9px 16px; font-family: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.ex-chip:hover { background: var(--navy-800); color: var(--gold); border-color: var(--navy-800); transform: translateY(-2px); }
.ex-chip small { opacity: .6; font-weight: 500; margin-inline-start: 4px; }

.ex-note { margin-top: 26px; font-size: 13px; color: var(--slate); line-height: 1.8; }

/* ---------- quiz ---------- */
.ex-qbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ex-pill {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 700; font-size: 13px;
  background: var(--white); border: 1px solid var(--line); color: var(--navy-700); padding: 6px 14px; border-radius: 999px;
}
.ex-pill.is-cat { background: var(--navy-800); color: var(--gold-soft); border-color: var(--navy-800); }
.ex-pill.is-timer { color: #a67d1f; }
.ex-pillset { display: inline-flex; gap: 8px; }

.ex-progress { height: 9px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.ex-progress > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); transition: width .4s var(--ease); }

.ex-card { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: clamp(20px, 3.5vw, 30px); box-shadow: var(--shadow-md); }
.ex-qnum { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--gold); margin-bottom: 8px; }
.ex-question { font-size: clamp(17px, 2.6vw, 20px); font-weight: 600; color: var(--ink); line-height: 1.7; margin-bottom: 20px; }

.ex-badge-lvl {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  padding: 4px 11px; border-radius: 999px; margin-inline-start: 8px; vertical-align: middle;
}
.ex-badge-lvl .d { width: 7px; height: 7px; border-radius: 50%; }
.ex-lvl-1 { background: #e7f6ee; color: #0f7a43; } .ex-lvl-1 .d { background: #15a35b; }
.ex-lvl-2 { background: #fdf3da; color: #9a6f0d; } .ex-lvl-2 .d { background: #e0a516; }
.ex-lvl-3 { background: #efeafd; color: #5b32c2; } .ex-lvl-3 .d { background: #7c3aed; }

.ex-opts { display: flex; flex-direction: column; gap: 11px; }
.ex-opt {
  display: flex; align-items: center; gap: 13px; text-align: right; width: 100%; font-family: inherit;
  background: var(--bg-alt); border: 1.6px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; font-size: 15.5px; color: var(--ink); cursor: pointer; line-height: 1.55;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}
.ex-opt:not(.is-locked):hover { border-color: var(--navy-600); background: #fff; transform: translateX(-3px); }
[dir="rtl"] .ex-opt:not(.is-locked):hover { transform: translateX(3px); }
.ex-opt .key {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; background: #fff; border: 1px solid var(--line); color: var(--navy-700);
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.ex-opt .txt { flex: 1; }
.ex-opt .mark { margin-inline-start: auto; font-weight: 800; font-size: 18px; opacity: 0; }
.ex-opt.is-locked { cursor: default; }
.ex-opt.is-selected { border-color: var(--navy-700); background: #fff; }
.ex-opt.is-selected .key { background: var(--navy-800); color: var(--gold); border-color: var(--navy-800); }
.ex-opt.is-correct { border-color: #36a06a; background: #e9f7ef; }
.ex-opt.is-correct .key { background: #1d7a4d; color: #fff; border-color: #1d7a4d; }
.ex-opt.is-correct .mark { opacity: 1; color: #1d7a4d; }
.ex-opt.is-wrong { border-color: #d4666f; background: #fceced; }
.ex-opt.is-wrong .key { background: #b03a3a; color: #fff; border-color: #b03a3a; }
.ex-opt.is-wrong .mark { opacity: 1; color: #b03a3a; }
.ex-opt.is-dim { opacity: .6; }

.ex-feedback { display: none; margin-top: 18px; border-radius: var(--radius-sm); padding: 15px 17px; font-size: 14.5px; line-height: 1.85; animation: exPop .3s var(--ease) both; }
.ex-feedback.show { display: block; }
.ex-feedback.is-ok { background: #e9f7ef; border: 1px solid #bfe3cd; border-right: 4px solid #36a06a; color: #155f3a; }
.ex-feedback.is-no { background: #fceced; border: 1px solid #eecdcf; border-right: 4px solid #d4666f; color: #8a2a2f; }
[dir="rtl"] .ex-feedback.is-ok { border-right: 1px solid #bfe3cd; border-left: 4px solid #36a06a; }
[dir="rtl"] .ex-feedback.is-no { border-right: 1px solid #eecdcf; border-left: 4px solid #d4666f; }
.ex-feedback .fb-h { font-family: var(--font-head); font-weight: 800; margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.ex-feedback .fb-correct { font-weight: 700; }
.ex-ref { display: inline-block; margin-top: 10px; font-family: var(--font-head); font-weight: 700; font-size: 12px; color: var(--navy-700); background: rgba(16,42,77,.06); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; }

.ex-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.ex-hint { font-size: 13px; color: var(--slate); }

/* buttons */
.ex-btn { font-family: var(--font-head); font-weight: 700; font-size: 15.5px; border: none; cursor: pointer; border-radius: 12px; padding: 13px 26px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease); }
.ex-btn-primary { background: var(--navy-800); color: #fff; box-shadow: var(--shadow-sm); }
.ex-btn-primary:hover { background: var(--navy-700); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ex-btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.ex-btn-gold { background: var(--gold); color: var(--navy-900); }
.ex-btn-gold:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ex-btn-ghost { background: transparent; color: var(--navy-800); border: 1.6px solid var(--line); }
.ex-btn-ghost:hover { border-color: var(--navy-700); transform: translateY(-2px); }

/* ---------- results ---------- */
.ex-result-head { text-align: center; }
.ex-ring {
  --p: 0; width: 168px; height: 168px; border-radius: 50%; margin: 4px auto 16px;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--bg-alt) 0);
}
.ex-ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.ex-ring .rv { position: relative; text-align: center; }
.ex-ring .rv b { display: block; font-family: var(--font-head); font-weight: 800; font-size: 44px; color: var(--navy-800); line-height: 1; }
.ex-ring .rv span { font-size: 13px; color: var(--slate); }
.ex-verdict { font-family: var(--font-head); font-weight: 800; font-size: clamp(20px, 3vw, 26px); margin-bottom: 6px; }
.ex-verdict.is-pass { color: #1d7a4d; }
.ex-verdict.is-mid { color: #a67d1f; }
.ex-verdict.is-low { color: #b03a3a; }
.ex-result-sub { color: var(--slate); font-size: 15.5px; }
.ex-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

.ex-subhead { font-family: var(--font-head); font-weight: 800; font-size: 15px; color: var(--slate); margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }
.ex-subhead::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.ex-breakdown { display: grid; gap: 12px; }
.ex-brow { display: flex; align-items: center; gap: 14px; }
.ex-brow .nm { font-size: 14px; font-weight: 600; color: var(--navy-800); width: 230px; flex: none; }
.ex-brow .bar { flex: 1; height: 10px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); overflow: hidden; }
.ex-brow .bar > i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .9s var(--ease); }
.ex-brow .sc { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--slate); width: 56px; text-align: left; }

.ex-review { display: grid; gap: 12px; }
.ex-rev { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); border-right: 4px solid #d4666f; }
[dir="rtl"] .ex-rev { border-right: 1px solid var(--line-soft); border-left: 4px solid #d4666f; }
.ex-rev .rq { font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 9px; }
.ex-rev .ra { font-size: 14px; margin: 3px 0; display: flex; gap: 7px; }
.ex-rev .ra.bad { color: #b03a3a; }
.ex-rev .ra.good { color: #1d7a4d; }
.ex-rev .rexp { font-size: 13.5px; color: var(--slate); margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); line-height: 1.85; }
.ex-allgood { text-align: center; color: #1d7a4d; font-family: var(--font-head); font-weight: 700; background: #e9f7ef; border: 1px solid #bfe3cd; border-radius: var(--radius-sm); padding: 18px; }

/* inline code inside question / option / explanation text */
.ex-question code, .ex-opt code, .ex-feedback code, .ex-rev code {
  direction: ltr; unicode-bidi: isolate; display: inline-block;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: .88em;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
  padding: 0 7px; color: var(--navy-700);
}

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .ex-stats { grid-template-columns: repeat(2, 1fr); }
  .ex-brow .nm { width: 140px; font-size: 12.5px; }
  .ex-nav { flex-direction: column-reverse; align-items: stretch; }
  .ex-nav .ex-btn { width: 100%; }
  .ex-actions .ex-btn { flex: 1; }
}

/* ---------- STUDY GUIDE (SEO & STUDY MODE) ---------- */
.ex-study-guide {
  margin-top: 48px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(20px, 3.5vw, 30px);
  box-shadow: var(--shadow-md);
}

.ex-study-guide-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.ex-study-guide-head h2 {
  font-size: clamp(18px, 2.6vw, 22px);
  color: var(--navy-800);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.ex-study-guide-head h2::before {
  content: "";
  width: 7px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(var(--gold), var(--gold-soft));
  flex: none;
}

.ex-study-guide-intro {
  font-size: 14.5px;
  color: var(--slate);
  line-height: 1.7;
  margin-bottom: 24px;
}

.ex-study-cats {
  display: grid;
  gap: 14px;
}

.ex-study-cat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ex-study-cat[open] {
  border-color: var(--gold-soft);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.ex-study-cat-summary {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--navy-800);
  list-style: none; /* Hide default arrow */
}

.ex-study-cat-summary::-webkit-details-marker {
  display: none; /* Hide default arrow for Safari */
}

.ex-study-cat-summary h4 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ex-study-cat-summary .count {
  font-size: 12.5px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--slate);
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-head);
}

.ex-study-cat[open] .ex-study-cat-summary {
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.ex-study-questions-list {
  padding: 20px;
  display: grid;
  gap: 20px;
}

.ex-study-q-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: transform 0.2s ease;
}

.ex-study-q-card:hover {
  transform: translateY(-2px);
  border-color: var(--line);
}

.ex-study-q-card .q-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 14px;
}

.ex-study-q-card .q-options {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: grid;
  gap: 8px;
}

.ex-study-q-card .q-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14.5px;
  border-radius: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--line-soft);
}

.ex-study-q-card .q-opt.correct {
  background: #e9f7ef;
  border-color: #bfe3cd;
  color: #155f3a;
  font-weight: 600;
}

.ex-study-q-card .q-opt .key {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--slate);
}

.ex-study-q-card .q-opt.correct .key {
  background: #1d7a4d;
  color: #fff;
  border-color: #1d7a4d;
}

.ex-study-q-card .q-exp {
  font-size: 13.5px;
  color: var(--slate);
  background: #fcfcfc;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  line-height: 1.8;
  margin-bottom: 8px;
}

.ex-study-q-card .q-ref {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-700);
  background: rgba(16,42,77,.04);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}

.ex-study-ctrls .ex-btn-ghost {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

/* ---------- "about this exam" — static crawlable content on the home screen ---------- */
.ex-about { margin-top: 44px; }
.ex-about p { color: var(--slate); font-size: 15px; line-height: 1.95; margin: 0 2px 14px; }
.ex-about h3 { font-size: 16.5px; color: var(--navy-800); margin: 26px 2px 12px; }
.ex-about-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 6px; }
.ex-about-list li {
  font-size: 13.5px; color: var(--navy-700); background: rgba(16,42,77,.04);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; line-height: 1.6;
}
.ex-sample { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.ex-sample summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 14px 16px; line-height: 1.7; }
.ex-sample summary:hover { color: var(--navy-700); }
.ex-sample[open] summary { border-bottom: 1px solid var(--line); background: rgba(16,42,77,.02); }
.ex-sample p { padding: 0 16px; margin: 12px 0; }
.ex-about-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.ex-about-links a { color: var(--navy-700); font-weight: 600; }
.ex-about-links a:hover { color: var(--gold); }
