/* ============================================================
   Soal Pilihan Ganda — style.css
   Credit: lautandigital.id
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #4f46e5;
  --primary-dk:   #3730a3;
  --primary-lt:   #e0e7ff;
  --success:      #16a34a;
  --success-lt:   #dcfce7;
  --danger:       #dc2626;
  --danger-lt:    #fee2e2;
  --warn:         #ca8a04;
  --warn-lt:      #fef9c3;
  --neutral:      #6b7280;
  --neutral-lt:   #f3f4f6;
  --text:         #111827;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --radius:       14px;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
  --transition:   .2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 50%, #dbeafe 100%);
  min-height: 100vh;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ── Layout ────────────────────────────────────────────────── */
.wrapper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  flex: 1;
}

/* ── Header ────────────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: 28px;
}
.header-logo { font-size: 2.8rem; line-height: 1; }
.header-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-dk);
  margin-top: 8px;
}
.header-sub { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

/* ── Screens ───────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Start Screen ──────────────────────────────────────────── */
.start-card {
  text-align: center;
  padding: 48px 40px;
}
.start-icon { font-size: 3.5rem; margin-bottom: 16px; }
.start-card h2 { font-size: 1.5rem; font-weight: 700; color: var(--primary-dk); }
.start-card p  { color: var(--text-muted); margin: 12px 0 24px; line-height: 1.6; }
.start-info {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.start-info li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 22px;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.97); }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:not(:disabled):hover  { background: var(--primary-dk); }

.btn-secondary { background: var(--neutral-lt); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:not(:disabled):hover { background: var(--border); }

.btn-lg { padding: 14px 36px; font-size: 1rem; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }

/* ── Progress ──────────────────────────────────────────────── */
.progress-wrap { margin-bottom: 16px; }
.progress-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: .82rem;
  color: var(--text-muted);
}
.timer-wrap { font-weight: 700; color: var(--primary-dk); }

/* ── Question Card ─────────────────────────────────────────── */
.question-card { margin-bottom: 20px; }
.question-number {
  display: inline-block;
  background: var(--primary-lt);
  color: var(--primary-dk);
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  margin-bottom: 14px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 24px;
  color: var(--text);
}

/* ── Options ───────────────────────────────────────────────── */
.options-wrap { display: flex; flex-direction: column; gap: 10px; }

.option-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  user-select: none;
}
.option-label:hover { border-color: var(--primary); background: var(--primary-lt); }
.option-label:active { transform: scale(.99); }

.option-label input[type="radio"] { display: none; }

.option-key {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--neutral-lt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.option-text { font-size: .95rem; line-height: 1.5; }

/* Selected state */
.option-label.selected { border-color: var(--primary); background: var(--primary-lt); }
.option-label.selected .option-key {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Review correct / wrong */
.option-label.is-correct { border-color: var(--success); background: var(--success-lt); pointer-events: none; }
.option-label.is-correct .option-key { background: var(--success); border-color: var(--success); color: #fff; }

.option-label.is-wrong { border-color: var(--danger); background: var(--danger-lt); pointer-events: none; }
.option-label.is-wrong .option-key { background: var(--danger); border-color: var(--danger); color: #fff; }

.option-label.is-neutral { pointer-events: none; opacity: .6; }

/* ── Navigation ────────────────────────────────────────────── */
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.question-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}
.qdot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.qdot.answered { background: var(--primary); }
.qdot.current  { background: var(--primary-dk); box-shadow: 0 0 0 2px var(--primary-lt); }

/* ── Result Screen ─────────────────────────────────────────── */
.result-card { text-align: center; padding: 40px 32px; }
.result-icon { font-size: 3rem; margin-bottom: 12px; }
.result-card h2 { font-size: 1.5rem; font-weight: 700; color: var(--primary-dk); margin-bottom: 24px; }

.score-ring {
  position: relative;
  width: 140px;
  margin: 0 auto 20px;
}
.ring-svg { width: 140px; height: 140px; transform: rotate(-90deg); }
.ring-bg  { fill: none; stroke: var(--border); stroke-width: 10; }
.ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s ease;
}
.score-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#score-value { font-size: 2.2rem; font-weight: 800; color: var(--primary-dk); }
.score-text small { font-size: .9rem; color: var(--text-muted); }

.result-desc { color: var(--text-muted); margin-bottom: 24px; font-size: .95rem; }

.result-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}
.stat {
  flex: 1;
  max-width: 90px;
  padding: 14px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat span { font-size: 1.6rem; font-weight: 800; }
.stat small { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat.correct { background: var(--success-lt); color: var(--success); }
.stat.wrong   { background: var(--danger-lt);  color: var(--danger);  }
.stat.skip    { background: var(--warn-lt);    color: var(--warn);    }

.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Review Screen ─────────────────────────────────────────── */
.review-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.review-header h2 { font-size: 1.25rem; font-weight: 700; color: var(--primary-dk); }

.review-list { display: flex; flex-direction: column; gap: 16px; }
.review-item { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.review-item .question-number { margin-bottom: 10px; }
.review-item .question-text   { font-size: 1rem; margin-bottom: 16px; }
.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 16px;
}
.badge-correct { background: var(--success-lt); color: var(--success); }
.badge-wrong   { background: var(--danger-lt);  color: var(--danger);  }
.badge-skip    { background: var(--warn-lt);    color: var(--warn);    }

.review-explanation {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--neutral-lt);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 18px 16px;
  font-size: .8rem;
  color: var(--text-muted);
}
.footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card       { padding: 20px 16px; }
  .start-card { padding: 32px 20px; }
  .start-info { gap: 12px; }
  .header-title { font-size: 1.4rem; }
  .question-text { font-size: 1rem; }
  .nav-wrap   { gap: 8px; }
  .btn        { padding: 9px 14px; font-size: .82rem; }
  .result-stats { gap: 10px; }
}
