/* =============================================================
   Pendaftaran Lomba HUT RI ke-81 — BPKD Kabupaten Pekalongan
   Gaya khusus halaman login, formulir, dan rekap.
   Token warna & tipografi diwarisi dari style.css. Ditulis mobile-first.
   ============================================================= */

:root {
  --hijau:      #1e7a4c;
  --hijau-soft: #dff3e7;
  --amber-soft: #fdefd0;
  --garis:      #e8d9c6;
}

.app-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--cream);
}

.app-main {
  flex: 1 0 auto;
  padding-bottom: 48px;
}

ol { margin: 0; padding: 0; list-style: none; }

.nav-keluar {
  background: rgba(255, 255, 255, .14);
}

/* =====================  PESAN FLASH  ===================== */

.flash {
  margin: 18px auto 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  border-left: 5px solid;
}
.flash-sukses { background: var(--hijau-soft); color: #14532d; border-color: var(--hijau); }
.flash-info   { background: var(--amber-soft); color: #7a5312; border-color: var(--gold); }
.flash-galat  { background: #fde2e2;           color: #86131b; border-color: var(--red); }

/* =====================  TOMBOL  ===================== */

.btn-utama {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  min-height: 48px;
  border: 0;
  background: var(--gold);
  color: var(--red-dark);
  font-family: var(--body);
  font-weight: 800;
  font-size: .95rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 0 #b3801f, 0 12px 22px rgba(0, 0, 0, .18);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-utama:hover,
.btn-utama:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #b3801f, 0 8px 16px rgba(0, 0, 0, .18);
}
.btn-blok { width: 100%; }

.btn-kedua {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  background: var(--white);
  color: var(--red-deep);
  border: 2px solid var(--garis);
  border-radius: 999px;
  font-family: var(--body);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.btn-kedua:hover { border-color: var(--gold); background: var(--cream-2); }

/* =====================  HALAMAN MASUK  ===================== */

.auth-wrap {
  padding: 34px 0 56px;
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 181, 63, .22), transparent 62%),
    var(--cream);
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 30px 22px 26px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 44px rgba(92, 6, 11, .13);
  border: 1px solid var(--garis);
}

.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo { width: auto; height: 58px; margin: 0 auto 14px; }

.auth-eyebrow {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
}

.auth-title {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--red-deep);
  margin-top: 6px;
  text-transform: uppercase;
}

.auth-sub {
  margin-top: 10px;
  font-size: .86rem;
  color: var(--ink-dim);
}

.auth-galat {
  margin-bottom: 16px;
  padding: 11px 14px;
  background: #fde2e2;
  color: #86131b;
  border-left: 5px solid var(--red);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
}

.auth-form { display: flex; flex-direction: column; gap: 15px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
}
.field input {
  padding: 12px 14px;
  min-height: 46px;
  font-family: var(--body);
  font-size: .95rem;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--garis);
  border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
}

.auth-bantuan {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--garis);
  font-size: .78rem;
  color: var(--ink-dim);
  text-align: center;
}

.auth-kembali {
  margin-top: 22px;
  text-align: center;
  font-size: .83rem;
}
.auth-kembali a { color: var(--red-deep); font-weight: 600; }

/* =====================  KEPALA FORMULIR & REKAP  ===================== */

.form-hero {
  padding: 30px 0 34px;
  background: linear-gradient(160deg, var(--red) 0%, var(--red-deep) 100%);
  color: var(--white);
  text-align: center;
}

.form-eyebrow {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-pale);
}

.form-judul {
  font-family: var(--display);
  font-size: clamp(1.3rem, 6vw, 2rem);
  text-transform: uppercase;
  margin-top: 8px;
}

.form-sub {
  max-width: 540px;
  margin: 12px auto 0;
  font-size: .87rem;
  color: rgba(255, 255, 255, .88);
}

/* Bilah kemajuan pengisian */
.progres { max-width: 420px; margin: 22px auto 0; }
.progres-bar {
  height: 10px;
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  overflow: hidden;
}
.progres-isi {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  border-radius: 999px;
  transition: width .45s var(--ease);
}
.progres-teks {
  margin-top: 9px;
  font-size: .8rem;
  color: var(--gold-pale);
  font-weight: 600;
}
.progres-teks strong { color: var(--white); font-size: 1rem; }

/* Ringkasan angka di halaman rekap */
.statistik {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.stat {
  flex: 1 1 92px;
  max-width: 150px;
  padding: 12px 10px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-sm);
}
.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--gold-soft);
}
.stat span {
  display: block;
  margin-top: 3px;
  font-size: .68rem;
  color: rgba(255, 255, 255, .8);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* =====================  BADAN FORMULIR  ===================== */

.form-section { padding: 26px 0 0; }

.kunci-notis {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--amber-soft);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: .86rem;
  color: #7a5312;
}

.form-lomba { display: flex; flex-direction: column; gap: 18px; }

.kartu-lomba {
  background: var(--white);
  border: 1px solid var(--garis);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: 0 8px 22px rgba(92, 6, 11, .06);
}

.kartu-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--garis);
}

.kartu-num {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: .9rem;
  color: var(--white);
  background: var(--red);
  border-radius: 50%;
}

.kartu-judul-wrap { flex: 1; min-width: 0; }

.kartu-judul {
  font-size: 1rem;
  font-weight: 800;
  color: var(--red-deep);
}

.kartu-aturan {
  display: inline-block;
  margin-top: 2px;
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-dim);
  text-decoration: none;
}
.kartu-aturan:hover { color: var(--red); text-decoration: underline; }

