/* ===== IST – UI ter-scope (match CFIT, anti-bentrok tema) ===== */
#ist-app, #ist-app * { box-sizing: border-box; }
#ist-app img { max-width: 100%; height: auto; display: block; }
#ist-app h1,#ist-app h2,#ist-app h3,#ist-app p{ margin:0; }
#ist-app :where(button,input,select,textarea){ font:inherit; }

/* Vars (selaras CFIT) */
#ist-app{
  --primary:#1747A6; --primary-600:#123A86; --primary-100:#E7EEF9;
  --bg:#ffffff; --panel:#ffffff; --text:#0F172A; --muted:#6B7280; --border:#E5E7EB;
  --shadow:0 10px 30px rgba(15,23,42,.06); --radius:14px;
  --prompt-maxw:700px; --opt-minh:150px; --opt-maxw:80%; --opt-maxh:80%;
  color:var(--text); background:var(--bg); padding:20px; border-radius:var(--radius);
}

/* Container max width agar konten tidak melebar */
#ist-app .ist-wrap { max-width: 980px; margin: 0 auto; }

/* Card/panel */
#ist-app .ist-card{
  background:var(--panel); border:1px solid var(--border);
  border-radius:16px; padding:22px; box-shadow:var(--shadow); margin-bottom:18px;
}

/* Headings & text */
#ist-app h2{ margin:0 0 10px; letter-spacing:.2px; }
#ist-app p, #ist-app .note{ color:var(--muted); }

/* Buttons (override tema) */
#ist-app .ist-btn{
  appearance:none; -webkit-tap-highlight-color:transparent;
  background:var(--primary); color:#fff !important;
  border:1px solid var(--primary); border-radius:12px; padding:12px 18px;
  font-weight:700; letter-spacing:.2px; cursor:pointer;
  transition:transform .06s, filter .2s, box-shadow .2s;
  box-shadow:0 6px 14px rgba(23,71,166,.18); text-decoration:none !important;
  display:inline-flex; align-items:center; gap:8px;
}
#ist-app .ist-btn:hover{ filter:brightness(1.05); }
#ist-app .ist-btn:active{ transform:translateY(1px); }
#ist-app .ist-btn:disabled{ opacity:.55; cursor:not-allowed; box-shadow:none; }
#ist-app .ist-btn.ghost{
  background:#fff; color:var(--primary) !important; border:1px solid var(--primary); box-shadow:none;
}
#ist-app .ist-btn.ghost:hover{ background:var(--primary-100); }

/* Pills (subtest & timer) */
#ist-app .ist-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  background:var(--primary-100); border:1px solid rgba(23,71,166,.25);
  color:var(--primary); font-size:13px; font-weight:700;
}
#ist-app .ist-top{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }

/* Icon jam pasir di timer */
#ist-app .ist-timer{ position:relative; padding-left:24px; }
#ist-app .ist-timer::before{
  content:""; position:absolute; left:6px; top:50%; transform:translateY(-50%);
  width:14px; height:14px; background: currentColor;
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 3h12v2h-1c0 2.1-1.2 3.9-3 4.6V12c1.8.7 3 2.5 3 4.6h1v2H6v-2h1c0-2.1 1.2-3.9 3-4.6V9.6C8.2 8.9 7 7.1 7 5H6V3z"/></svg>') no-repeat center/contain;
          mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 3h12v2h-1c0 2.1-1.2 3.9-3 4.6V12c1.8.7 3 2.5 3 4.6h1v2H6v-2h1c0-2.1 1.2-3.9 3-4.6V9.6C8.2 8.9 7 7.1 7 5H6V3z"/></svg>') no-repeat center/contain;
  color:var(--primary);
}

/* Progress = progres soal */
#ist-app .ist-progress{
  height:10px; background:#F1F5F9; border-radius:999px; overflow:hidden; border:1px solid #EEF2F7;
}
#ist-app .ist-bar{ height:100%; width:0%; background:var(--primary); transition:width .3s ease; }

