:root {
  --accent: #d92d20;
  --accent-dark: #a8231a;
  --ink: #16181d;
  --muted: #6b7280;
  --bg: #f6f7f9;
  --card-bg: #ffffff;
  --border: #e6e8eb;
  --success: #1a7f4e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }

.brand-mark {
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 7px;
  letter-spacing: 0.3px;
}

.topnav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.topnav a:hover { color: var(--ink); }

@media (max-width: 640px) {
  .topnav { display: none; }
}

/* ------------------------------------------------------------------- hero */

.hero {
  padding: 56px 0 36px;
  text-align: center;
  background: linear-gradient(180deg, #fff, var(--bg));
}

.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.2;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}

.hero p {
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.6;
}

/* --------------------------------------------------------------- category */

.category { margin: 40px 0; }
.category h2 {
  font-size: 20px;
  margin: 0 0 16px;
  scroll-margin-top: 80px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  border-color: #d6d9de;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg { width: 20px; height: 20px; }

.card-title { font-weight: 600; font-size: 15px; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }

.cat-organisasi .card-icon { background: #eaf1ff; color: #2152d1; }
.cat-optimalkan .card-icon { background: #fff3e0; color: #b45309; }
.cat-konversi .card-icon { background: #e8f8f0; color: #0f7a51; }
.cat-keamanan .card-icon { background: #fdeceb; color: #b91c1c; }

/* ------------------------------------------------------------------ footer */

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer .copyright {
  margin-top: 10px;
  font-size: 12px;
  color: #9aa0aa;
}

/* ------------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--card-bg);
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}

.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal .tool-desc { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; line-height: 1.5; }

/* -------------------------------------------------------------------- form */

.dropzone {
  border: 1.5px dashed #cfd3d9;
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 14px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.dropzone.drag { border-color: var(--accent); background: #fdf3f2; }
.dropzone strong { color: var(--ink); }

.filelist {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filelist li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 6px 10px;
}

.filelist .rm { cursor: pointer; color: var(--muted); font-weight: 700; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

.field input[type="range"] { width: 100%; }

.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; }

.btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}

.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: #cfd3d9; cursor: not-allowed; }

.status {
  margin-top: 14px;
  font-size: 13.5px;
  border-radius: 10px;
  padding: 10px 12px;
  display: none;
}

.status.show { display: block; }
.status.info { background: #eff6ff; color: #1d4ed8; }
.status.error { background: #fef2f2; color: #b91c1c; }
.status.success { background: #f0fdf4; color: var(--success); }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }
