:root {
  --ink:        #0f172a;
  --body-text:  #64748b;
  --blue:       #2563eb;
  --indigo:     #4f46e5;
  --blue-soft:  #eef2ff;
  --blue-soft2: #e0e7ff;
  --amber:      #f59e0b;
  --amber2:     #ea580c;
  --amber-soft: #fff7ed;
  --amber-soft2:#ffedd5;
  --green:      #16a34a;
  --green-dark: #15803d;
  --green-soft: #f0fdf4;
  --green-soft2:#dcfce7;
  --red:        #dc2626;
  --red-dark:   #b91c1c;
  --red-soft:   #fef2f2;
  --red-soft2:  #fee2e2;
  --white:      #ffffff;
  --border:     #e7ebf7;
  --navy: var(--blue);
  --navy2: var(--indigo);
  --gold: var(--amber);
  --gold2: var(--amber2);
  --gold-light: var(--amber-soft2);
  --cream: var(--white);
  --green2: var(--green-dark);
  --red2: var(--red-dark);
  --gray: var(--body-text);
  --text: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background:
    radial-gradient(ellipse 60% 45% at 8% 0%, rgba(37,99,235,.08) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 92% 8%, rgba(124,58,237,.07) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 85% 95%, rgba(245,158,11,.07) 0%, transparent 60%),
    #fbfcff;
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── HERO ── */
.hero { position: relative; z-index: 1; }
.hero-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  object-fit: contain;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
  padding: 10px;
  display: block;
}
.hero-logo-placeholder {
  width: 76px; height: 76px; border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px; font-weight: 800;
}

.hero-badge {
  display: inline-block;
  background: var(--blue-soft2);
  color: var(--indigo);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 7px 16px;
  border-radius: 999px;
}

.admin-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--body-text);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(15,23,42,.12);
  z-index: 50;
  opacity: .45;
  transition: color .15s ease, transform .15s ease, background .15s ease, opacity .15s ease;
}
.admin-fab:hover, .admin-fab:focus-visible, .admin-fab:active {
  color: var(--indigo); background: var(--white); transform: translateX(2px); opacity: 1;
}

.hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(30px, 6.5vw, 44px);
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.hero-title span { color: var(--blue); }

.hero-sub {
  font-size: 15px;
  color: var(--body-text);
  text-align: center;
  font-weight: 500;
}

/* ── MAIN CONTAINER ── */
.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 60px;
}

/* ── SEARCH CARD ── */
.search-card {
  background: var(--white);
  border-radius: 28px;
  box-shadow: 0 20px 50px -16px rgba(15,23,42,.14);
  border: 1px solid var(--border);
  padding: 40px 34px;
}

.card-eyebrow {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--blue);
  margin-bottom: 10px;
}
.card-title {
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 23px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
}
.card-sub {
  text-align: center;
  font-size: 13.5px;
  color: var(--body-text);
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

/* Input */
.input-group {
  display: flex;
  gap: 10px;
  background: #f4f6fb;
  border-radius: 16px;
  padding: 6px 6px 6px 20px;
  border: 1.5px solid #eceff8;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-group:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
  background: var(--white);
}
.input-group input {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .02em;
}
.input-group input::placeholder { color: #a3adc2; font-weight: 400; }
.input-group input:disabled { opacity: .5; }

.btn-cari {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 13px 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .15s;
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(37,99,235,.28);
}
.btn-cari:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(37,99,235,.34); }
.btn-cari:disabled { opacity: .4; cursor: default; transform: none; }
.btn-cari svg { flex-shrink: 0; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Info / error boxes */
.msg-box { margin-top: 20px; }
.info-box {
  background: var(--blue-soft);
  border: 1px solid var(--blue-soft2);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13px;
  color: #3730a3;
  line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
}
.info-box-icon {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: rgba(255,255,255,.6);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.error-box {
  background: var(--red-soft);
  border: 1px solid var(--red-soft2);
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 13px;
  color: var(--red2);
  display: flex; gap: 10px; align-items: center;
}

/* ── HASIL ── */
#hasil { display: none; margin-top: 28px; }

/* ── COMBINED KELULUSAN CARD ── */
.kelulusan-card {
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid transparent;
  box-shadow: 0 10px 30px -18px rgba(15,23,42,.15);
  display: flex;
  flex-direction: row;
}
.kelulusan-card.lulus {
  background: var(--white);
  border-color: #bbf7d0;
}
.kelulusan-card.bersyarat {
  background: var(--white);
  border-color: #fed7aa;
}
.kelulusan-card.tidak {
  background: var(--white);
  border-color: #fecaca;
}
/* Warna kiri ikut status */
.kelulusan-card.lulus .kelulusan-left {
  background: linear-gradient(160deg, var(--green-soft), var(--green-soft2));
}
.kelulusan-card.bersyarat .kelulusan-left {
  background: linear-gradient(160deg, var(--amber-soft), var(--amber-soft2));
}
.kelulusan-card.tidak .kelulusan-left {
  background: linear-gradient(160deg, var(--red-soft), var(--red-soft2));
}

/* Kiri: foto + status */
.kelulusan-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  gap: 10px;
  min-width: 150px;
  flex-shrink: 0;
}

.status-icon-wrap {
  width: 90px; height: 110px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  overflow: hidden;
}
.lulus .status-icon-wrap { box-shadow: 0 10px 24px rgba(22,163,74,.18); }
.bersyarat .status-icon-wrap { box-shadow: 0 10px 24px rgba(245,158,11,.2); }
.tidak .status-icon-wrap { box-shadow: 0 10px 24px rgba(220,38,38,.18); }
.lulus #status-icon { color: var(--green-dark); }
.bersyarat #status-icon { color: #c2410c; }
.tidak #status-icon { color: var(--red-dark); }

#foto-siswa {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: none;
}
#status-icon { line-height: 1; }

.status-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}
.lulus .status-label { color: var(--green-dark); }
.bersyarat .status-label { color: #c2410c; }
.tidak .status-label { color: var(--red-dark); }

.status-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}
.lulus .status-text { color: var(--green-dark); }
.bersyarat .status-text { color: #c2410c; }
.tidak .status-text { color: var(--red-dark); }

.status-tahun {
  font-size: 11px;
  color: var(--body-text);
  font-weight: 500;
  text-align: center;
}

/* Divider vertikal */
.kelulusan-divider {
  width: 1px;
  background: rgba(0,0,0,.08);
  margin: 20px 0;
  flex-shrink: 0;
}

/* Kanan: identitas */
.kelulusan-right {
  flex: 1;
  background: var(--white);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.siswa-card-header {
  background: var(--blue-soft);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.siswa-card-header-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--indigo);
}
.siswa-card-body {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
}
.siswa-field label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--body-text);
  display: block;
  margin-bottom: 4px;
}
.siswa-field .val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.siswa-field.full { grid-column: 1 / -1; }

