/* Dipindah dari index/public/ujian-tahfidz.php */
/* ====== UJIAN TAHFIDZ PAGE ====== */
.ut-page-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.25rem;
  text-align: center;
}
.ut-page-subtitle {
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0 0 1.375rem;
}
.ut-container {
  width: 100%;
  padding: 1.5625rem 1.25rem;
  border-radius: 1.25rem;
  background: var(--g-white-75);
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.15);
}

/* Kartu isi (soal, info peserta, skor) */
.ut-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.125rem 1rem;
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.08);
  margin-bottom: 0.875rem;
}
.ut-card:last-child { margin-bottom: 0; }

/* Form mulai ujian */
.ut-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ut-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.ut-group label.ut-label {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--g-green-dark);
}
.ut-hint {
  font-size: 0.72rem;
  color: #888;
}
.ut-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ut-input-wrap i {
  position: absolute;
  left: 0.875rem;
  color: var(--g-green-teal);
  font-size: 0.9rem;
  pointer-events: none;
}
.ut-input-wrap input,
.ut-input-wrap select {
  width: 100%;
  padding: 0.75rem 0.875rem 0.75rem 2.375rem;
  border-radius: 0.75rem;
  border: 0.0625rem solid rgba(0,0,0,0.12);
  background: #fff;
  font-family: var(--g-font);
  font-size: 0.82rem;
  color: #333;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ut-input-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23009688' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
}
.ut-input-wrap input::placeholder { color: #aaa; font-size: 0.78rem; }
.ut-input-wrap input:focus,
.ut-input-wrap select:focus {
  border-color: var(--g-green-teal);
  box-shadow: 0 0 0 0.1875rem rgba(0,150,136,0.15);
}
.ut-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.ut-check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: #333;
  line-height: 1.45;
}
.ut-check input {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0 0;
  accent-color: var(--g-green-dark);
}

