/* =========================================================
   Member Sutaatmadja — tema STIESA
   Ganti warna di bagian :root bila perlu.
   ========================================================= */
:root {
  --biru: #0c6dc9;        /* biru STIESA */
  --biru-tua: #0a4f96;
  --tinta: #0a1f44;       /* biru tinta (garis logo) */
  --langit: #2ea3f2;
  --merah: #d7262e;       /* huruf S pada logo */
  --kuning: #fdb913;      /* aksen Kampus Berdampak */
  --latar: #eef3fa;
  --permukaan: #ffffff;
  --teks: #0a1f44;
  --redup: #5b6b85;
  --garis: #dce5f1;
  --sukses: #13795b;
  --bahaya: #c62828;

  --r-kartu: 22px;
  --r-panel: 18px;
  --r-input: 14px;
  --bayangan: 0 1px 2px rgba(10,31,68,.06), 0 8px 24px rgba(10,31,68,.08);
  --nav-tinggi: 68px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--teks);
  background: var(--latar);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--langit); outline-offset: 2px; border-radius: 8px; }
.sembunyi { display: none !important; }

/* ---------- Kerangka ---------- */
.aplikasi {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-tinggi) + 28px + env(safe-area-inset-bottom));
  position: relative;
}

/* Pita atas (latar biru tinta dengan motif garis logo) */
.pita {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--tinta);
  padding: calc(16px + env(safe-area-inset-top)) 20px 92px;
  border-radius: 0 0 30px 30px;
}
.pita.pendek { padding-bottom: 28px; }
.pita .motif { position: absolute; right: -40px; bottom: -10px; width: 300px; opacity: .22; pointer-events: none; }
.bar-atas { display: flex; align-items: center; gap: 10px; position: relative; }
.lencana {
  background: #fff; border-radius: 12px; padding: 5px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lencana img { height: 28px; width: auto; display: block; }
.bar-atas .nama-situs { font-weight: 700; font-size: 15px; line-height: 1.2; }
.bar-atas .nama-situs small { display: block; font-weight: 500; font-size: 12px; opacity: .7; }
.bar-atas .kanan { margin-left: auto; }

.sapaan { position: relative; margin-top: 22px; }
.sapaan h1 { font-size: 24px; line-height: 1.25; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.sapaan p { margin: 6px 0 0; opacity: .78; font-size: 14px; max-width: 34ch; }

.isi { padding: 0 16px; }
.naik { margin-top: -72px; position: relative; }

/* ---------- Bagian / judul ---------- */
.bagian { margin-top: 28px; }
.kepala-bagian { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 12px; }
.kepala-bagian h2 { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.tautan { background: none; border: none; padding: 6px 2px; color: var(--biru); font-weight: 700; font-size: 13px; cursor: pointer; }

/* ---------- Kartu member ---------- */
.kartu {
  position: relative;
  aspect-ratio: 1.586 / 1;
  width: 100%;
  border-radius: var(--r-kartu);
  padding: 18px 18px 16px;
  color: #fff;
  background: linear-gradient(140deg, #0b2b63 0%, var(--biru-tua) 45%, var(--biru) 100%);
  box-shadow: 0 18px 40px -12px rgba(10,79,150,.55);
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
}
.kartu .motif { position: absolute; right: -30px; bottom: -20px; width: 78%; opacity: .16; z-index: -1; }
.kartu .kilau {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14) 45%, transparent 60%);
}
.kartu.nonaktif { filter: grayscale(1) brightness(.9); }
.kartu-atas { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kartu-brand { display: flex; align-items: center; gap: 9px; }
.kartu-brand .lencana { border-radius: 10px; padding: 4px; }
.kartu-brand .lencana img { height: 24px; }
.kartu-brand .nama-brand { font-weight: 800; font-size: 16px; letter-spacing: .3px; line-height: 1.1; }
.kartu-brand .nama-brand small { display: block; font-weight: 500; font-size: 10.5px; opacity: .75; letter-spacing: 0; }
.kartu-label {
  font-size: 11px; font-weight: 800;
  color: var(--tinta); background: var(--kuning);
  padding: 4px 11px; border-radius: 999px;
}
.kartu-bawah { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.kartu-nama { font-size: 19px; font-weight: 800; line-height: 1.15; word-break: break-word; letter-spacing: -.2px; }
.kartu-id { font-size: 15px; font-weight: 700; letter-spacing: 2px; margin-top: 5px; color: #ffe08a; font-variant-numeric: tabular-nums; }
.kartu-sejak { font-size: 11px; opacity: .75; margin-top: 2px; }
.kartu-qr { background: #fff; border-radius: 12px; padding: 5px; flex-shrink: 0; line-height: 0; }
.kartu-qr img { width: 76px; height: 76px; image-rendering: pixelated; }
.kartu-status {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-10deg);
  font-weight: 800; font-size: 20px; letter-spacing: 2px;
  border: 3px solid #fff; padding: 4px 14px; border-radius: 10px;
}
.kartu-tombol { display: block; width: 100%; padding: 0; border: none; background: none; cursor: pointer; border-radius: var(--r-kartu); text-align: left; }

/* ---------- Aksi cepat ---------- */
.aksi-cepat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.aksi {
  background: var(--permukaan); border: 1px solid var(--garis); border-radius: 16px;
  padding: 12px 6px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--teks);
  min-height: 76px; transition: transform .12s ease, background .12s;
}
.aksi:active { transform: scale(.97); background: #f6f9fd; }
.aksi .ikon-bulat {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: #e6f0fb; color: var(--biru);
}
.aksi.utama .ikon-bulat { background: var(--biru); color: #fff; }
.aksi svg, .ikon svg { width: 20px; height: 20px; }

/* ---------- Panel & form ---------- */
.panel {
  background: var(--permukaan);
  border-radius: var(--r-panel);
  padding: 20px;
  box-shadow: var(--bayangan);
}
.panel h2 { font-size: 18px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.2px; }
.panel .ket { color: var(--redup); font-size: 14px; margin: 0 0 18px; }
.kolom { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px; }
input {
  width: 100%; font-size: 16px;
  padding: 13px 14px; border-radius: var(--r-input);
  border: 1.5px solid var(--garis); background: #f8fafd;
  transition: border-color .15s, background .15s;
}
input:focus { outline: none; border-color: var(--biru); background: #fff; }
input::placeholder { color: #9aa8bd; }

.tombol {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px;
  font-size: 15px; font-weight: 700;
  padding: 12px 16px; border-radius: 14px; border: none;
  background: var(--biru); color: #fff; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .12s;
}
.tombol:hover { background: var(--biru-tua); }
.tombol:active { transform: scale(.98); }
.tombol:disabled { opacity: .65; cursor: progress; }
.tombol svg { width: 19px; height: 19px; }
.tombol.kedua { background: #e6f0fb; color: var(--biru); }
.tombol.kedua:hover { background: #d8e8f9; }
.tombol.wa { background: #1fa855; }
.tombol.wa:hover { background: #178a45; }
.tombol.polos { background: transparent; color: var(--redup); min-height: 44px; }
.baris-tombol { display: grid; gap: 10px; margin-top: 14px; }
.baris-tombol.dua { grid-template-columns: 1fr 1fr; }

.catatan { font-size: 13px; color: var(--redup); text-align: center; margin: 16px 8px 0; }

.pesan { font-size: 14px; padding: 11px 13px; border-radius: 12px; margin-bottom: 14px; }
.pesan.error { background: #fdecec; color: var(--bahaya); }
.pesan.info { background: #fff6dc; color: #7a5600; }
.pesan.sukses { background: #e3f4ec; color: var(--sukses); }

/* ---------- Benefit ---------- */
.geser {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2px 16px 6px; margin: 0 -16px; scrollbar-width: none;
}
.geser::-webkit-scrollbar { display: none; }
.benefit-mini {
  scroll-snap-align: start; flex: 0 0 72%;
  background: var(--permukaan); border-radius: var(--r-panel); padding: 16px;
  box-shadow: var(--bayangan); border-top: 4px solid var(--kuning);
}
.benefit-mini h3 { font-size: 15px; margin: 0 0 4px; font-weight: 800; }
.benefit-mini p { font-size: 13px; color: var(--redup); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.daftar { display: grid; gap: 10px; }
.benefit {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--permukaan); border-radius: var(--r-panel); padding: 16px; box-shadow: var(--bayangan);
}
.benefit .ikon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 13px;
  background: #fff4d1; color: #a66f00; display: grid; place-items: center;
}
.benefit h3 { margin: 1px 0 3px; font-size: 15px; font-weight: 800; }
.benefit p { margin: 0; color: var(--redup); font-size: 14px; white-space: pre-line; }

/* ---------- Berita ---------- */
.berita {
  display: flex; gap: 14px; align-items: stretch; width: 100%; text-align: left;
  background: var(--permukaan); border: none; border-radius: var(--r-panel); padding: 12px;
  box-shadow: var(--bayangan); cursor: pointer;
}
.berita .gambar {
  flex: 0 0 88px; height: 88px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(140deg, var(--tinta), var(--biru)); display: grid; place-items: center;
}
.berita .gambar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.berita .gambar .lencana img { height: 22px; }
.berita .teks { min-width: 0; padding: 2px 4px 2px 0; }
.berita .tgl { font-size: 12px; color: var(--redup); font-weight: 600; }
.berita h3 { font-size: 15px; font-weight: 800; margin: 2px 0 4px; line-height: 1.3; }
.berita p { font-size: 13px; color: var(--redup); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.berita-besar { background: var(--permukaan); border-radius: var(--r-panel); overflow: hidden; box-shadow: var(--bayangan); cursor: pointer; border: none; padding: 0; text-align: left; width: 100%; }
.berita-besar img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.berita-besar .teks { padding: 14px 16px 16px; }
.berita-besar .tgl { font-size: 12px; color: var(--redup); font-weight: 600; }
.berita-besar h3 { font-size: 17px; font-weight: 800; margin: 2px 0 6px; line-height: 1.3; }
.berita-besar p { font-size: 14px; color: var(--redup); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.kosong {
  text-align: center; color: var(--redup); padding: 28px 16px; font-size: 14px;
  background: var(--permukaan); border-radius: var(--r-panel); border: 1.5px dashed var(--garis);
}

/* ---------- Profil ---------- */
.info-baris { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--garis); font-size: 14px; }
.info-baris:last-child { border-bottom: none; }
.info-baris span:first-child { color: var(--redup); }
.info-baris span:last-child { font-weight: 700; text-align: right; }
.menu { background: var(--permukaan); border-radius: var(--r-panel); box-shadow: var(--bayangan); overflow: hidden; }
.menu button, .menu a {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 15px 16px; border: none; background: none; text-align: left; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--teks); text-decoration: none;
  border-bottom: 1px solid var(--garis);
}
.menu > :last-child { border-bottom: none; }
.menu .ikon { width: 36px; height: 36px; border-radius: 11px; background: #e6f0fb; color: var(--biru); display: grid; place-items: center; flex-shrink: 0; }
.menu .bahaya { color: var(--bahaya); }
.menu .bahaya .ikon { background: #fdecec; color: var(--bahaya); }

/* ---------- Navigasi bawah ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: calc(100% - 24px); max-width: 456px; height: var(--nav-tinggi);
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(10,31,68,.16), 0 0 0 1px rgba(10,31,68,.05);
  display: flex; align-items: center; padding: 0 6px; z-index: 20;
}
.nav button {
  flex: 1; height: 54px; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; font-weight: 600; color: var(--redup); border-radius: 16px;
  transition: color .15s, background .15s;
}
.nav button svg { width: 22px; height: 22px; }
.nav button.aktif { color: var(--biru); background: #e6f0fb; font-weight: 800; }

/* ---------- Bottom sheet ---------- */
.lapisan {
  position: fixed; inset: 0; background: rgba(10,31,68,.45); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.lapisan.buka { opacity: 1; pointer-events: auto; }
.lembar {
  position: fixed; left: 50%; bottom: 0; z-index: 41;
  width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: var(--permukaan); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.lembar.buka { transform: translate(-50%, 0); }
.lembar .pegangan { width: 40px; height: 5px; border-radius: 99px; background: var(--garis); margin: 0 auto 14px; }
.lembar h2 { font-size: 19px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.2px; }
.lembar .tgl { font-size: 13px; color: var(--redup); font-weight: 600; }
.lembar .isi-berita { white-space: pre-line; color: #2b3a55; font-size: 15px; line-height: 1.7; }
.lembar img.sampul { width: 100%; border-radius: 16px; margin: 4px 0 14px; display: block; }

.qr-besar { text-align: center; padding: 6px 0 4px; }
.qr-besar .bingkai { display: inline-block; padding: 14px; border-radius: 22px; background: #fff; border: 1.5px solid var(--garis); }
.qr-besar img { width: min(64vw, 260px); height: auto; image-rendering: pixelated; display: block; }
.qr-besar .id { font-size: 22px; font-weight: 800; letter-spacing: 3px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.qr-besar .nama { color: var(--redup); font-size: 14px; }

.langkah { margin: 8px 0 0; padding-left: 20px; color: #2b3a55; }
.langkah li { margin-bottom: 8px; }

/* ---------- Memuat ---------- */
.kerangka { border-radius: var(--r-panel); background: linear-gradient(90deg, #e3eaf4 25%, #edf2f9 50%, #e3eaf4 75%); background-size: 200% 100%; animation: kilap 1.2s infinite; }
@keyframes kilap { to { background-position: -200% 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-tinggi) + 28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  background: var(--tinta); color: #fff; padding: 11px 16px; border-radius: 14px;
  font-size: 14px; font-weight: 600; z-index: 60; opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; max-width: 90%; text-align: center;
}
.toast.tampil { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Halaman petugas ---------- */
.segmen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--permukaan); padding: 5px; border-radius: 16px; box-shadow: var(--bayangan); }
.segmen button {
  border: none; background: none; border-radius: 12px; min-height: 46px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 14px; color: var(--redup);
}
.segmen button svg { width: 18px; height: 18px; }
.segmen button.aktif { background: var(--biru); color: #fff; }
.hasil-cari { margin-top: 14px; }
.hasil-cari button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 13px 4px; border: none; border-bottom: 1px solid var(--garis); background: none; text-align: left; cursor: pointer;
}
.hasil-cari button:last-child { border-bottom: none; }
.hasil-cari b { display: block; font-size: 15px; }
.hasil-cari small { color: var(--redup); font-size: 13px; }
.hasil-cari svg { width: 18px; height: 18px; color: var(--redup); flex-shrink: 0; }
#pemindai { border-radius: 16px; overflow: hidden; background: #000; min-height: 260px; }
#pemindai video { border-radius: 16px; }

@media (min-width: 520px) {
  body { background: #e4ebf5; }
  .aplikasi { background: var(--latar); box-shadow: 0 0 0 1px rgba(10,31,68,.06); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