/* ===== Intro hero (card atas) ===== */
#ist-app #ist-intro{ border-radius:18px; box-shadow:0 10px 30px rgba(0,0,0,.08); }
#ist-app #ist-intro .badge{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px; color:#0f172a; background:#f3f4f6; border:1px solid #e5e7eb;
  padding:6px 10px; border-radius:999px; margin-bottom:10px;
}
#ist-app #ist-intro .badge svg{ width:18px; height:18px; }
#ist-app #ist-intro .title{
  font-size:clamp(22px,2.4vw,30px); margin:6px 0 8px; line-height:1.22; font-weight:800;
}
#ist-app #ist-intro .desc{ color:#334155; font-size:15px; line-height:1.7; margin:0 0 16px; max-width:72ch; }
#ist-app #ist-intro .meta{ display:flex; flex-wrap:wrap; gap:12px; margin:10px 0 18px; color:#1f2937; font-size:14px; }
#ist-app #ist-intro .chip{
  display:inline-flex; align-items:center; gap:8px; background:#eef2ff; border:1px dashed #c7d2fe;
  padding:10px 12px; border-radius:10px; white-space:nowrap;
}

/* ===== Area soal konsisten (tidak “lompat”) ===== */
#ist-app .ist-q{
  max-width: calc(var(--prompt-maxw) + 40px);
  margin: 0 auto;
  min-height: 420px;    /* kunci tinggi minimum */
  display:flex; flex-direction:column;
}
#ist-app .ist-qhead{ margin-bottom:8px; display:flex; justify-content:center; }
#ist-app .ist-badge{
  display:inline-block; padding:4px 10px; border-radius:999px;
  background:#0ea5e9; color:#fff; font-weight:700; font-size:12px;
}
#ist-app .ist-prompt{ text-align:center; margin-bottom:12px; }
#ist-app .ist-prompt img{
  display:block; margin:10px auto;
  max-width: var(--prompt-maxw) !important; width:100%; height:auto; border:none; border-radius:8px;
}

/* ===== Opsi – Teks vertikal & Gambar grid ===== */

/* TEKS (menurun) */
#ist-app .ist-choices.text-list{ display:flex; flex-direction:column; gap:10px; }
#ist-app .ist-choices.text-list .ist-opt{
  width:100%; text-align:left; display:flex; gap:10px; align-items:flex-start;
  background:#fff; border:1px solid var(--border); border-radius:12px; padding:12px 14px; cursor:pointer;
  transition:.15s border-color, .06s transform, .15s background, .15s box-shadow; color:var(--text);
}
#ist-app .ist-choices.text-list .ist-opt:hover{ border-color:rgba(23,71,166,.45); box-shadow:0 8px 18px rgba(23,71,166,.08); background:#FAFCFF; }
#ist-app .ist-choices.text-list .ist-opt .key{ min-width:26px; font-weight:800; color:var(--primary); }
#ist-app .ist-choices.text-list .ist-opt.sel{ border-color:var(--primary); box-shadow:0 0 0 2px rgba(23,71,166,.18) inset; background:#fff; }