.kartu-status {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Status dibedakan warna sekaligus tetap terbaca sebagai angka "n/6",
   jadi maknanya tidak bergantung pada persepsi warna saja. */
.is-lengkap  { background: var(--hijau-soft); color: #14532d; }
.is-sebagian { background: var(--amber-soft); color: #7a5312; }
.is-kosong   { background: #f0e6da;           color: var(--ink-dim); }

.kartu-alat {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.salin-label {
  font-size: .74rem;
  font-weight: 700;
  color: var(--ink-dim);
}
.salin-select {
  flex: 1 1 170px;
  min-width: 0;
  padding: 7px 10px;
  min-height: 38px;
  font-family: var(--body);
  font-size: .78rem;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--garis);
  border-radius: var(--radius-sm);
}
.salin-select:focus { outline: none; border-color: var(--gold); }

.slot-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 15px;
}

.slot { display: flex; align-items: center; gap: 9px; }

.slot-label { flex: none; }
.slot-nomor {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  background: var(--cream-2);
  color: var(--red-deep);
  border-radius: 50%;
  font-size: .76rem;
  font-weight: 800;
}

.slot-input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  min-height: 44px;
  font-family: var(--body);
  font-size: .92rem;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--garis);
  border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.slot-input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
}
.slot-input:read-only {
  background: #f4ece2;
  color: var(--ink-dim);
}
.slot-input.terisi { border-color: #cfe6d9; background: var(--white); }

.form-aksi {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 6px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 248, 239, .96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--garis);
  text-align: center;
}
.form-catatan {
  margin-bottom: 11px;
  font-size: .76rem;
  color: var(--ink-dim);
}

/* =====================  REKAP  ===================== */

.rekap-alat {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.tab-nav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--cream-2);
  border-radius: 999px;
}
.tab {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-dim);
  text-decoration: none;
}
.tab.is-aktif {
  background: var(--red);
  color: var(--white);
}

.rekap-tombol { display: flex; gap: 8px; }

.rekap-subjudul {
  font-family: var(--display);
  font-size: 1.05rem;
  text-transform: uppercase;
  color: var(--red-deep);
  margin: 26px 0 13px;
}

/* Tabel status lebih lebar dari layar ponsel, jadi digulir mendatar
   di dalam wadahnya sendiri agar badan halaman tidak ikut bergeser. */
.tabel-scroll {
  overflow-x: auto;
  border: 1px solid var(--garis);
  border-radius: var(--radius-md);
  background: var(--white);
}

.tabel-status {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  min-width: 640px;
}
.tabel-status th,
.tabel-status td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--garis);
}
.tabel-status thead th {
  background: var(--cream-2);
  color: var(--red-deep);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.tabel-status tbody th {
  font-weight: 700;
  color: var(--ink);
  text-transform: capitalize;
  white-space: nowrap;
}
.tabel-status tbody tr:last-child th,
.tabel-status tbody tr:last-child td { border-bottom: 0; }

.pil {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kolom-waktu { white-space: nowrap; color: var(--ink-dim); font-size: .76rem; }
.kosong-teks { color: #a8988a; font-style: italic; }

.rekap-blok {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--garis);
  border-radius: var(--radius-md);
}

.rekap-blok-judul {
  font-size: 1rem;
  font-weight: 800;
  color: var(--red-deep);
  text-transform: capitalize;
  padding-bottom: 11px;
  margin-bottom: 13px;
  border-bottom: 1px dashed var(--garis);
}

.rekap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.rekap-kolom-judul {
  font-size: .78rem;
  font-weight: 800;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 7px;
}

.rekap-nama {
  counter-reset: pemain;
  font-size: .84rem;
}
.rekap-nama li {
  counter-increment: pemain;
  padding: 5px 0 5px 26px;
  position: relative;
  border-bottom: 1px solid #f4ece2;
}
.rekap-nama li::before {
  content: counter(pemain) ".";
  position: absolute;
  left: 0;
  color: var(--ink-dim);
  font-size: .76rem;
  font-weight: 700;
}
.rekap-nama li:last-child { border-bottom: 0; }

/* =====================  LAYAR LEBIH LEBAR  ===================== */

@media (min-width: 600px) {
  .slot-list { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .kartu-lomba { padding: 20px; }
  .rekap-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .auth-card { padding: 34px 30px 30px; }
}

@media (min-width: 900px) {
  .slot-list { grid-template-columns: repeat(3, 1fr); }
  .rekap-grid { grid-template-columns: repeat(3, 1fr); }
  .form-hero { padding: 42px 0 46px; }
  .kartu-judul { font-size: 1.08rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-utama, .progres-isi { transition: none; }
  .btn-utama:hover, .btn-utama:active { transform: none; }
}

/* =====================  CETAK  ===================== */

@media print {
  .site-header,
  .site-footer,
  .no-print,
  .form-aksi { display: none !important; }

  .app-main { padding: 0; }

  .form-hero {
    background: none !important;
    color: #000;
    padding: 0 0 14px;
    text-align: left;
    border-bottom: 2px solid #000;
  }
  .form-eyebrow, .form-judul { color: #000; }
  .statistik { display: none; }

  .rekap-blok,
  .tabel-scroll {
    border: 1px solid #999;
    box-shadow: none;
    /* Satu blok bidang diusahakan tidak terpotong ke halaman berikutnya. */
    break-inside: avoid;
  }

  .rekap-grid { grid-template-columns: repeat(3, 1fr); }
  .pil { border: 1px solid #999; }

  body { background: #fff; font-size: 11pt; }
}
