/* ================================================================
   modal.css — jendela statistik pengunjung, info situs, login
   Satu pola dipakai bersama; isi tiap modal ada di partials/04-modals.html
   ================================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    visibility 0.22s;
}
.modal.open {
  opacity: 1;
  visibility: visible;
}
.modal-veil {
  position: absolute;
  inset: 0;
  background: rgba(20, 36, 58, 0.42);
  backdrop-filter: blur(3px);
}
.modal-box {
  position: relative;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    var(--shadow-2),
    0 30px 70px rgba(20, 36, 58, 0.22);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.26s var(--ease);
}
.modal.open .modal-box {
  transform: none;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.modal-head p {
  font-size: 12.5px;
  color: var(--ink2);
  margin-top: 2px;
}
.modal-x {
  margin-left: auto;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink2);
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.modal-x:hover {
  background: var(--soft);
  color: var(--ink);
}
.modal-body {
  padding: 18px 22px 22px;
}
.modal-foot {
  padding: 0 22px 20px;
  font-size: 11.5px;
  color: var(--ink3);
}

/* ---------- statistik pengunjung ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat-cell {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--soft);
}
.stat-cell b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.4px;
}
.stat-cell span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink3);
}
.stat-cell.hi {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.stat-cell.hi b {
  color: var(--accent-strong);
}

.bars {
  margin-top: 18px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 6px;
}
.bars .bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  height: 100%;
}
.bars .bar i {
  display: block;
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  height: var(--h, 0%);
  min-height: 2px;
  transition: height 0.5s var(--ease);
}
.bars .bar span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 1px;
  color: var(--ink3);
}
.bars-cap {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink2);
  margin-top: 12px;
}

/* ---------- info situs ---------- */
.info-list {
  display: grid;
  gap: 0;
}
.info-list div {
  display: flex;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.info-list div:last-child {
  border-bottom: 0;
}
.info-list dt,
.info-list b {
  flex: none;
  width: 132px;
  color: var(--ink3);
  font-weight: 600;
  font-size: 12.5px;
}
.info-list span {
  color: var(--ink);
}

/* ---------- login ---------- */
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink2);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--soft);
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.btn-block {
  width: 100%;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 20px var(--accent-shadow);
  transition: background 0.2s ease;
}
.btn-block:hover {
  background: var(--accent-strong);
}
.login-alt {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink2);
}
.login-alt a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .info-list div {
    flex-direction: column;
    gap: 2px;
  }
  .info-list dt,
  .info-list b {
    width: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal-box {
    transition: none;
  }
}
