/* ============================================================
   Nocturne BEL — design tokens & komponen (Sayembara Logo BEL 2026)
   Warna mengikuti situs resmi: baliengineeringleaders.com
   ============================================================ */

:root {
  --bg: #161826;
  --bg-deep: #10111c;
  --bg-elev: #12131f;
  --card: rgba(18, 19, 31, 0.72);
  --card-solid: #1a1c2c;
  --divider: rgba(233, 233, 237, 0.14);
  --text: #e9e9ed;
  --muted: rgba(233, 233, 237, 0.55);
  --accent: #e8551c;
  --accent-hover: #f25f22;
  --accent-dark: #92330d;
  --accent-light: #ffb694;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --gold: #f2c94c;
  --gold-deep: #b8860b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 82% -12%, rgba(232, 85, 28, 0.16), transparent 62%),
    radial-gradient(900px 520px at -6% 102%, rgba(28, 35, 64, 0.6), transparent 62%);
  background-attachment: fixed;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: var(--accent); }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 20px 72px; }
.wrap-sm { max-width: 480px; }

/* ---------- teks ---------- */
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 8px;
}
h1.title { font-size: 30px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
p.sub { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- kartu ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  padding: 26px;
}
.card + .card { margin-top: 18px; }
.card-divider { height: 1px; background: var(--divider); margin: 22px -26px; }
@media (max-width: 640px) { .card-divider { margin: 20px -20px; } }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--divider); }
.btn-secondary:hover { background: rgba(233, 233, 237, 0.07); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--red); border-color: rgba(248, 113, 113, 0.3); }

/* ---------- form ---------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 7px;
}
.input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: rgba(233, 233, 237, 0.06);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.input:hover { border-color: rgba(233, 233, 237, 0.4); }
.input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 85, 28, 0.25);
}
.input.score {
  width: 104px;
  min-height: 56px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-width: 2px;
  border-color: rgba(232, 85, 28, 0.4);
  background: rgba(232, 85, 28, 0.07);
  color: var(--text);
  border-radius: 10px;
}
.input.score:hover { border-color: rgba(232, 85, 28, 0.65); background: rgba(232, 85, 28, 0.1); }
.input.score:focus-visible {
  border-color: var(--accent);
  background: rgba(232, 85, 28, 0.12);
  box-shadow: 0 0 0 4px rgba(232, 85, 28, 0.28);
}
.input.score::placeholder { color: rgba(233, 233, 237, 0.3); font-weight: 600; }
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-moz-search-cancel-button { -webkit-appearance: none; appearance: none; margin: 0; }
input[type='number'] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- tabel ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid rgba(233, 233, 237, 0.07);
  vertical-align: middle;
}
.table tbody tr:hover { background: rgba(233, 233, 237, 0.03); }
.table .num { text-align: center; }

/* ---------- gambar karya ---------- */
.thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--divider);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.sm { width: 44px; height: 44px; border-radius: 8px; }
.thumb.placeholder {
  background: repeating-conic-gradient(rgba(233,233,237,.08) 0% 25%, transparent 0% 50%) 50% / 14px 14px;
}