/* GAMBAR (grid A–E menyamping) */
#ist-app .ist-choices.image-grid{
  display:grid; grid-template-columns:repeat(2, minmax(120px,1fr)); gap:12px; counter-reset: istopt;
}
@media (min-width:640px){  #ist-app .ist-choices.image-grid{ grid-template-columns:repeat(4, minmax(130px,1fr)); } }
@media (min-width:1024px){ #ist-app .ist-choices.image-grid{ grid-template-columns:repeat(5, minmax(140px,1fr)); } }

#ist-app .ist-choices.image-grid .ist-opt{
  position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:var(--opt-minh); padding:34px 10px 10px;
  border-radius:12px; background:#fff; cursor:pointer; border:1px solid var(--border);
  transition:.15s border-color, .15s box-shadow, .06s transform, .15s background; color:var(--text);
}
#ist-app .ist-choices.image-grid .ist-opt:hover{ border-color:rgba(23,71,166,.45); box-shadow:0 8px 18px rgba(23,71,166,.08); background:#FAFCFF; }
#ist-app .ist-choices.image-grid .ist-opt::before{
  counter-increment: istopt; content:counter(istopt, upper-alpha);
  position:absolute; top:8px; left:50%; transform:translateX(-50%);
  padding:2px 8px; border-radius:999px; font-weight:700; font-size:12px; color:var(--primary);
  background:#fff; border:1px solid #e5e7eb;
}
#ist-app .ist-choices.image-grid .ist-opt .val img{
  max-width:var(--opt-maxw); max-height:var(--opt-maxh); object-fit:contain; display:block; margin:0 auto; border-radius:8px;
}
#ist-app .ist-choices.image-grid .ist-opt.sel{ border-color:var(--primary); box-shadow:0 0 0 2px rgba(23,71,166,.18) inset; background:#fff; }

/* Input ketik */
#ist-app .ist-input{ width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:12px; }

/* Meta & actions */
#ist-app .ist-meta{ color:var(--muted); font-size:13px; margin-top:6px; text-align:center; }
#ist-app .ist-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:14px; }
@media (max-width:639.98px){ #ist-app .ist-actions{ flex-direction:column; align-items:stretch; gap:10px; } }

/* Hasil */
#ist-app .ist-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-top:12px; }
#ist-app .ist-stat{ padding:14px; border:1px solid var(--border); background:#fff; border-radius:12px; }
#ist-app .ist-stat .k{ font-size:22px; font-weight:800; }
#ist-app .ist-stat .l{ font-size:12px; color:var(--muted); }

/* Tabs Auth (judul kecil seperti CFIT) */
#ist-app .ist-auth-title{
  display:inline-block; margin-bottom:10px; padding:6px 12px; border-radius:999px;
  background:#eef2ff; border:1px dashed #c7d2fe; color:#1f2937; font-weight:700; font-size:13px;
}
#ist-app .ist-tabs{ display:flex; gap:8px; margin-bottom:12px; }
#ist-app .ist-tab{
  background:#fff; border:1px solid var(--border); color:var(--primary);
  padding:6px 12px; border-radius:999px; cursor:pointer; font-weight:700;
}
#ist-app .ist-tab.ist-tab-active{ background:var(--primary-100); border-color:rgba(23,71,166,.35); }
#ist-app .ist-panels label{ display:block; margin-bottom:10px; color:var(--text); font-weight:600; }
#ist-app .ist-panels input{ width:100%; margin-top:6px; padding:10px 12px; border-radius:10px; border:1px solid var(--border); background:#fff; }

/* Helper */
#ist-app .ist-hide{ display:none !important; }

/* === IST: Samakan lebar & skala intro dengan CFIT === */

/* gutter halaman setara CFIT */
#ist-app{ padding:20px 10px; }

/* semua kartu dibatasi max-width yg sama seperti CFIT */
#ist-app .ist-card{
  max-width:1100px;        /* == CFIT */
  margin-left:auto;
  margin-right:auto;
}

/* Intro hero persis seperti CFIT */
#ist-app .ist-card#ist-intro{
  border-radius:18px;
  padding:24px;            /* padding sama */
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  border:1px solid #e5e7eb;
}

/* Tipografi & chip di intro — samakan skala */
#ist-app #ist-intro .title{
  font-size:clamp(22px, 2.4vw, 30px);
  line-height:1.2;
  margin:10px 0 8px;
  letter-spacing:.2px;
  font-weight:800;
}
#ist-app #ist-intro .desc{
  color:#334155;
  font-size:14.5px;
  line-height:1.65;
  margin:0 0 14px;
  max-width:72ch;          /* lebar teks sama */
}
#ist-app #ist-intro .badge{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px; color:#0f172a;
  background:#f3f4f6; border:1px solid #e5e7eb;
  padding:6px 10px; border-radius:999px; margin-bottom:10px;
}
#ist-app #ist-intro .badge svg{ width:18px; height:18px; }
#ist-app #ist-intro .meta{
  display:flex; flex-wrap:wrap; gap:12px;
  margin:12px 0 18px; color:#1f2937; font-size:14px;
}
#ist-app #ist-intro .chip{
  display:inline-flex; align-items:center; gap:8px;
  background:#eef2ff; border:1px dashed #c7d2fe;
  padding:8px 10px; border-radius:10px; white-space:nowrap;
}
#ist-app #ist-intro .chip svg{ width:18px; height:18px; }

