/* ==========================================================================
   Latihan ASTS Matematika — Rasyid (Style clean, warm ink & high readability)
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #d97706;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --badge-bg: #f1f5f9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .title .badge-tag {
  font-size: 11px;
  background: #fef3c7;
  color: #b45309;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.topbar .sub {
  font-size: 13px;
  color: var(--text-muted);
}

.spacer {
  flex: 1;
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--badge-bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.who:hover {
  background: #e2e8f0;
}

.dot {
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Layout Wrap */
.wrap {
  max-width: 1200px;
  width: 100%;
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 20px;
  flex: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pad {
  padding: 20px;
}

/* Nav Kiri */
.kiri a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 4px;
  transition: background 0.15s;
}

.kiri a:hover {
  background: var(--badge-bg);
}

.kiri a[aria-current="page"] {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.hint {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Main Area */
main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.card-header .cat {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.card-header h2 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tag-assigned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fee2e2;
  color: #b91c1c;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.pertanyaan {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
}

.clue-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: #1e40af;
}

.input-area {
  margin-bottom: 20px;
}

.input-area input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s;
}

.input-area input:focus {
  border-color: var(--primary);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--primary);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  background: var(--badge-bg);
  color: var(--text);
}

.btn.outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn.outline:hover {
  background: var(--primary-light);
}

/* Navigasi Soal Bawah */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

/* Feedback Box */
.feedback-box {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.feedback-box.benar {
  background: var(--success-light);
  border: 1px solid #86efac;
  color: #15803d;
}

.feedback-box.salah {
  background: var(--danger-light);
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.feedback-box .penjelasan {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  font-size: 13.5px;
  color: var(--text);
  white-space: pre-line;
}

/* Side Right Map */
.qmap h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.grid-peta {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

.tile:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.tile.aktif {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  font-weight: 700;
}

.tile.done {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.tile.benar {
  background: var(--success-light);
  border-color: #86efac;
  color: #16a34a;
}

.tile.salah {
  background: var(--danger-light);
  border-color: #fca5a5;
  color: #dc2626;
}

.tile.starred::after {
  content: "⭕";
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 11px;
}

/* Dials Ringkasan */
.dials-wrap {
  display: flex;
  justify-content: space-around;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.dial {
  text-align: center;
}

.dial .lab {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Dialog */
.dialog {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.dialog[hidden] {
  display: none;
}

.dialog-box {
  width: 100%;
  max-width: 400px;
}

.dialog-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dialog-box input {
  width: 100%;
  padding: 10px 14px;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
}

/* Responsive Mobile */
@media (max-width: 960px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  .kiri {
    display: none;
  }
}