/* ---------- badge & status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-ok { background: rgba(52, 211, 153, 0.14); color: var(--green); }
.badge-wait { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.badge-warn { background: rgba(248, 113, 113, 0.14); color: var(--red); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.rank-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: rgba(233, 233, 237, 0.07);
  color: var(--muted);
}
.rank-1 { background: linear-gradient(135deg, #ffb694, var(--accent)); color: #fff; box-shadow: 0 0 18px rgba(232, 85, 28, 0.45); }
.rank-2 { background: rgba(233, 233, 237, 0.18); color: var(--text); }
.rank-3 { background: rgba(232, 85, 28, 0.35); color: var(--accent-light); }

/* ---------- kartu pemenang (admin) ---------- */
.winner-card {
  border-color: rgba(242, 201, 76, 0.5);
  background: linear-gradient(135deg, rgba(242, 201, 76, 0.14), rgba(242, 201, 76, 0.03));
  box-shadow: 0 0 0 1px rgba(242, 201, 76, 0.28), 0 10px 32px rgba(242, 201, 76, 0.16);
}
.winner-box { display: flex; align-items: center; gap: 22px; margin-top: 14px; flex-wrap: wrap; }
.winner-thumb {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.5), 0 0 24px rgba(242, 201, 76, 0.35);
}
.winner-info { flex: 1; min-width: 200px; }
.winner-name { font-size: 26px; font-weight: 700; color: var(--gold); }
.winner-score-row { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.winner-score { font-size: 40px; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.winner-score-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
}

.danger-card { border-color: rgba(248, 113, 113, 0.3); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(22, 24, 38, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
}
.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid rgba(232, 85, 28, 0.4);
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1;
}
.topbar-title { font-size: 14px; font-weight: 600; margin: 0; }
.topbar-sub { font-size: 12px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---------- hero login ---------- */
.center-stage {
  min-height: calc(100vh - 61px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ---------- banner ---------- */
.banner {
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid;
  margin-bottom: 18px;
}
.banner-info { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.3); color: var(--green); }
.banner-warn { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.3); color: var(--red); }

/* ---------- grid statistik ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .v { font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev);
  border: 1px solid rgba(232, 85, 28, 0.45);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.progress-track { height: 6px; background: rgba(233, 233, 237, 0.08); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); border-radius: 999px; transition: width 0.2s ease; }

/* ---------- layar panggung logo (per-karya) ---------- */
.logo-badge { text-align: center; }
.logo-badge .no { font-size: 22px; font-weight: 600; }
.logo-badge .of { font-size: 12px; color: var(--muted); }

.stage-split {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  align-items: stretch;
  flex-wrap: wrap;
}
.stage-image-wrap {
  flex: 1 1 320px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  border: 1px solid var(--divider);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-image-wrap img { width: 100%; height: 100%; object-fit: contain; }
.stage-image-wrap.placeholder {
  background: repeating-conic-gradient(rgba(233, 233, 237, 0.06) 0% 25%, transparent 0% 50%) 50% / 14px 14px;
  font-size: 40px;
  color: var(--muted);
}
.stage-side {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: rgba(233, 233, 237, 0.03);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
}

@media (max-width: 640px) {
  .stage-image-wrap { aspect-ratio: 4 / 3; }
}

/* ---------- modal PDF filosofi ---------- */
.modal.modal-pdf {
  max-width: 1200px;
  width: 96vw;
  height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.modal-pdf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-pdf iframe {
  flex: 1;
  width: 100%;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  background: #fff;
}

/* ---------- daftar karya (overview) ---------- */
.karya-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.karya-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(233, 233, 237, 0.03);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.karya-row:hover { background: rgba(233, 233, 237, 0.07); border-color: rgba(232, 85, 28, 0.4); }
.karya-row .grow { flex: 1; min-width: 0; }
.karya-row .name { font-weight: 600; }
.karya-row .status { font-size: 12px; color: var(--muted); }
.karya-row.disabled { opacity: 0.55; pointer-events: none; }
.karya-row .chev { color: var(--muted); }

.karya-row.gold {
  border-color: rgba(242, 201, 76, 0.55);
  background: linear-gradient(135deg, rgba(242, 201, 76, 0.16), rgba(242, 201, 76, 0.04));
  box-shadow: 0 0 0 1px rgba(242, 201, 76, 0.3), 0 8px 26px rgba(242, 201, 76, 0.14);
}
.karya-row.gold:hover { border-color: rgba(242, 201, 76, 0.85); }
.karya-row.gold .name { color: var(--gold); }

.karya-row.scored { padding: 16px 16px; }
.karya-row.scored .name { font-size: 17px; }

.karya-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  flex: none;
}
.karya-score .num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.karya-score .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-top: 5px;
}
.karya-row.gold .karya-score .num {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(242, 201, 76, 0.55);
}
.karya-row.gold .karya-score .lbl { color: var(--gold); opacity: 0.85; }

@media (max-width: 640px) {
  .karya-score .num { font-size: 28px; }
  .karya-score { min-width: 64px; }
}

.rank-badge.rank-gold {
  background: linear-gradient(135deg, #fff3c4, var(--gold) 55%, var(--gold-deep));
  color: #4a3600;
  box-shadow: 0 0 18px rgba(242, 201, 76, 0.55);
}

.badge-gold { background: rgba(242, 201, 76, 0.18); color: var(--gold); }

/* ---------- rating kriteria ---------- */
.rate-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(233, 233, 237, 0.07);
  flex-wrap: wrap;
}
.rate-row:last-child { border-bottom: none; }
.rate-info { flex: 1; min-width: 0; }
.rate-name { font-weight: 600; font-size: 15px; }
.rate-weight { font-size: 12px; color: var(--accent-light); margin-top: 2px; }
.rate-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px dashed rgba(233, 233, 237, 0.12);
}
.rate-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.rate-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.rate-range { font-size: 11px; color: var(--muted); }

/* ---------- navigasi ---------- */
.nav-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nav-bar .spacer { flex: 1; }

/* ---------- modal konfirmasi ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 18, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 430px;
  width: 100%;
  padding: 26px;
}
.modal h3 { margin: 4px 0 8px; font-size: 20px; font-weight: 600; }
.modal p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: rgba(233, 233, 237, 0.05);
  margin-bottom: 18px;
}
.link-back:hover { color: var(--text); border-color: rgba(232, 85, 28, 0.5); background: rgba(232, 85, 28, 0.08); }

@media (max-width: 640px) {
  h1.title { font-size: 24px; }
  .card { padding: 20px; }
  .topbar-sub { display: none; }
}

/* ---------- cetak hasil (admin) ---------- */
.print-only { display: none; }

.print-header {
  padding: 24px 0 4px;
  border-bottom: 2px solid #000;
  margin-bottom: 18px;
}
.print-brand {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 12px;
  border: 1px solid #000;
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 8px;
}
.print-header h1 { margin: 0; font-size: 22px; font-weight: 700; }
.print-header p { margin: 4px 0 14px; font-size: 12px; color: #444; }

@media print {
  .print-only { display: block; }

  .topbar, #gate, .toast, .confetti-canvas, .modal-backdrop,
  #btn-copy, #btn-print, .danger-card, .link-back { display: none !important; }

  html, body {
    background: #fff !important;
    color: #111 !important;
  }
  body {
    background-image: none !important;
  }

  .wrap { max-width: 100%; padding: 0 6px 24px; }

  .card {
    background: #fff !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    color: #111 !important;
    break-inside: avoid;
    padding: 16px 18px;
  }
  .card + .card { margin-top: 14px; }

  .kicker { color: #444 !important; }
  p.sub, .muted, .small { color: #444 !important; }

  .winner-card {
    border: 2px solid #000 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  .winner-name { color: #111 !important; }
  .winner-score { color: #111 !important; }
  .winner-score-lbl { color: #444 !important; }
  .winner-thumb { box-shadow: none !important; border: 1px solid #999; }

  .stat { border: 1px solid #ccc !important; background: #fff !important; }
  .stat .v { color: #111 !important; }
  .stat .k { color: #444 !important; }

  .badge { border: 1px solid #999; background: #fff !important; color: #111 !important; }
  .dot { display: none; }

  .table th { color: #444 !important; border-bottom: 1px solid #999 !important; }
  .table td { color: #111 !important; border-bottom: 1px solid #ddd !important; }

  .rank-badge {
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #999;
    box-shadow: none !important;
  }
  .rank-1, .rank-2, .rank-3 { background: #fff !important; color: #111 !important; }

  .karya-score .num, .karya-score .lbl { color: #111 !important; }

  a { color: #111 !important; text-decoration: none; }

  .banner {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #111 !important;
  }

  .table-wrap { overflow: visible; }
}
