/* ==============================================================
   PENGETAHUAN SEBAGAI DAYA — Sistem Desain
   ==============================================================
   Token warna diturunkan dari identitas visual CCES × Lokadaya
   yang sudah dipakai di seluruh dokumen program (teal/gold/brown/red).
   Elemen tanda tangan: "Akar Pengetahuan" — indikator progres berbentuk
   garis akar yang tumbuh & bertunas di tiap bagian selesai, alih-alih
   progress bar generik — merepresentasikan tema "pengetahuan sebagai daya".
   ============================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --ink: #1A2421;
  --canvas: #F7FAF9;
  --surface: #FFFFFF;
  --muted: #5C6B66;
  --line: #DCE7E2;

  --teal-900: #0B3D3A;
  --teal-700: #0F5C58;
  --teal-500: #14867E;
  --teal-100: #DCF0EC;

  --gold-700: #9C7A1E;
  --gold-100: #FBF1D2;

  --brown-700: #5C4632;
  --brown-100: #ECE3D8;

  --red-700: #B4262A;
  --red-100: #FBE2E2;

  --sprout-600: #3F8F5F;
  --sprout-100: #E1F3E8;

  --matriks: #6B4FA0;
  --matriks-100: #EEE9F6;
  --relasi: #1B6EA6;
  --relasi-100: #E4F0F8;

  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 1px 2px rgba(15,45,42,0.04), 0 8px 24px rgba(15,45,42,0.08);
  --shadow-lift: 0 4px 8px rgba(15,45,42,0.06), 0 16px 40px rgba(15,45,42,0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(15,92,88,0.06), transparent),
    radial-gradient(ellipse 700px 500px at 110% 10%, rgba(156,122,30,0.06), transparent);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  color: var(--teal-900);
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--teal-700); }

:focus-visible {
  outline: 3px solid var(--teal-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 96px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247,250,249,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 10px;
}
.topbar-inner { max-width: 720px; margin: 0 auto; }
.topbar-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.topbar-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--teal-900); }
.topbar-save { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.topbar-save .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sprout-600); }
.topbar-save.saving .dot { background: var(--gold-700); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.root-progress { position: relative; height: 34px; }
.root-progress svg { width: 100%; height: 34px; display: block; overflow: visible; }
.root-progress .root-track { stroke: var(--line); stroke-width: 3; fill: none; }
.root-progress .root-fill { stroke: url(#rootGradient); stroke-width: 3; fill: none; stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(.4,0,.2,1); }
.root-progress .root-node { fill: var(--surface); stroke: var(--line); stroke-width: 2; transition: all .3s ease; }
.root-progress .root-node.done { fill: var(--sprout-600); stroke: var(--sprout-600); }
.root-progress .root-node.current { fill: var(--surface); stroke: var(--teal-700); stroke-width: 3; }
.root-progress .root-leaf { opacity: 0; transform-origin: center; transition: opacity .4s ease, transform .4s ease; }
.root-progress .root-leaf.show { opacity: 1; }
.section-labels { display: flex; justify-content: space-between; margin-top: 2px; }
.section-labels span { font-size: 10px; color: var(--muted); font-family: var(--font-mono); width: 14px; text-align: center; }
.section-labels span.current { color: var(--teal-700); font-weight: 700; }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  margin-top: 24px;
  animation: rise .45s cubic-bezier(.2,.7,.3,1);
}
@keyframes rise { from { opacity:0; transform: translateY(14px);} to { opacity:1; transform: translateY(0);} }

.section-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-500); margin-bottom: 6px; }
.section-title { font-size: 26px; font-weight: 600; margin-bottom: 4px; }
.section-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 22px; }

.q-block { margin-bottom: 30px; }
.q-block:last-child { margin-bottom: 0; }
.q-label { font-weight: 600; font-size: 15.5px; color: var(--ink); margin-bottom: 12px; line-height: 1.45; }
.q-hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; cursor: pointer; transition: border-color .15s ease, background .15s ease;
  background: var(--surface); font-size: 14.5px;
}
.opt:hover { border-color: var(--teal-500); }
.opt input { accent-color: var(--teal-700); width: 18px; height: 18px; flex-shrink: 0; }
.opt.checked { border-color: var(--teal-700); background: var(--teal-100); font-weight: 600; }
.opt.shake { animation: shake .4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.opt-other-input {
  margin-top: 8px; width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); font-family: var(--font-body); font-size: 14px;
}

textarea, .relation-input, .code-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--font-body); font-size: 14.5px; color: var(--ink);
  resize: vertical; transition: border-color .15s ease;
}
textarea:focus, .relation-input:focus, .code-input:focus { border-color: var(--teal-500); }

.scale-row { display: flex; gap: 6px; margin-bottom: 8px; }
.scale-btn {
  flex: 1; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-family: var(--font-mono);
  font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); transition: all .15s ease;
}
.scale-btn:hover { border-color: var(--teal-500); }
.scale-btn.checked { background: var(--teal-700); border-color: var(--teal-700); color: #fff; transform: scale(1.08); }
.scale-anchors { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-style: italic; }

.matrix-wrap { display: flex; flex-direction: column; gap: 18px; }
.matrix-row { border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; background: linear-gradient(180deg, #fff, #FBFDFC); }
.matrix-row-label { font-weight: 700; font-size: 14px; color: var(--matriks); margin-bottom: 10px; display:flex; align-items:center; gap:8px;}
.matrix-row-label .dot { width:8px; height:8px; border-radius:50%; background: var(--matriks); }
.matrix-levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 640px) { .matrix-levels { grid-template-columns: 1fr; } }
.matrix-level {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer;
  font-size: 12.5px; line-height: 1.4; transition: all .15s ease; background: var(--surface);
}
.matrix-level .lvl-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--matriks); font-weight: 700; display:block; margin-bottom: 4px;}
.matrix-level:hover { border-color: var(--matriks); }
.matrix-level.checked { border-color: var(--matriks); background: var(--matriks-100); font-weight: 600; }

.rank-list { display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; margin: 0; }
.rank-item {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  cursor: grab; font-size: 14px; transition: box-shadow .15s ease, border-color .15s ease;
}
.rank-item.dragging { opacity: .4; }
.rank-item.drag-over { border-color: var(--red-700); }
.rank-badge {
  width: 26px; height: 26px; border-radius: 50%; background: var(--red-100); color: var(--red-700);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700;
  font-size: 12px; flex-shrink: 0;
}
.rank-handle { margin-left: auto; color: var(--line); font-size: 18px; }
.rank-blurb { font-size: 12px; color: var(--muted); margin-top: 2px; }

.relation-table-wrap { overflow-x: auto; }
.relation-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.relation-table th {
  background: var(--relasi-100); color: var(--relasi); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--relasi);
}
.relation-table td { padding: 6px; border-bottom: 1px solid var(--line); }
.relation-table select, .relation-table input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px; font-family: var(--font-body); }

.nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 12px; }
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px; border-radius: 999px;
  padding: 13px 26px; border: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--teal-700); color: #fff; box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--teal-900); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.reveal-card {
  background: linear-gradient(160deg, var(--teal-900), var(--teal-700));
  color: #fff; border-radius: var(--radius-lg); padding: 32px 26px;
  margin-top: 24px; box-shadow: var(--shadow-lift); position: relative; overflow: hidden;
}
.reveal-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% -10%, rgba(255,255,255,0.15), transparent 55%);
}
.reveal-eyebrow { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.reveal-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 6px 0 14px; color: #fff; }
.reveal-message { font-size: 14.5px; opacity: .92; line-height: 1.6; }
.radar-wrap { background: rgba(255,255,255,0.08); border-radius: var(--radius-md); padding: 14px; margin: 18px 0; }
.pillar-card { background: rgba(255,255,255,0.1); border-radius: var(--radius-md); padding: 16px 18px; margin-top: 12px; }
.pillar-card .pillar-num { font-family: var(--font-mono); font-size: 11px; opacity: .7; }
.pillar-card .pillar-title { font-weight: 700; font-size: 15px; margin: 4px 0 6px; }
.pillar-card .pillar-blurb { font-size: 13px; opacity: .88; line-height: 1.5; }

.kartu-kesiapan {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  padding: 32px 26px; text-align: center; margin-top: 24px; position: relative;
}
.kartu-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--sprout-100); color: var(--sprout-600);
  padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 13px; margin-bottom: 16px;
}
.kartu-org { font-family: var(--font-display); font-size: 24px; margin-bottom: 4px; }
.kartu-code { font-family: var(--font-mono); font-size: 13px; color: var(--muted); background: var(--canvas); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 14px; display: inline-block; margin: 10px 0 20px; }
.kartu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; margin-top: 20px; }
@media (max-width: 520px) { .kartu-grid { grid-template-columns: 1fr; } }
.kartu-stat { background: var(--canvas); border-radius: var(--radius-sm); padding: 14px 16px; }
.kartu-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.kartu-stat-value { font-weight: 700; font-size: 14.5px; color: var(--teal-900); }

.landing-hero { padding: 64px 0 20px; text-align: center; }
.landing-hero h1 { font-size: 40px; line-height: 1.12; }
.landing-hero .lead { font-size: 16px; color: var(--muted); max-width: 480px; margin: 16px auto 0; }
.landing-stats { display: flex; gap: 10px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.landing-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 16px; font-size: 13px; }
.landing-stat b { color: var(--teal-700); font-family: var(--font-mono); }
.form-toggle { display: flex; gap: 8px; background: var(--teal-100); padding: 4px; border-radius: 999px; margin-bottom: 20px; }
.form-toggle button { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--teal-900); }
.form-toggle button.active { background: var(--teal-700); color: #fff; }
.field-group { margin-bottom: 14px; }
.field-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field-group input[type=text], .field-group input[type=email], .field-group input[type=tel] {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); font-size: 14.5px; font-family: var(--font-body);
}
.consent-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); margin: 14px 0; }
.error-box { background: var(--red-100); color: var(--red-700); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px; }
.honeypot { position: absolute; left: -9999px; opacity: 0; }

.footer-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 40px; }
