/* ============================================================
   PRISAIN — Sistem Test Online
   Main Stylesheet
   Brand color: #86AB80 (sage green)
   ============================================================ */

:root {
  --primary:        #86AB80;
  --primary-dark:   #5d8a57;
  --primary-light:  #b5cdb2;
  --primary-xlight: #e8f2e7;
  --primary-bg:     #f0f7ef;
  --white:          #ffffff;
  --text-dark:      #1e3a1a;
  --text-mid:       #3d5c39;
  --text-light:     #6b8f66;
  --border:         #c8ddc5;
  --shadow:         0 4px 20px rgba(134,171,128,0.18);
  --shadow-lg:      0 8px 40px rgba(134,171,128,0.25);
  --radius:         14px;
  --radius-sm:      8px;
  --danger:         #c0392b;
  --danger-light:   #fdecea;
  --success:        #27ae60;
  --success-light:  #e8f8ee;
  --warning:        #e67e22;
  --warning-light:  #fef3e2;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--primary-bg);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 3px solid var(--primary);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.navbar-brand img {
  height: 44px;
  width: auto;
}
.navbar-title h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}
.navbar-title p {
  font-size: 0.78rem;
  color: var(--text-light);
}
.navbar-badge {
  margin-left: auto;
  background: var(--primary);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── Hero / Landing ───────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-xlight) 0%, var(--white) 60%);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: var(--primary-light);
  border-radius: 50%;
  opacity: 0.25;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 220px; height: 220px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.12;
}
.hero-logo {
  width: 130px;
  height: 130px;
  object-fit: contain;
  margin: 0 auto 1.25rem;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(134,171,128,0.35));
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.hero h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}
.hero h2 span { color: var(--primary-dark); }
.hero-sub {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto 0.5rem;
  position: relative;
  z-index: 1;
}

/* ── Card Container ───────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

/* ── Test Selection Buttons ───────────────────────────────── */
.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 720px;
}
.test-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  color: var(--text-dark);
  display: block;
}
.test-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  text-decoration: none;
  color: var(--text-dark);
}
.test-card-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-xlight);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
}
.test-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}
.test-card p {
  font-size: 0.87rem;
  color: var(--text-light);
  line-height: 1.5;
}
.test-card .badge-info {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.test-card .badge-info span {
  background: var(--primary-xlight);
  color: var(--primary-dark);
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-size: 0.73rem;
  font-weight: 600;
}

/* ── Mahasiswa Photo Strip ────────────────────────────────── */
.photo-strip {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--white);
}
.photo-strip h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.photo-strip p {
  font-size: 0.9rem;
  opacity: 0.88;
  margin-bottom: 1.75rem;
}
.photo-avatars {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.avatar-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.7);
  overflow: hidden;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--white);
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-item span {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 500;
}

/* ── Form ─────────────────────────────────────────────────── */
.form-header {
  text-align: center;
  margin-bottom: 2rem;
}
.form-header img {
  width: 70px;
  margin-bottom: 1rem;
}
.form-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}
.form-header p {
  color: var(--text-light);
  font-size: 0.9rem;
}
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-mid);
  font-size: 0.92rem;
}
.form-group label span.req { color: var(--danger); }
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(134,171,128,0.2);
}
.form-info-box {
  background: var(--primary-xlight);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.87rem;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
}
.form-info-box strong { color: var(--primary-dark); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 15px rgba(93,138,87,0.4);
  transform: translateY(-1px);
  color: var(--white);
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-xlight);
  color: var(--primary-dark);
  text-decoration: none;
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover {
  background: #a93226;
  color: var(--white);
  text-decoration: none;
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
}

/* ── Quiz Layout ──────────────────────────────────────────── */
.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
@media (max-width: 768px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }
}

/* Timer bar */
.timer-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.timer-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.timer-label { font-size: 0.85rem; color: var(--text-light); }
#timer-display {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', monospace;
}
#timer-display.urgent { color: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