/* Tombol */
.ut-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8125rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--g-green-dark);
  color: #fff;
  font-family: var(--g-font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.ut-btn:hover { transform: translateY(-0.125rem); background: var(--g-green-mid); }
.ut-btn-ghost {
  background: #eee;
  color: #555;
  font-weight: 600;
}
.ut-btn-ghost:hover { background: #e0e0e0; }
.ut-btn-cta {
  background: linear-gradient(90deg, #b35900, #e07b1f);
}
.ut-btn-cta:hover { background: linear-gradient(90deg, #b35900, #e07b1f); transform: translateY(-0.125rem) scale(1.01); }

/* Alert */
.ut-alert {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.8125rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.ut-alert i { font-size: 1rem; }
.ut-alert-error {
  background: rgba(220,53,69,0.1);
  color: #c0392b;
  border: 0.0625rem solid rgba(220,53,69,0.25);
}
.ut-alert-note {
  background: rgba(240,132,24,0.12);
  color: #8a4b00;
  border: 0.0625rem solid rgba(240,132,24,0.3);
}
.ut-note {
  text-align: center;
  font-size: 0.72rem;
  color: #777;
  margin: 0.875rem 0 0;
}

/* Info peserta + progres */
.ut-who { font-weight: 700; color: var(--g-green-dark); font-size: 0.85rem; }
.ut-meta { font-size: 0.76rem; color: #666; }
.ut-progress {
  height: 0.375rem;
  border-radius: 0.25rem;
  background: rgba(0,0,0,0.08);
  margin-top: 0.625rem;
  overflow: hidden;
}
.ut-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0.25rem;
  background: var(--g-orange);
  transition: width 0.25s;
}

/* Soal */
.ut-qhead {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #777;
  margin-bottom: 0.5rem;
}
.ut-qtitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--g-green-dark);
  margin-bottom: 0.375rem;
}
.ut-ar {
  font-family: "Amiri", "Scheherazade New", "Traditional Arabic", "Noto Naskh Arabic", serif;
  font-size: 1.5rem;
  line-height: 2.2;
  text-align: right;
  color: #222;
}
.ut-prompt {
  background: rgba(0,150,136,0.1);
  border-radius: 0.75rem;
  padding: 0.5rem 0.875rem;
  margin-bottom: 0.75rem;
}

/* Pilihan jawaban */
.ut-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  border: 0.0625rem solid rgba(0,0,0,0.12);
  border-radius: 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ut-opt:hover { border-color: var(--g-green-teal); }
.ut-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ut-opt .ut-mk {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.75rem;
  border-radius: 50%;
  background: #eef2ee;
  color: #777;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.74rem;
  transition: background 0.2s, color 0.2s;
}
.ut-opt .ut-ar { flex: 1; }
.ut-opt:has(input:checked) {
  border-color: var(--g-green-teal);
  background: rgba(0,150,136,0.12);
}
.ut-opt:has(input:checked) .ut-mk { background: var(--g-green-dark); color: #fff; }
.ut-opt:has(input:focus-visible) { box-shadow: 0 0 0 0.1875rem rgba(0,150,136,0.25); }

/* Pembahasan */
.ut-opt.ut-ok    { border-color: var(--g-green-teal); background: rgba(0,150,136,0.12); cursor: default; }
.ut-opt.ut-ok .ut-mk  { background: var(--g-green-dark); color: #fff; }
.ut-opt.ut-bad   { border-color: #c0392b; background: rgba(220,53,69,0.1); cursor: default; }
.ut-opt.ut-bad .ut-mk { background: #c0392b; color: #fff; }
.ut-opt.ut-plain { cursor: default; }
.ut-opt.ut-plain:hover { border-color: rgba(0,0,0,0.12); }
.ut-tag {
  flex: none;
  max-width: 7rem;
  margin-top: 0.625rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}
.ut-tag.ut-ok  { color: var(--g-green-dark); }
.ut-tag.ut-bad { color: #c0392b; }
.ut-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.125rem 0.625rem;
  border-radius: 1.25rem;
  background: #eef2ee;
  color: #777;
  white-space: nowrap;
}
.ut-pill.ut-ok  { background: rgba(0,150,136,0.12); color: var(--g-green-dark); }
.ut-pill.ut-bad { background: rgba(220,53,69,0.1); color: #c0392b; }

/* Skor */
.ut-score { text-align: center; padding: 1.5rem 1.25rem; }
.ut-score-name { font-size: 0.8rem; font-weight: 600; color: #666; }
.ut-score-num {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--g-green-dark);
}
.ut-score-sub { font-size: 0.78rem; color: #666; }
.ut-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--g-green-dark);
  margin: 1.375rem 0 0.75rem;
}

/* Bagian sertifikat di layar hasil */
.ut-cert-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--g-green-dark);
  margin: 0 0 0.75rem;
  text-align: center;
}
.ut-cert-preview { width: 100%; }
.ut-cert-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.15);
}
.ut-cert-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  aspect-ratio: 4961 / 3508;
  padding: 0 10%;
  background: rgba(0,150,136,0.08);
  border: 0.0625rem dashed rgba(0,150,136,0.35);
  border-radius: 0.75rem;
  color: var(--g-green-dark);
  font-weight: 600;
  font-size: 0.8rem;
}
.ut-cert-bar {
  width: 100%;
  max-width: 15rem;
  height: 0.5rem;
  background: #fff;
  border: 0.0625rem solid rgba(0,150,136,0.3);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
}
.ut-cert-bar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  border-radius: 1rem;
  background: var(--g-orange);
  animation: ut-bar 1.1s ease-in-out infinite;
}
@keyframes ut-bar { 0% { left: -40%; } 100% { left: 100%; } }
#ut-cert-dl { margin-top: 0.875rem; }
.ut-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.ut-toast {
  position: fixed;
  top: calc(var(--g-nav-height) + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  background: #c0392b;
  color: #fff;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1100;
  box-shadow: 0 0.25rem 0.875rem rgba(0,0,0,0.2);
  transition: opacity 0.3s;
}

/* ====== SERTIFIKAT (dirender offscreen -> JPG; CSS disalin dari lomba-tes-hamza.php, penempatan tidak diubah) ====== */
    .ut-cert-card, .ut-cert-card *{ box-sizing:border-box; }
    .ut-cert-card{
      max-width:860px;
      margin:0 auto;
      font-size:clamp(0px, 3.6vw, 30.96px);
      font-size:3.6cqw; /* dulu 4cqw: seluruh isi sertifikat diperkecil 10% */
      background-image:url('/images/ujian-tahfidz/sertifikat.jpg');
      background-size:cover;
      background-position:center;
      background-repeat:no-repeat;
      aspect-ratio:4961 / 3508;
      border-radius:14px;
      padding:2.111em 1.556em 1.111em; /* = 1.9em 1.4em 1em pada basis lama, agar posisi tepi tetap */
      color:#000;
      text-align:center;
      direction:rtl;
      position:relative;
      display:flex;
      flex-direction:column;
      justify-content:flex-start;
      box-shadow:0 8px 30px rgba(0,0,0,0.12);
      -webkit-print-color-adjust:exact;
      print-color-adjust:exact;
    }
    .ut-cert-bismillah{ font-family:'Amiri','Traditional Arabic',serif; font-size:0.65em; line-height:1.3; direction:rtl; color:#000; margin-top:1.1em; margin-bottom:0.15em; }
    .ut-cert-label{ font-family:'Amiri','Traditional Arabic',serif; font-size:0.85em; font-weight:700; line-height:1.4; color:#000; margin-top:0.25em; margin-bottom:0.4em; } /* jarak judul: atas (margin-top) dan bawah (margin-bottom); masing-masing +15% dari tinggi judul (1.68em x 0.15 = 0.25em) */
    .ut-cert-label-img{ display:block; height:1.68em; width:auto; margin:0 auto; } /* judul emas (gambar canvas); 1.4em x 1.2 = +20% */
    .ut-cert-title{ font-family:'Amiri','Traditional Arabic',serif; font-size:0.5em; font-weight:700; margin-bottom:0.2em; color:#000; }
    .ut-cert-name{ font-family:'Amiri','Noto Naskh Arabic','Traditional Arabic',serif; font-size:1.2em; font-weight:700; line-height:1.25; margin-bottom:0.2em; color:#000; }
    .ut-cert-name.ut-cert-name-latin{ font-family:'Dancing Script','Amiri',cursive; font-size:1.109em; line-height:1.35; } /* cadangan: sertifikat lama yang belum punya nama Arab */
    .ut-cert-konten{ font-family:'Amiri','Traditional Arabic',serif; font-size:0.5em; line-height:1.8; color:#000; margin-bottom:0.5em; padding:0 0.2em; }
    .ut-cert-date{ font-family:'Amiri','Traditional Arabic',serif; font-size:0.5em; color:#000; }
    .ut-cert-meta{ display:flex; flex-direction:column; align-items:center; direction:rtl; margin-top:0.05em; }
    .ut-cert-tables{ display:flex; justify-content:center; align-items:center; gap:1.2em; direction:rtl; }
    .ut-cert-meta .ut-cert-date{ text-align:center; white-space:nowrap; margin-top:2em; } /* margin-top tanggal */
    .ut-cert-table{
      width:6.4em; border-collapse:collapse; direction:rtl; table-layout:fixed;
      font-family:'Amiri','Traditional Arabic',serif; color:#000;
      background:linear-gradient(135deg,#fbefc2 0%,#fff7d9 50%,#f6e3a1 100%);
    }
    .ut-cert-table th, .ut-cert-table td{ border:0.06em solid #a87a10; padding:0.16em 0.25em; text-align:center; line-height:1.3; vertical-align:middle; }
    .ut-cert-table th{ width:38%; font-size:0.42em; font-weight:700; color:#3d2800; background:linear-gradient(135deg,#b8860b 0%,#e9c451 45%,#f2d060 55%,#b8860b 100%); }
    .ut-cert-table td{ font-size:0.5em; font-weight:700; color:#5a3d00; }
    .ut-cert-table td span{ direction:ltr; unicode-bidi:isolate; display:inline-block; }

    /* Tanda tangan & stempel */
    .ut-cert-signs{
      position:relative; margin:0.12em 6.4% 0;
      display:flex; justify-content:space-between; align-items:flex-end;
      direction:ltr; pointer-events:none;
    }
    .ut-cert-sign{ width:9.5em; display:flex; flex-direction:column; align-items:center; text-align:center; }
    .ut-cert-sign-art{ position:relative; width:100%; height:3em; }
    .ut-cert-sign-art .ut-cert-stamp, .ut-cert-sign-art .ut-cert-ttd{ position:absolute; display:block; background-repeat:no-repeat; background-position:center; background-size:contain; }
    .ut-cert-ttd{ width:4.48em; height:2.88em; left:50%; bottom:0; margin-left:-2.24em; z-index:2; }
    .ut-cert-stamp{ width:3.44em; height:3.44em; bottom:0.1em; z-index:1; opacity:0.92; }
    .ut-cert-sign-left .ut-cert-stamp{ left:2.1em; width:2.064em; height:2.064em; }   /* stempel kelas daurah: -40%, digeser kanan 20% */
    .ut-cert-sign-right .ut-cert-stamp{ right:0.2em; bottom:-0.05em; width:3.784em; height:3.784em; } /* stempel tasheel: +10% */
    .ut-cert-sign-right .ut-cert-ttd{ width:2.867em; height:1.843em; margin-left:-1.434em; } /* ttd yusuf: -20% (lalu -20% lagi) */
    .ut-cert-sign-role, .ut-cert-sign-name{ font-family:'Amiri','Traditional Arabic',serif; direction:rtl; color:#000; line-height:1.35; }
    .ut-cert-sign-role{ font-size:0.42em; font-weight:400; margin-top:0; position:relative; top:0.95em; } /* top: geser jabatan turun mendekati ttd (~0.4em basis sertifikat); ubah angka ini untuk atur jarak */
    .ut-cert-sign-name{ font-size:0.5em; font-weight:700; margin-top:0.05em; }
    .ut-cert-sign-role bdi{ unicode-bidi:isolate; }
    .ut-cert-card table{min-width:0}
    .ut-cert-card th,.ut-cert-card td{white-space:normal;letter-spacing:normal;text-transform:none;position:static;box-shadow:none}

/* Bar bawah (lengket) */
.ut-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 1.25rem 0 0.625rem;
  background: linear-gradient(rgba(49,115,76,0), #31734c 40%);
}
.ut-cancel { margin-top: 0.5rem; }

@media (max-width: 600px) {
  .ut-ar { font-size: 1.35rem; }
  .ut-row { grid-template-columns: 1fr; }
  .ut-tag { max-width: 5.5rem; }
}

/* ── Gerbang bagikan poster (sebelum form ujian) ── */
.ut-hidden { display: none !important; }
.ut-gate-p { font-size: 0.8rem; color: #333; line-height: 1.6; margin: 0 0 0.75rem; }
.ut-feat { list-style: none; margin: 0 0 0.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.ut-feat li { display: flex; gap: 0.75rem; align-items: flex-start; background: #f4faf7; border-radius: 0.75rem; padding: 0.625rem 0.75rem; font-size: 0.76rem; color: #444; line-height: 1.45; }
.ut-feat li i { flex: 0 0 1.75rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--g-green-mid); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; margin-top: 0.1rem; }
.ut-feat li b { display: block; color: var(--g-green-dark); font-size: 0.8rem; }
.ut-gate-steps li { margin-bottom: 0.25rem; }
.ut-gate-title { font-size: 1rem; font-weight: 800; color: var(--g-green-dark); margin: 1.125rem 0 0.375rem; }
.ut-gate-steps { margin: 0 0 0.25rem; padding-left: 1.1rem; font-size: 0.8rem; color: #333; line-height: 1.55; }
.ut-gate-steps b { color: var(--g-green-dark); }
.ut-poster { display: block; width: 100%; height: auto; border-radius: 0.75rem; box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.18); background: #eee; -webkit-touch-callout: default; }
.ut-poster-tip { text-align: center; font-size: 0.74rem; color: #666; margin: 0.5rem 0 0.75rem; }
.ut-btn-link { text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.ut-upload-box { border: 0.125rem dashed var(--g-green-teal); border-radius: 0.75rem; padding: 0.875rem; text-align: center; background: #f4faf7; cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--g-green-dark); }
.ut-upload-box i { display: block; font-size: 1.4rem; margin-bottom: 0.25rem; }
.ut-upload-box input { display: none; }
.ut-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.ut-thumb { position: relative; border-radius: 0.5rem; overflow: hidden; background: #eee; aspect-ratio: 3 / 4; }
.ut-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ut-thumb button { position: absolute; top: 0.25rem; right: 0.25rem; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; background: rgba(0,0,0,0.65); color: #fff; font-size: 0.7rem; cursor: pointer; }
.ut-agree { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.78rem; font-weight: 600; color: #333; margin: 0.875rem 0 0.75rem; cursor: pointer; }
.ut-agree input { margin-top: 0.2rem; accent-color: var(--g-green-mid); }
.ut-checking { text-align: center; padding: 1.5rem 0.5rem; }
.ut-spin { width: 2.5rem; height: 2.5rem; margin: 0 auto 0.875rem; border: 0.3rem solid #d6e6dd; border-top-color: var(--g-green-mid); border-radius: 50%; animation: ut-spin 0.8s linear infinite; }
@keyframes ut-spin { to { transform: rotate(360deg); } }
.ut-checking-msg { font-weight: 700; font-size: 0.85rem; color: var(--g-green-dark); min-height: 1.3em; }
.ut-ok-icon { width: 2.75rem; height: 2.75rem; margin: 0 auto 0.75rem; border-radius: 50%; background: var(--g-green-mid); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
