/* ================= Patch 1.1.0 ================= */

/* --- Pengamanan naskah soal --- */
#exam-room.guarded, #exam-room.guarded .q-card, #exam-room.guarded .q-text, #exam-room.guarded .opt {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
#exam-room.guarded input[type=radio] { user-select: auto; }
#exam-room.is-hidden .q-card { filter: blur(9px); opacity: .35; transition: filter .12s ease; }
#exam-room.is-hidden::after {
  content: "Kembali ke jendela ujian untuk melanjutkan"; position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; background: rgba(22,32,43,.55); color: #fff;
  font: 600 17px/1.4 var(--sans, system-ui); letter-spacing: .01em;
}
.guard-note {
  margin: 12px 0 0; padding: 9px 14px; font-size: 12.5px; border-radius: var(--radius);
  background: var(--warn-tint, #fdf3e3); border: 1px solid #f0d6b4; color: #854d13;
}
.guard-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px);
  background: #16202B; color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 70;
}
.guard-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.q-image { margin: 0 0 12px; }
.q-image img {
  max-width: 100%; height: auto; display: block; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; pointer-events: none;
}
.opt-ringkas .letter { font-weight: 700; color: var(--primary); }

.exam-watermark {
  position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden;
  display: flex; flex-wrap: wrap; gap: 70px 90px; padding: 60px; transform: rotate(-22deg) scale(1.4);
}
.exam-watermark span { font-size: 12px; color: rgba(27,79,145,.09); white-space: nowrap; font-weight: 600; }

@media print {
  #exam-room.guarded { display: none !important; }
  #exam-room.guarded::before {
    content: "Naskah ujian tidak dapat dicetak."; display: block; font: 600 15px system-ui; padding: 40px;
  }
}

/* --- Manajemen log --- */
.log-level { display: inline-block; padding: 1px 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600; }
.log-level.info       { background: #eef4fb; color: #164478; }
.log-level.peringatan { background: #fdf3e3; color: #854d13; }
.log-level.galat      { background: #fbeeee; color: #8f2222; }
.log-level.keamanan   { background: #efeafc; color: #4a2d8f; }
.log-line {
  font: 12px/1.6 ui-monospace, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap;
  border-bottom: 1px solid #eef1f4; padding: 3px 0;
}

/* --- Pengumuman & Instagram --- */
.ig-preview { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.ig-poster { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.ig-caption {
  white-space: pre-wrap; font-size: 13px; background: #f7f9fb; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; max-height: 340px; overflow: auto;
}
.ig-state { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; }
.ig-state.terkirim { background: var(--ok-tint, #eaf5ee); color: #14603a; }
.ig-state.gagal    { background: #fbeeee; color: #8f2222; }
.ig-state.belum    { background: #eef1f4; color: #5b6672; }
.ig-state.uji_coba { background: #fdf3e3; color: #854d13; }

/* --- Kartu peserta --- */
.id-card {
  width: 86mm; height: 54mm; border: 1px solid #cdc6b2; border-radius: 3mm; padding: 5mm;
  background: #fff; display: grid; grid-template-columns: 1fr 22mm; gap: 4mm; margin: 12mm auto;
  font-family: var(--sans, system-ui); position: relative; box-shadow: 0 2px 14px rgba(20,30,40,.12);
}
.id-card .org { font-size: 9pt; font-weight: 700; letter-spacing: .03em; color: #1B4F91; }
.id-card .nama { font-size: 13pt; font-weight: 700; margin-top: 3mm; line-height: 1.2; }
.id-card .nim { font-size: 9pt; color: #5f5949; margin-top: 1mm; }
.id-card .meta { font-size: 7.5pt; color: #6a6350; margin-top: 3mm; line-height: 1.5; }
.id-card .qr img, .id-card .foto img { width: 22mm; height: 22mm; object-fit: cover; border-radius: 2mm; }
@media print { .id-card { box-shadow: none; margin: 0 auto; } }

/* --- Halaman pendaftaran publik --- */
.signup-card { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.signup-hero { background: var(--ink, #16202B); color: #fff; padding: 22px 24px; }
.signup-hero h1 { margin: 0 0 6px; font-size: 21px; }
.signup-hero p  { margin: 0; color: #a9b8c6; font-size: 13.5px; }
.signup-meta { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ann-list { display: grid; gap: 12px; }
.ann-item { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.ann-item h3 { margin: 0 0 6px; font-size: 16px; }
.ann-item p  { margin: 0 0 8px; font-size: 13.5px; color: #4c5966; }

/* --- Tambahan kartu ringkas --- */
.stat.is-bad .n { color: var(--bad, #B02A2A); }
.stat.is-bad    { border-left: 3px solid var(--bad, #B02A2A); }
