/* asset/style.css — HESTIA Ujian v2 */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --sidebar-w: 15rem;
  --topbar-h: 3.75rem;
  --brand-1: #0f172a;
  --brand-2: #1e40af;
  --brand-3: #3b82f6;
  --accent:  #f59e0b;
  --accent-2: #fbbf24;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --radius: 0.875rem;
  --radius-sm: 0.5rem;
  --shadow: 0 4px 24px rgba(15,23,42,0.08);
  --shadow-md: 0 8px 32px rgba(15,23,42,0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 50;
  box-shadow: 0 1px 12px rgba(15,23,42,0.07);
}

.topbar-logo {
  display: flex; align-items: center; gap: 0.625rem;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--brand-1);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.topbar-logo .logo-icon {
  width: 2rem; height: 2rem;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.topbar-logo span.accent { color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.topbar-avatar {
  width: 2.125rem; height: 2.125rem;
  background: linear-gradient(135deg, var(--brand-2), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'Sora', sans-serif;
  flex-shrink: 0;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--topbar-h);
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--brand-1);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  transform: translateX(-100%);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .sidebar { transform: translateX(0); }
}

.sidebar.open { transform: translateX(0) !important; }

.sidebar-section-label {
  font-family: 'Sora', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #475569;
  padding: 0.75rem 0.75rem 0.375rem;
  margin-top: 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6875rem 0.875rem;
  border-radius: 0.625rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}

.sidebar-item.active {
  background: linear-gradient(135deg, var(--brand-2), #2563eb);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(30,64,175,0.4);
}

.sidebar-item.active .sidebar-icon {
  color: var(--accent-2);
}

.sidebar-icon {
  width: 1.125rem;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--brand-1);
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.125rem 0.375rem;
  border-radius: 99px;
  font-family: 'Sora', sans-serif;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
  margin-left: 0;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 1.5rem;
  transition: margin-left 0.3s;
}

@media (min-width: 768px) {
  .main-content { margin-left: var(--sidebar-w); }
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}
.page-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--brand-1);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-title .page-icon {
  width: 2.25rem; height: 2.25rem;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.9rem;
}
.page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-2);
  margin-top: 0.25rem;
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid rgba(226,232,240,0.6);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.stat-icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--brand-1);
  line-height: 1;
}
.stat-label { font-size: 0.75rem; color: var(--text-2); margin-top: 0.25rem; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), #2563eb);
  color: #fff;
  box-shadow: 0 2px 12px rgba(30,64,175,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a, var(--brand-2));
  box-shadow: 0 4px 20px rgba(30,64,175,0.4);
  transform: translateY(-1px);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: var(--brand-1);
  box-shadow: 0 2px 12px rgba(245,158,11,0.3);
}
.btn-accent:hover {
  box-shadow: 0 4px 20px rgba(245,158,11,0.4);
  transform: translateY(-1px);
}
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 12px rgba(5,150,105,0.3);
}
.btn-success:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
}
.btn-danger:hover { background: #fee2e2; }

/* ── FORMS ───────────────────────────────────────────────── */
.label-form {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}
.input-form {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--surface);
  color: var(--text);
}
.input-form:focus {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
select.input-form { cursor: pointer; }

/* ── TABLE ───────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  background: #f8fafc;
  color: #475569;
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.tbl tbody td {
  padding: 0.625rem 0.875rem;
  font-size: 0.8375rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text);
}
.tbl tbody tr:hover td { background: #f8fafc; }
.tbl tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-aktif       { background: #dcfce7; color: #15803d; }
.badge-selesai     { background: #dbeafe; color: #1d4ed8; }
.badge-diblokir    { background: #fee2e2; color: #b91c1c; }
.badge-berlangsung { background: #fef9c3; color: #854d0e; }
.badge-belum       { background: #f1f5f9; color: #64748b; }
.badge-accent      { background: #fef3c7; color: #92400e; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-box {
  background: var(--surface);
  border-radius: 1.125rem;
  padding: 1.75rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(15,23,42,0.22);
  animation: slideUp 0.25s ease;
  border: 1px solid rgba(226,232,240,0.8);
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── TOKEN ───────────────────────────────────────────────── */
.token-input {
  letter-spacing: 0.4em;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  width: 100%;
  max-width: 260px;
  color: var(--brand-2);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: 'Sora', sans-serif;
}
.token-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.2);
}

/* ── PILIHAN ─────────────────────────────────────────────── */
.pilihan-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
  user-select: none;
}
.pilihan-item:hover { border-color: var(--brand-3); background: #eff6ff; }
.pilihan-item.selected-pg  { border-color: var(--brand-2); background: #dbeafe; }
.pilihan-item.selected-pgk { border-color: #16a34a; background: #dcfce7; }

.custom-radio {
  width: 1.25rem; height: 1.25rem; min-width: 1.25rem;
  border-radius: 50%;
  border: 2.5px solid #94a3b8;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-top: 0.1rem;
}
.pilihan-item.selected-pg .custom-radio {
  border-color: var(--brand-2);
  background: var(--brand-2);
}
.pilihan-item.selected-pg .custom-radio::after {
  content: '';
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: #fff;
}

.custom-checkbox {
  width: 1.25rem; height: 1.25rem; min-width: 1.25rem;
  border-radius: 0.3rem;
  border: 2.5px solid #94a3b8;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-top: 0.1rem;
}
.pilihan-item.selected-pgk .custom-checkbox {
  border-color: #16a34a;
  background: #16a34a;
}
.pilihan-item.selected-pgk .custom-checkbox::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.65rem;
  color: #fff;
}

/* ── TIMER ───────────────────────────────────────────────── */
#timerDisplay { font-variant-numeric: tabular-nums; letter-spacing: 0.05em; }
#timerDisplay.warning { color: #f59e0b; animation: pulse 1s infinite; }
#timerDisplay.danger  { color: #ef4444; animation: pulse 0.5s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── PROGRESS ────────────────────────────────────────────── */
.progress-bar {
  height: 0.45rem;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── ANTI-CHEAT ──────────────────────────────────────────── */
#blokirOverlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.92);
  z-index: 2000;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column;
  gap: 1rem;
  color: #fff;
  text-align: center;
}

/* ── LOGIN ───────────────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 60%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
}

/* ── SOAL CONTENT ────────────────────────────────────────── */
.soal-pertanyaan img { max-width: 100%; border-radius: 0.5rem; margin: 0.25rem 0; }
.soal-pertanyaan table { border-collapse: collapse; font-size: 0.75rem; width: 100%; }
.soal-pertanyaan th, .soal-pertanyaan td { border: 1px solid var(--border); padding: 0.25rem 0.5rem; }
.soal-pertanyaan ul, .soal-pertanyaan ol { padding-left: 1.2rem; }

/* ── MISC ────────────────────────────────────────────────── */
.no-select { user-select: none; -webkit-user-select: none; }
#btnInstall { display: none; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