/* Question card */
.question-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--border);
}
.question-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.q-number {
  background: var(--primary);
  color: var(--white);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.q-section {
  background: var(--primary-xlight);
  color: var(--primary-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}
.q-total {
  margin-left: auto;
  color: var(--text-light);
  font-size: 0.85rem;
}
.question-text {
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

/* Options */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.option-item input[type="radio"] {
  display: none;
}
.option-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  transition: all 0.18s;
  font-size: 0.96rem;
  line-height: 1.5;
}
.option-label:hover {
  border-color: var(--primary);
  background: var(--primary-xlight);
}
.option-item input[type="radio"]:checked + .option-label {
  border-color: var(--primary-dark);
  background: var(--primary-xlight);
  color: var(--primary-dark);
  font-weight: 600;
}
.option-key {
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 24px;
  flex-shrink: 0;
}

/* Navigation buttons */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Question map sidebar */
.q-map-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1px solid var(--border);
  position: sticky;
  top: 80px;
}
.q-map-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 1rem;
  text-align: center;
}
.q-map-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 1rem;
}
.q-map-btn {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--white);
  color: var(--text-light);
  transition: all 0.15s;
  text-align: center;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-map-btn:hover { border-color: var(--primary); background: var(--primary-xlight); }
.q-map-btn.answered { background: var(--primary); color: var(--white); border-color: var(--primary); }
.q-map-btn.current { background: var(--primary-dark); color: var(--white); border-color: var(--primary-dark); box-shadow: 0 0 0 2px rgba(93,138,87,0.4); }
.q-map-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.legend-row { display: flex; align-items: center; gap: 0.5rem; }
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-dot.answered { background: var(--primary); }
.legend-dot.current  { background: var(--primary-dark); }
.legend-dot.empty    { background: var(--white); border: 1px solid var(--border); }

.q-map-progress {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
}
.progress-bar-wrap {
  background: var(--border);
  border-radius: 50px;
  height: 6px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 50px;
  transition: width 0.3s;
}

/* ── Result Page ──────────────────────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 1.5rem;
}
.result-hero h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
  margin-bottom: 0.25rem;
}
.result-hero .score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto 0.5rem;
  background: rgba(255,255,255,0.12);
}
.score-circle .score-num {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}
.score-circle .score-label {
  font-size: 0.78rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-badge {
  display: inline-block;
  padding: 0.4rem 1.25rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}
.status-badge.lulus   { background: var(--success); color: #fff; }
.status-badge.tidak   { background: var(--danger);  color: #fff; }
.status-badge.menengah { background: var(--warning); color: #fff; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  text-align: center;
}
.stat-box .stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}
.stat-box .stat-lbl {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}
.stat-box.benar .stat-val { color: var(--success); }
.stat-box.salah .stat-val { color: var(--danger); }
.stat-box.kosong .stat-val { color: var(--warning); }

/* Answer review table */
.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.review-table th {
  background: var(--primary-xlight);
  color: var(--primary-dark);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}
.review-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.review-table tr:hover td { background: #fafffe; }
.review-table .correct td { background: var(--success-light); }
.review-table .wrong   td { background: var(--danger-light); }

/* Section breakdown */
.section-bars { display: flex; flex-direction: column; gap: 0.85rem; }
.section-bar-row { display: flex; flex-direction: column; gap: 0.3rem; }
.section-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.section-bar-label .name { font-weight: 600; color: var(--text-mid); }
.section-bar-label .val  { color: var(--text-light); }
.section-bar-track {
  background: var(--border);
  border-radius: 50px;
  height: 9px;
  overflow: hidden;
}
.section-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 50px;
  transition: width 0.6s ease;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.82rem;
  margin-top: 3rem;
}
.footer strong { color: var(--primary-light); }

/* ── Alert ────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border-left: 4px solid var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); border-left: 4px solid var(--success); }
.alert-info    { background: var(--primary-xlight); color: var(--primary-dark); border-left: 4px solid var(--primary); }

/* ── Modal overlay (finish confirm) ──────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.modal-box h3 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--text-dark); }
.modal-box p  { color: var(--text-light); margin-bottom: 1.5rem; font-size: 0.92rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 1.25rem; }
  .quiz-nav .btn { flex: 1; }
  .q-map-grid { grid-template-columns: repeat(5, 1fr); }
}