/* Tombol utama sama feel-nya */
#ist-app #ist-intro .ist-btn.hero{
  display:inline-flex; align-items:center; gap:10px;
  padding:12px 18px; border-radius:12px;
  background:#1747A6; border:1px solid #1747A6;
  color:#fff; font-weight:700; letter-spacing:.2px;
  box-shadow:0 6px 14px rgba(23,71,166,.18);
  transition: background .2s, border-color .2s, transform .06s;
}
#ist-app #ist-intro .ist-btn.hero:hover{
  background:#123A86; border-color:#123A86;
}
#ist-app #ist-intro .ist-btn.hero:active{ transform:translateY(1px); }
#ist-app #ist-intro .ist-btn.hero svg{ width:18px; height:18px; }

/* Responsif kecil: padding & teks ikut CFIT */
@media (max-width:640px){
  #ist-app .ist-card{ margin-left:12px; margin-right:12px; }
  #ist-app #ist-intro{ padding:18px; }
  #ist-app #ist-intro .desc{ font-size:14.5px; }
}

/* ===== IST – Auth (samakan dengan CFIT) ===== */
#ist-app #ist-auth{
  position: relative;
  max-width: 1080px;      /* lebar sama seperti kartu CFIT */
  margin: 0 auto;
}

/* Badge judul di atas panel (tanpa ubah HTML) */
#ist-app #ist-auth::before{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 12px; border-radius:999px;
  background:#F3F4F6; color:#0F172A;
  border:1px solid #E5E7EB;
  font-weight:700; font-size:13px;
  position: relative; top: -6px; left: 6px;
}

/* Tabs login/daftar ala CFIT */
#ist-app .ist-tabs{ display:flex; gap:10px; margin:10px 0 12px; }
#ist-app .ist-tab{
  background:#fff; border:1px solid #E5E7EB; color:#1747A6;
  padding:8px 14px; border-radius:999px; font-weight:700; cursor:pointer;
}
#ist-app .ist-tab.ist-tab-active{
  background:#E7EEF9; border-color:rgba(23,71,166,.35);
}

/* Panel form ditumpuk (stacked) dan center, sama seperti CFIT */
#ist-app .ist-panels{
  max-width: 820px;
  margin: 0 auto;
}
#ist-app .ist-panel{
  display:block;
}
#ist-app .ist-panel label{
  display:block;
  margin: 10px 0 8px;
  color:#0F172A; font-weight:500;
}
#ist-app .ist-panel input{
  display:block;
  width:100%;
  margin-top:6px;
  padding:12px 14px;
  border:1px solid #E5E7EB;
  border-radius:10px;
  background:#fff;
}

/* Tombol di kiri bawah seperti CFIT */
#ist-app #ist-auth .ist-btn{
  margin-top: 12px;
  display:inline-flex; align-items:center; gap:10px;
  background:#1747A6; border:1px solid #1747A6; color:#fff;
  border-radius:12px; padding:12px 18px; font-weight:600;
  box-shadow:0 6px 14px rgba(23,71,166,.18);
}

/* Responsif – tetap stacked di mobile */
@media (max-width:640px){
  #ist-app #ist-auth::before{ left: 0; }
  #ist-app .ist-panels{ max-width:100%; }
}

/* ===== IST – Container width mengikuti CFIT ===== */
#ist-app.ist-wrap{ max-width:1100px; margin:0 auto; padding:6px 10px 24px; }

