:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg-page: #f8fafc;
  --card-bg: #ffffff;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #eef2ff 0%, #f8fafc 65%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* ─── TOP ACTION BAR ─── */
.top-nav-bar {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

.brand-icon-badge svg {
  width: 18px;
  height: 18px;
}

.brand-title-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.top-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pill-nav {
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-pill-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-pill-nav svg {
  width: 14px;
  height: 14px;
}

.btn-pill-accent {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #c7d2fe;
}

.btn-pill-accent:hover {
  background: #e0e7ff;
  border-color: var(--primary);
}

/* ─── CONTAINER DUA KOLOM ─── */
.main-wrapper {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  align-items: stretch;
  animation: fadeInUp .45s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-wrapper.single-column {
  grid-template-columns: 420px;
  justify-content: center;
}

/* ─── KARTU (CARD) ─── */
.card {
  background: var(--card-bg);
  border-radius: 22px;
  padding: 36px 30px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 14px 34px -4px rgba(79, 70, 229, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.85);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ─── KARTU KIRI: INPUT TOKEN ─── */
.token-card {
  text-align: center;
}

.icon-box {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.18);
}

.icon-box svg {
  width: 30px;
  height: 30px;
}

.brand-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.token-card h1 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -.02em;
}

.token-card .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

input[type="text"] {
  width: 100%;
  padding: 15px;
  font-size: 22px;
  font-family: monospace;
  font-weight: 800;
  letter-spacing: .25em;
  text-align: center;
  text-transform: uppercase;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-main);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  margin-bottom: 14px;
}

input[type="text"]::placeholder {
  color: #cbd5e1;
  font-weight: 400;
  letter-spacing: .12em;
  font-size: 16px;
}

input[type="text"]:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.btn {
  width: 100%;
  padding: 13px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  margin-bottom: 12px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Divider Atau */
.divider {
  display: flex;
  align-items: center;
  margin: 12px 0 14px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.divider span {
  padding: 0 12px;
}

/* Tombol Simulasi Ujian */
.btn-simulation {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid #c7d2fe;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.06);
}

.btn-simulation:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.simulation-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Pesan Status */
.msg {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  display: none;
  text-align: left;
  margin-top: 12px;
  animation: fadeIn .25s ease;
}

.msg.error {
  display: block;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.msg.success {
  display: block;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

/* ─── KARTU KANAN: INFORMASI UJIAN ─── */
.info-card {
  padding: 0;
}

.info-banner-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  display: none;
}

.info-body {
  padding: 32px 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.info-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.info-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.info-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.info-session {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.info-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 14px;
  color: var(--text-main);
  line-height: 1.3;
}

.info-list {
  list-style: none;
  margin-bottom: 20px;
  flex: 1;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 10px;
}

.info-list li:last-child {
  margin-bottom: 0;
}

.info-bullet {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Quick chips footer */
.chips-row {
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ─── MODAL POPUPS (TUTORIAL & PERATURAN) ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}

.modal-card {
  background: #fff;
  border-radius: 22px;
  padding: 32px 28px;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.22);
  animation: modalIn .25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header-icon svg {
  width: 22px;
  height: 22px;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all .15s;
  flex-shrink: 0;
}

.btn-close-modal:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Tutorial step cards */
.step-item {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text-main);
}

.step-content p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Rules content modal */
.rules-container {
  margin-bottom: 18px;
}

.rule-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}

.rule-badge {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.warning-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.warning-box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #d97706;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* Status Pills for Schedule */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-active {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-active .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.status-blue {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.status-blue .status-dot {
  background: #0284c7;
}

.status-expired {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-expired .status-dot {
  background: #f59e0b;
}

/* Footer Page */
.page-footer {
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.page-footer a {
  color: #475569;
  text-decoration: none;
  font-weight: 600;
}

.page-footer a:hover {
  text-decoration: underline;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── RESPONSIVE ─── */
@media(max-width:840px) {
  .main-wrapper {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .top-nav-bar {
    max-width: 440px;
  }

  .card {
    padding: 30px 22px;
  }

  .info-body {
    padding: 26px 22px;
  }
}
