:root {
  --brand: #1c7ed6;
  --brand-dark: #1864ab;
  --ink: #1b2430;
  --muted: #6b7684;
  --line: #e3e8ef;
  --ok: #2b8a3e;
  --ok-bg: #ebfbee;
  --warn: #e67700;
  --warn-bg: #fff4e6;
  --off: #868e96;
  --off-bg: #f1f3f5;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: -.006em;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f4f6fa;
}

.topbar {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 14px 16px;
}
.topbar-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.topbar img, .hero-nav img {
  height: 40px;
  width: auto;
}
.app-name { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.instansi { font-size: .8rem; opacity: .85; }

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 12px 32px -18px rgba(10, 32, 58, .25);
}
.card + .card { margin-top: 16px; }

.status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 4px;
}
.status i { font-size: 1.6rem; }
.status h1 { font-size: 1.1rem; font-weight: 800; margin-bottom: 2px; }
.status p { font-size: .9rem; opacity: .9; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.status-off { background: var(--off-bg); color: var(--off); }

.hero h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.hero .scan {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f0f6fd;
  color: var(--brand-dark);
  font-size: .9rem;
}
.hero .scan i { font-size: 1.4rem; }

footer {
  text-align: center;
  color: #9aa4b2;
  font-size: .8rem;
  padding: 20px 16px 28px;
}
footer a { color: inherit; }

/* ===== Form cek ===== */
.cek { margin-top: 20px; }
.cek label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.cek-row { display: flex; gap: 8px; }
.cek input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.cek input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(28, 126, 214, .12); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn-outline { color: var(--brand-dark); background: #fff; border: 1.5px solid var(--line); }
.error { color: #c92a2a; font-size: .85rem; margin-top: 8px; }

/* ===== Detail ===== */
.section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 12px;
}
.detail { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: .95rem; }
.detail dt { color: var(--muted); }
.detail dd { font-weight: 600; word-break: break-word; }

.signer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.signer:first-of-type { border-top: 0; padding-top: 0; }
.signer .nama { font-weight: 700; }
.signer .meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.signer i { color: var(--brand); }

.list-judul { list-style: none; }
.list-judul li { padding: 10px 0; border-top: 1px solid var(--line); font-weight: 600; }
.list-judul li:first-child { border-top: 0; padding-top: 0; }

/* Gambar ttd/cap hanya untuk dilihat */
.gambar-row { display: flex; flex-wrap: wrap; gap: 16px; }
.gambar {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.gambar img { display: block; max-width: 100%; max-height: 140px; pointer-events: none; }
.gambar::after { content: ''; position: absolute; inset: 0; }
.gambar figcaption { font-size: .78rem; color: var(--muted); margin-top: 8px; text-align: center; }

.pdf-frame {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 520px) {
  .card { padding: 22px 16px; }
  .detail { grid-template-columns: 1fr; gap: 2px; }
  .detail dd { margin-bottom: 10px; }
  .cek-row { flex-direction: column; }
  .pdf-frame { height: 60vh; min-height: 320px; }
}
.list-judul li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.list-judul .jumlah { flex-shrink: 0; color: var(--muted); font-size: .85rem; font-weight: 500; }


/* ===== Beranda: cek sertifikat ===== */
.hero-wrap {
  position: relative;
  color: #fff;
  padding: 0 16px 112px;
  background:
    linear-gradient(160deg, rgba(24, 100, 171, .92) 0%, rgba(16, 54, 94, .9) 60%, rgba(10, 32, 58, .95) 100%),
    url('../../images/login-background2.jpg') center/cover no-repeat;
  overflow: hidden;
}
.hero-wrap::after {
  content: '';
  position: absolute;
  right: -120px;
  top: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 70%);
  pointer-events: none;
}
.hero-nav { max-width: 960px; margin: 0 auto; padding: 18px 0; }
.hero-isi { position: relative; z-index: 1; max-width: 640px; margin: 40px auto 0; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: .8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.hero-isi h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin: 18px 0 12px; }
.hero-isi h1 span { color: #8ec5ff; }
.hero-isi p { font-size: 1.02rem; opacity: .85; line-height: 1.6; max-width: 520px; margin: 0 auto; }

body.beranda main { max-width: 760px; padding-top: 0; }

.cek-card {
  position: relative;
  z-index: 2;
  margin-top: -76px;
  background: #fff;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 60px -20px rgba(10, 32, 58, .35), 0 2px 6px rgba(10, 32, 58, .05);
}
.cek-card label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.cek-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 18px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fafbfd;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.cek-input:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(28, 126, 214, .12); }
.cek-input.galat { border-color: #ffa8a8; background: #fff; }
.cek-input > i { color: #9aa4b2; }
.cek-input:focus-within > i { color: var(--brand); }
.cek-input input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.cek-input input::placeholder { font-weight: 400; color: #adb5bd; }
.cek-input .btn { height: 48px; padding: 0 22px; border-radius: 10px; box-shadow: 0 8px 20px -8px rgba(28, 126, 214, .6); }
.cek-input .btn:disabled { opacity: .75; cursor: wait; }
.cek-hint { margin-top: 10px; font-size: .8rem; color: var(--muted); }

.cek-galat {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: #fff5f5;
  color: #c92a2a;
  animation: muncul .25s ease-out;
}
.cek-galat > i { font-size: 1.3rem; margin-top: 2px; }
.cek-galat b { display: block; margin-bottom: 6px; }
.cek-galat ul { padding-left: 18px; color: #862e2e; font-size: .85rem; line-height: 1.6; }
@keyframes muncul { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.langkah { margin-top: 44px; }
.langkah h2 { text-align: center; font-size: 1.15rem; font-weight: 800; margin-bottom: 18px; }
.langkah-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.langkah-item {
  position: relative;
  padding: 22px 18px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.langkah-item .no {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: .75rem;
  font-weight: 800;
  color: #c5ceda;
}
.langkah-item > i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e7f1fb;
  color: var(--brand);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.langkah-item b { display: block; font-size: .95rem; margin-bottom: 6px; }
.langkah-item p { color: var(--muted); font-size: .85rem; line-height: 1.55; }

.jaminan {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin: 32px 0 8px;
  color: var(--muted);
  font-size: .82rem;
}
.jaminan div { display: flex; align-items: center; gap: 8px; }
.jaminan i { color: var(--ok); }

@media (max-width: 640px) {
  .hero-wrap { padding-bottom: 96px; }
  .hero-isi { margin-top: 20px; }
  .hero-isi h1 { font-size: 1.8rem; }
  .hero-isi p { font-size: .95rem; }
  .cek-card { padding: 20px 16px; margin-top: -64px; }
  .cek-input { flex-wrap: wrap; padding: 6px 6px 6px 14px; }
  .cek-input .btn { width: 100%; }
  .langkah-grid { grid-template-columns: 1fr; }
  .jaminan { flex-direction: column; align-items: flex-start; width: fit-content; margin: 28px auto 8px; }
}

/* ===== Halaman hasil verifikasi ===== */
.hero-hasil { padding-bottom: 96px; }
.hero-hasil .hero-isi { margin-top: 20px; }
.hero-hasil.hasil-warn {
  background:
    linear-gradient(160deg, rgba(232, 89, 12, .9) 0%, rgba(166, 62, 8, .92) 100%),
    url('../../images/login-background2.jpg') center/cover no-repeat;
}
.hero-hasil.hasil-off {
  background:
    linear-gradient(160deg, rgba(73, 80, 87, .92) 0%, rgba(33, 37, 41, .95) 100%),
    url('../../images/login-background2.jpg') center/cover no-repeat;
}
.status-ikon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  background: #37b24d;
  box-shadow: 0 0 0 8px rgba(55, 178, 77, .25), 0 12px 30px -8px rgba(0, 0, 0, .4);
  animation: denyut 2.4s ease-out 1;
}
.hasil-warn .status-ikon { background: #fd7e14; box-shadow: 0 0 0 8px rgba(255, 255, 255, .18), 0 12px 30px -8px rgba(0, 0, 0, .4); }
.hasil-off .status-ikon { background: #868e96; box-shadow: 0 0 0 8px rgba(255, 255, 255, .12), 0 12px 30px -8px rgba(0, 0, 0, .4); }
@keyframes denyut {
  0% { transform: scale(.6); opacity: 0; }
  40% { transform: scale(1.08); opacity: 1; }
  60% { transform: scale(1); }
}
.hero-hasil h1 { font-size: 2rem; margin: 0 0 8px; }
.diperiksa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: .78rem;
  opacity: .9;
}

body.hasil main { max-width: 760px; padding-top: 0; }

/* Kartu bergaya dokumen */
.dokumen {
  position: relative;
  z-index: 2;
  margin-top: -64px;
  padding: 40px 32px 28px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: 0 24px 60px -20px rgba(10, 32, 58, .35), 0 2px 6px rgba(10, 32, 58, .05);
  overflow: hidden;
}
.dokumen::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid #e7ecf3;
  border-radius: 14px;
  pointer-events: none;
}
.dokumen-pita {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #e7f1fb;
  color: var(--brand-dark);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dokumen-label { margin-top: 22px; color: var(--muted); font-size: .85rem; }
.dokumen-nama {
  margin: 6px 0 8px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  word-break: break-word;
}
.dokumen-nama.kecil { font-size: 1.5rem; margin: 0 0 4px; }
.dokumen-judul { color: var(--brand-dark); font-weight: 600; font-size: 1.05rem; }
.dokumen-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  border-top: 1px dashed #d5dce6;
  text-align: left;
}
.dokumen-meta > div { padding: 16px 14px 4px; }
.dokumen-meta > div + div { border-left: 1px solid #eef1f5; }
.dokumen-meta span { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 4px; }
.dokumen-meta b { display: flex; align-items: center; gap: 6px; font-size: .92rem; word-break: break-word; }
.mono { font-family: SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }
.salin {
  flex-shrink: 0;
  border: 0;
  background: #f1f3f5;
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
}
.salin:hover { color: var(--brand); background: #e7f1fb; }

/* Kepala TTD */
.ttd-kepala { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; text-align: left; }
.inisial {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #e7f1fb;
  color: var(--brand-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inisial.besar { width: 60px; height: 60px; border-radius: 16px; font-size: 1.5rem; }

/* Lembar tanda tangan */
.lembar-ttd {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
  padding: 22px 16px 14px;
  border-radius: 14px;
  background: #fafbfd;
  user-select: none;
  -webkit-user-select: none;
}
.lembar-ttd .gambar {
  padding: 10px 14px 8px;
  border: 0;
  border-bottom: 1.5px solid #c5ceda;
  border-radius: 0;
  background: transparent;
}
.lembar-ttd .gambar img { max-height: 120px; }

/* Blok di bawah kartu */
.blok { margin-top: 28px; }
.blok-judul {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.blok-judul i { color: var(--brand); }

.penanda-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.penanda {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.penanda:hover { border-color: #a5cdf3; box-shadow: 0 10px 24px -14px rgba(28, 126, 214, .45); transform: translateY(-1px); }
.penanda-isi { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.penanda-isi b { font-size: .95rem; }
.penanda-isi small { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.penanda-isi .tgl { color: #2b8a3e; }
.penanda-cek { flex-shrink: 0; font-size: .78rem; font-weight: 700; color: var(--brand); white-space: nowrap; }

.pdf-wrap { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.pdf-wrap .pdf-frame { margin-bottom: 12px; }

.blok .list-judul { padding: 6px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.blok .list-judul li { padding: 12px 0; }
.blok .list-judul li:first-child { padding-top: 12px; }
.blok .list-judul i { color: #fab005; margin-right: 6px; }

.hasil-bawah {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 28px 0 8px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px dashed #d5dce6;
}
.hasil-bawah p { flex: 1 1 280px; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.hasil-bawah p i { color: var(--brand); margin-right: 4px; }
.hasil-bawah .btn { height: 42px; font-size: .88rem; }
.hasil-bawah.tengah p { flex: none; max-width: 480px; }
.hasil-bawah.tengah { padding: 22px; margin-top: -48px; position: relative; z-index: 2; flex-direction: column; text-align: center; border-style: solid; box-shadow: 0 24px 60px -20px rgba(10, 32, 58, .3); }

@media (max-width: 640px) {
  .hero-hasil h1 { font-size: 1.5rem; }
  .status-ikon { width: 60px; height: 60px; font-size: 1.5rem; }
  .dokumen { padding: 32px 18px 20px; }
  .dokumen-nama { font-size: 1.55rem; }
  .dokumen-meta { grid-template-columns: 1fr; }
  .dokumen-meta > div + div { border-left: 0; border-top: 1px solid #eef1f5; }
  .dokumen-meta > div { padding: 12px 4px 8px; }
  .ttd-kepala { flex-direction: column; text-align: center; }
  .penanda-cek { display: none; }
  .hasil-bawah .btn { width: 100%; }
}