/* Responsive */
@media (max-width: 520px) {
  .kelulusan-card { flex-direction: column; }
  .kelulusan-left { padding: 22px 20px 16px; flex-direction: row; align-items: center; gap: 16px; min-width: unset; }
  .status-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .status-info .status-label,
  .status-info .status-text,
  .status-info .status-tahun { text-align: left; }
  .status-text { font-size: 24px; }
  .kelulusan-divider { display: none; }
}

/* Nilai */
.nilai-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px -18px rgba(15,23,42,.15);
}
.nilai-card-header {
  background: var(--blue-soft);
  padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.nilai-card-header-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--indigo);
}
.nilai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.nilai-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f4fb;
  transition: background .15s;
}
.nilai-item:nth-child(odd) { border-right: 1px solid #f1f4fb; }
.nilai-item:nth-last-child(-n+2) { border-bottom: none; }
.nilai-item:hover { background: #f8faff; }
.nilai-mapel { font-size: 12.5px; color: #64748b; font-weight: 500; }
.nilai-angka {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  min-width: 36px;
  text-align: right;
}
.nilai-angka.tinggi { color: var(--green); }
.nilai-angka.rendah { color: var(--red); }

/* Tombol aksi */
.aksi-group { display: flex; flex-direction: row; gap: 10px; }
.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: var(--white);
  border: none;
  border-radius: 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 8px 20px rgba(37,99,235,.28);
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(37,99,235,.34); }
.btn-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 14px 20px;
  background: none;
  color: var(--body-text);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-reset:hover { color: var(--blue); border-color: var(--blue-soft2); background: var(--blue-soft); }

/* Divider */
.gold-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
}
.gold-divider::before, .gold-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}
.gold-divider span {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--indigo);
}

/* Footer */
.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 36px 16px 32px;
}
.footer-line {
  width: 56px; height: 3px; margin: 0 auto 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--indigo));
}
.footer-sub { font-size: 11px; color: var(--body-text); opacity: .65; margin-top: 18px; }

/* ── COUNTDOWN PANEL ── */
.countdown-panel {
  background: var(--blue-soft);
  border: 1px solid var(--blue-soft2);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px -18px rgba(79,70,229,.14);
}
.countdown-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.countdown-panel-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 800; letter-spacing: .01em; color: var(--ink);
}
.countdown-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--indigo); flex-shrink: 0; }
.countdown-panel-icon { display: flex; align-items: center; color: var(--indigo); flex-shrink: 0; }
.countdown-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; color: var(--indigo);
  background: var(--white);
  border: 1px solid var(--blue-soft2);
  padding: 6px 14px 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.countdown-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--indigo); flex-shrink: 0; }
.countdown-panel-sub { font-size: 12.5px; color: var(--indigo); opacity: .75; margin-top: 4px; }
.countdown-panel-divider { height: 1px; background: var(--blue-soft2); margin: 16px 0; }

.countdown { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.countdown-unit {
  background: var(--white);
  border: 1px solid var(--blue-soft2);
  border-radius: 14px;
  padding: 16px 10px 14px;
  text-align: center;
}
.countdown-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 30px; font-weight: 800;
  color: var(--blue); line-height: 1;
}
.countdown-lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--body-text); margin-top: 6px;
}

/* Responsive */
@media (max-width: 520px) {
  .search-card { padding: 28px 20px; border-radius: 22px; }
  .input-group { padding: 6px 6px 6px 16px; gap: 6px; }
  .input-group input { font-size: 15px; }
  .btn-cari { padding: 12px 16px; }
  .nilai-grid { grid-template-columns: 1fr; }
  .nilai-item:nth-child(odd) { border-right: none; }
  .nilai-item:last-child { border-bottom: none; }
  .countdown-panel { padding: 16px 16px; }
  .countdown { gap: 8px; }
  .countdown-unit { padding: 12px 6px 10px; }
  .countdown-num { font-size: 22px; }
  .countdown-lbl { font-size: 9.5px; }
  .hero-inner { padding: 36px 20px 28px; }
  .siswa-card-body { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
}

@media (max-width: 360px) {
  .input-group { padding: 6px 6px 6px 14px; gap: 4px; }
  .input-group input { font-size: 14px; }
  .btn-cari { padding: 12px 14px; }
  .btn-cari span.btn-cari-label { display: none; }
}