:root{
  /* Warna dan variabel global */
  --bg: #e6e6e6;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-dim: #555555;
  --border: #e9e9e9;
  --accent: #FFC107;
  --accent-600: #e6b800;
  --blue: #1976D2;
  --blue-700:#155a9f;
  --shadow: 0 14px 40px rgba(0,0,0,.12);
}

/* Reset dasar */
*{ box-sizing: border-box; }
html, body{
  height: 100%;
}
body{
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);

  /* Pola background dekoratif */
  background-image:
    radial-gradient(circle at 15% 25%, rgba(0,0,0,.05) 2px, transparent 2px),
    radial-gradient(circle at 85% 75%, rgba(0,0,0,.05) 2px, transparent 2px),
    linear-gradient(135deg, rgba(255,193,7,.12) 25%, transparent 25%),
    linear-gradient(135deg, transparent 75%, rgba(255,193,7,.12) 75%);
  background-size: 26px 26px, 26px 26px, 52px 52px, 52px 52px;
}

/* ====== Latar dekoratif tambahan ====== */
.bg-decor{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-decor::before,
.bg-decor::after{
  content: "";
  position: absolute;
  filter: blur(0.2px);
  opacity: .12;
}
.bg-decor::before{
  /* Garis dekorasi hitam & biru miring di atas */
  left: -10%;
  top: -10%;
  width: 140%;
  height: 60%;
  background-image:
    linear-gradient( -12deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.85) 45%, transparent 45%, transparent 100%),
    linear-gradient( -12deg, transparent 0%, transparent 70%, rgba(25,118,210,.8) 70%, rgba(25,118,210,.8) 78%, transparent 78%, transparent 100%);
  transform: skewY(-2deg);
  border-bottom: 6px solid rgba(0,0,0,.08);
}
.bg-decor::after{
  /* Lingkaran kuning di kanan bawah */
  right: 6%;
  bottom: 10%;
  width: 320px;
  height: 320px;
  background:
    radial-gradient(circle 160px at center, rgba(255,193,7,.35) 0%, rgba(255,193,7,.0) 65%),
    radial-gradient(circle 80px at 30% 30%, rgba(255,193,7,.55) 0%, rgba(255,193,7,0) 70%);
  border-radius: 50%;
  box-shadow:
    0 0 0 14px rgba(255,193,7,.12) inset,
    0 0 0 36px rgba(255,193,7,.08) inset;
}

/* ====== Header ====== */
.site-header {
  display: flex; /* sejajar kiri-kanan */
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  position: relative;
  z-index: 2;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Ukuran logo default (untuk desktop) */
.logo-left { max-height: 75px; }
.logo-kanan { max-height: 55px; }
.logo-kanan1 { max-height: 53px; }
.logo-kanan2 { max-height: 45px; }

.logo-left,
.logo-kanan,
.logo-kanan1,
.logo-kanan2 {
  object-fit: contain;
  height: auto;
}

/* Teks branding tengah */
.brand-mark {
  font-weight: bold;
  background: #222;
  color: #fff;
  padding: 5px 10px;
  border-radius: 8px;
}

/* ====== Container kartu utama ====== */
.container{
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 32px auto;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px 26px;
  text-align: center;
}
.title{
  margin: 0 0 6px 0;
  font-size: 28px;
  font-weight: 700;
}
.subtitle{
  margin: 0 0 22px 0;
  color: var(--text-dim);
}

/* ====== Search box ====== */
.search-box{
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* biar input & tombol bisa turun kalau sempit */
}
#nrpInput{
  width: 320px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #cfcfcf;
  font-size: 16px;
  outline: none;
  transition: .25s;
}
#nrpInput:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,193,7,.15);
}
.btn-primary{
  padding: 12px 18px;
  background: var(--accent);
  color: #000;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.btn-primary:hover{
  background: var(--accent-600);
  transform: translateY(-1px);
}
.hint{
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ====== Status & hasil ====== */
.status{
  min-height: 24px;
  margin-top: 10px;
  font-size: 14px;
}
.status.error{ color: #c62828; }
.status.ok{ color: #2e7d32; }

.hasil{
  margin-top: 18px;
}
.card-result{
  display: grid;
  grid-template-columns: 1fr; /* default: 1 kolom */
  gap: 14px;
  justify-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg,#fff, #fafafa);
}
.card-result .meta{
  display: grid;
  gap: 4px;
}
.nrp-label{
  display: inline-block;
  padding: 6px 10px;
  border: 2px solid #000;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .4px;
}
.preview{
  max-width: 100%;
  width: 360px;
  border-radius: 14px;
  border: 3px solid #ddd;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.download-btn{
  display: inline-block;
  margin-top: 6px;
  padding: 10px 16px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  transition: .2s;
}
.download-btn:hover{
  background: var(--blue-700);
  transform: translateY(-1px);
}

/* ====== Footer ====== */
.site-footer{
  position: relative;
  z-index: 1;
  padding: 24px;
  text-align: center;
  color: #333;
  font-size: 13px;
}

/* ====== Layout Desktop & Tablet ====== */
@media (min-width: 720px){
  .card-result{
    grid-template-columns: 380px 1fr; /* preview + teks sejajar */
    align-items: center;
    justify-items: start;
    text-align: left;
  }
}

/* ====== Layout HP ====== */
@media (max-width: 719px){
  .container {
    margin: 16px;
    padding: 20px;
  }

  /* Input & tombol lebih kecil */
  #nrpInput {
    width: 200px;
    padding: 10px 12px;
    font-size: 14px;
  }
  .btn-primary {
    padding: 10px 14px;
    font-size: 14px;
  }
  .card-result {
    padding: 12px;
    gap: 10px;
  }
  .preview {
    width: 240px;
  }
  .title {
    font-size: 22px;
  }
  .subtitle {
    font-size: 13px;
  }

  /* Header tetap sejajar kiri-kanan tapi diperkecil */
  .site-header {
    padding: 8px 12px;
    gap: 6px;
  }
  .header-left {
    gap: 0px;
  }
  .brand-mark {
    font-size: 13px;
    padding: 3px 6px;
  }

  .header-right {
    gap: 4px;
  }
  /* Logo diperkecil */
  .logo-left { max-height: 50px; }
  .logo-kanan { max-height: 36px; }
  .logo-kanan1 { max-height: 34px; }
  .logo-kanan2 { max-height: 32px; }
}

/* Tambahan styling nama */
.nama-label {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* Pastikan header tidak pecah baris */
.header-left, .header-right {
  flex-wrap: nowrap;
}

.logo-left,
.logo-kanan,
.logo-kanan1,
.logo-kanan2 {
  max-width: 100%;
  height: auto;
}

/* Override ukuran logo di HP (versi lebih kecil lagi) */
@media (max-width: 719px){
  .logo-left { max-height: 36px; }
  .logo-kanan { max-height: 28px; }
  .logo-kanan1 { max-height: 26px; }
  .logo-kanan2 { max-height: 24px; }

  .brand-mark { font-size: 12px; }
  .badge { font-size: 10px; }
}

/* Tampilan sesudah pencarian */
.card-result {
  margin-top: 20px;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background: #fff;
  text-align: center;
}

.card-result img.preview {
  max-width: 200px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 2px solid #eee;
}

.card-result .meta {
  font-size: 16px;
  margin-top: 8px;
}

.btn-group {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn {
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  transition: 0.2s;
}

.btn.qr { background: #007bff; }
.btn.qr:hover { background: #0056b3; }

.btn.kartu { background: #28a745; }
.btn.kartu:hover { background: #1e7e34; }