/* ===== IST – Voucher (selaras CFIT) ===== */
#ist-app #ist-voucher.ist-card{
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  padding:22px;
}
#ist-app #ist-voucher .ist-badge{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px; color:#0f172a;
  background:#f3f4f6; border:1px solid var(--border);
  padding:6px 10px; border-radius:999px; margin-bottom:10px;
}
#ist-app #ist-voucher .ist-badge svg{ width:18px; height:18px; }

#ist-app #ist-voucher .ist-subnote{
  color:#6b7280; font-size:14.5px; line-height:1.65;
  margin: 2px 0 16px;
}

#ist-app #ist-voucher .ist-voucher-row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:12px;
  align-items:center;
}
#ist-app #ist-voucher input#ist-vouch-code{
  width:100%;
  height:52px;
  padding:0 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  font-size:15px;
}
#ist-app #ist-voucher input#ist-vouch-code::placeholder{ color:#9aa3af; }
#ist-app #ist-voucher .ist-btn{
  height:52px; padding:0 18px; border-radius:12px;
}

/* responsif */
@media (max-width:640px){
  #ist-app #ist-voucher .ist-voucher-row{
    grid-template-columns: 1fr;
  }
  #ist-app #ist-voucher .ist-btn{ width:100%; }
}
/* ===== IST – Atur lebar gambar SOAL untuk Subtes 7 & 8 (responsive) ===== */
/* desktop / default */
#ist-app[data-sub="7"] .ist-prompt img,
#ist-app[data-sub="8"] .ist-prompt img{
  width:20% !important;            /* 20% pada PC */
  max-width:none !important;       /* override aturan global max-width */
  height:auto !important;
  display:block;
  margin-left:auto; margin-right:auto; /* tetap center */
}

/* tablet */
@media (max-width:1024px){
  #ist-app[data-sub="7"] .ist-prompt img,
  #ist-app[data-sub="8"] .ist-prompt img{
    width:35% !important;          /* 35% pada tablet */
  }
}

/* handphone */
@media (max-width:640px){
  #ist-app[data-sub="7"] .ist-prompt img,
  #ist-app[data-sub="8"] .ist-prompt img{
    width:50% !important;          /* 50% pada HP */
  }
}

#ist-app #ist-result .k { font-weight:800; }
#ist-app #ist-result #ist-label { font-size:20px; font-weight:900; }

#ist-app #ist-result #ist-label{
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
}

/* Membuat .ist-voucher-row jadi flex row dan rapih */
#ist-app #ist-voucher .ist-voucher-row {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Input usia full lebar */
#ist-app #ist-voucher #ist-age {
  flex: 1 1 120px;
  min-width: 90px;
  height: 48px;
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
}

/* Input kode voucher fleksibel lebar */
#ist-app #ist-voucher #ist-vouch-code {
  flex: 3 1 auto;
  height: 48px;
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
}

/* Tombol Gunakan tinggi sama input dan border-radius konsisten */
#ist-app #ist-voucher #ist-vouch-check {
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  min-width: 100px;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Responsive: stack vertikal jika layar kecil */
@media (max-width: 640px) {
  #ist-app #ist-voucher .ist-voucher-row {
    flex-direction: column;
    gap: 10px;
  }
  #ist-app #ist-voucher #ist-vouch-check {
    width: 100%;
    min-width: auto;
  }
}

/* Fase ingatan subtes 9 */
.ist-memory-exposure {
  text-align: center;
  padding: 20px;
}
.ist-memory-exposure h3 {
  margin-bottom: 20px;
  color: var(--primary);
}
.ist-memory-item {
  display: inline-block;
  margin: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  min-width: 120px;
  text-align: center;
}
.ist-memory-item img {
  max-width: 100px;
  height: auto;
}

/* Responsif untuk mobile */
@media (max-width: 640px) {
  .ist-memory-item {
    display: block;
    margin: 10px 0;
  }
}