/* =========================================================================
   Naikyu — Software Assessment
   Tema terang/gelap: default mengikuti sistem; tombol di header menyimpan
   pilihan ke <html data-theme="light|dark">.
   ========================================================================= */
:root {
  --bg: #f6f5f2;
  --bg-glow-1: rgba(222, 59, 42, .10);
  --bg-glow-2: rgba(255, 138, 76, .10);
  --surface: #ffffff;
  --surface-2: #f3f1ed;
  --surface-3: #ebe8e3;
  --border: #e5e1db;
  --border-strong: #d3cec6;
  --text: #16171a;
  --muted: #5d626c;
  --faint: #8b909a;
  --brand: #de3b2a;          /* titik merah logo */
  --brand-2: #f0612f;
  --brand-deep: #c22f20;
  --brand-ink: #ffffff;
  --brand-soft: #fdefec;
  --brand-ring: rgba(222, 59, 42, .20);
  --accent: var(--brand);    /* alias untuk kode lama */
  --accent-ink: var(--brand-ink);
  --accent-soft: var(--brand-soft);
  --ok: #17804f;
  --ok-soft: #e2f4ea;
  --warn: #a15c00;
  --warn-soft: #fdf1dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(22, 23, 26, .05);
  --shadow: 0 1px 2px rgba(22, 23, 26, .04), 0 8px 28px -8px rgba(22, 23, 26, .10);
  --shadow-cta: 0 6px 18px -6px rgba(222, 59, 42, .55);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e11;
    --bg-glow-1: rgba(255, 92, 70, .10);
    --bg-glow-2: rgba(255, 150, 90, .06);
    --surface: #16171b;
    --surface-2: #1d1f24;
    --surface-3: #25282e;
    --border: #2a2d34;
    --border-strong: #3a3e47;
    --text: #eceef1;
    --muted: #a4a9b3;
    --faint: #717784;
    --brand: #ff5a45;
    --brand-2: #ff7d4d;
    --brand-deep: #e2412f;
    --brand-ink: #ffffff;
    --brand-soft: #2b1614;
    --brand-ring: rgba(255, 90, 69, .28);
    --ok: #4fd08f;
    --ok-soft: #10281c;
    --warn: #f0b25a;
    --warn-soft: #2e230f;
    --danger: #ff7b70;
    --danger-soft: #331715;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-cta: 0 8px 22px -8px rgba(255, 90, 69, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e11;
  --bg-glow-1: rgba(255, 92, 70, .10);
  --bg-glow-2: rgba(255, 150, 90, .06);
  --surface: #16171b;
  --surface-2: #1d1f24;
  --surface-3: #25282e;
  --border: #2a2d34;
  --border-strong: #3a3e47;
  --text: #eceef1;
  --muted: #a4a9b3;
  --faint: #717784;
  --brand: #ff5a45;
  --brand-2: #ff7d4d;
  --brand-deep: #e2412f;
  --brand-ink: #ffffff;
  --brand-soft: #2b1614;
  --brand-ring: rgba(255, 90, 69, .28);
  --ok: #4fd08f;
  --ok-soft: #10281c;
  --warn: #f0b25a;
  --warn-soft: #2e230f;
  --danger: #ff7b70;
  --danger-soft: #331715;
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-cta: 0 8px 22px -8px rgba(255, 90, 69, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 8% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.6 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: background-color .35s, color .35s;
}
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.22; margin: 0 0 .4em; text-wrap: balance; letter-spacing: -.015em; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.35rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--brand-ring); }

/* ---- layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-logo { width: 34px; height: 34px; flex: none; display: block; color: var(--text); transition: transform .5s var(--ease-spring); }
.brand:hover .brand-logo { transform: rotate(-12deg) scale(1.06); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 64px; }
.narrow { max-width: 780px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
  transition: background-color .35s, border-color .35s;
}
.card + .card { margin-top: 16px; }
@media (max-width: 600px) { .card { padding: 20px 16px; } }
@media (max-width: 520px) { .brand-text { display: none; } }

/* ---- tombol */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease-out), box-shadow .2s, background-color .2s, border-color .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary {
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--brand-ink); border-color: transparent;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 55%, var(--brand-2));
  background-size: 160% 160%; background-position: 0% 50%;
  box-shadow: var(--shadow-cta);
  padding: 12px 22px;
}
.btn-primary:hover {
  /* .btn:hover sets the `background` shorthand; restate the gradient so hover never turns grey */
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 55%, var(--brand-2));
  background-size: 160% 160%; background-position: 100% 50%;
  border-color: transparent; transform: translateY(-2px); box-shadow: 0 12px 26px -8px var(--brand-ring), var(--shadow-cta);
}
.btn-primary::after { /* kilau yang menyapu saat hover */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary .arrow { transition: transform .25s var(--ease-spring); }
.btn-primary:hover .arrow { transform: translateX(4px); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-ghost .arrow { transition: transform .25s var(--ease-spring); }
.btn-ghost:hover .arrow { transform: translateX(-4px); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: 14px 26px; font-size: 1rem; border-radius: 13px; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-link { background: none; border: none; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- switch tema */
.theme-toggle {
  --w: 62px; --h: 32px; --k: 26px;
  position: relative; width: var(--w); height: var(--h); flex: none; padding: 0; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--border);
  background: linear-gradient(180deg, #cfe8ff, #fef3d6);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08);
  transition: background .45s, border-color .3s, box-shadow .3s;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 4px var(--brand-ring); }
.theme-toggle .knob {
  position: absolute; top: 2px; left: 2px; width: var(--k); height: var(--k); border-radius: 50%;
  display: grid; place-items: center; color: #f59e0b;
  background: #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .5s var(--ease-spring), background .4s, color .4s;
}
.theme-toggle .knob svg { width: 16px; height: 16px; transition: transform .6s var(--ease-spring), opacity .3s; }
.theme-toggle .knob .moon { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-toggle .stars { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.theme-toggle .stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .4s, transform .5s; transform: translateY(4px); }
.theme-toggle .stars i:nth-child(1) { left: 12px; top: 8px; }
.theme-toggle .stars i:nth-child(2) { left: 20px; top: 18px; width: 3px; height: 3px; }
.theme-toggle .stars i:nth-child(3) { left: 9px; top: 20px; }
.theme-toggle[aria-checked="true"] { background: linear-gradient(180deg, #1c2340, #2c1f3a); border-color: var(--border-strong); }
.theme-toggle[aria-checked="true"] .knob { transform: translateX(calc(var(--w) - var(--k) - 6px)); background: #2a2f45; color: #ffd98a; }
.theme-toggle[aria-checked="true"] .knob .sun { opacity: 0; transform: rotate(90deg) scale(.5); }
.theme-toggle[aria-checked="true"] .knob .moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle[aria-checked="true"] .stars i { opacity: .9; transform: none; }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---- field */
.field { margin-bottom: 20px; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 7px; font-size: .95rem; }
.req { color: var(--brand); margin-left: 3px; }
.opt { color: var(--faint); font-weight: 500; font-size: .82rem; margin-left: 6px; }
.help { color: var(--muted); font-size: .84rem; margin-top: 6px; }
.err { color: var(--danger); font-size: .85rem; font-weight: 600; margin-top: 6px; }
.err:empty { display: none; }
.err:not(:empty)::before { content: "⚠ "; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color .2s, box-shadow .25s, background-color .35s;
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b909a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring);
}
.btn:focus-visible, .choice:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid { animation: shake .4s var(--ease-out); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---- pilihan (chip checkbox) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.choice {
  position: relative; display: flex; gap: 10px; align-items: center; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface);
  transition: border-color .2s, background-color .2s, transform .18s var(--ease-out), box-shadow .2s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.choice:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.choice:active { transform: scale(.98); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .tick {
  width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; background: var(--surface); transition: all .25s var(--ease-spring);
}
.choice .tick svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset .3s .05s var(--ease-out); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:checked) .tick { background: var(--brand); border-color: var(--brand); transform: scale(1.08); }
.choice:has(input:checked) .tick svg { stroke-dashoffset: 0; }
.choice.consent { align-items: flex-start; }
.choice.consent .tick { margin-top: 2px; }

/* ---- kartu pilihan besar (jenis kebutuhan) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cards .choice { flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; min-height: 100%; }
.cards .choice:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cards .choice .card-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--surface-2); color: var(--muted); transition: all .35s var(--ease-spring);
}
.cards .choice .card-icon svg { width: 22px; height: 22px; }
.cards .choice:has(input:checked) .card-icon { background: linear-gradient(135deg, var(--brand-deep), var(--brand-2)); color: #fff; transform: rotate(-6deg) scale(1.05); }
.cards .choice strong { font-size: 1rem; line-height: 1.3; }
.cards .choice > span:not(.card-icon):not(.check) { color: var(--muted); font-size: .88rem; }
.cards .choice .check {
  position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  transform: scale(0); transition: transform .35s var(--ease-spring);
}
.cards .choice .check svg { width: 14px; height: 14px; stroke-width: 3; }
.cards .choice:has(input:checked) .check { transform: scale(1); }

/* ---- hero */
.hero { padding: 20px 0 28px; }
.hero p { max-width: 640px; font-size: 1.02rem; }
.hl { background: linear-gradient(120deg, var(--brand-deep), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: .82rem; font-weight: 700; color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.chip svg.i { width: 15px; height: 15px; color: var(--brand); }

/* ---- wizard */
.wizard { padding: 0; overflow: hidden; }
.wizard-head { padding: 22px 28px 0; }
.wizard-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.wizard-meta .left { color: var(--text); }
.progress.big { height: 6px; }
.steps { display: flex; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps li { flex: 1 0 auto; }
.steps button {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px;
  border: 0; background: transparent; color: var(--faint); font: inherit; font-size: .8rem; font-weight: 700; white-space: nowrap;
  cursor: default; transition: background .2s, color .2s;
}
.steps .num {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .75rem;
  background: var(--surface-2); color: var(--faint); transition: all .35s var(--ease-spring);
}
.steps .num svg { width: 13px; height: 13px; stroke-width: 3; }
.steps li.done button { color: var(--muted); cursor: pointer; }
.steps li.done button:hover { background: var(--surface-2); color: var(--text); }
.steps li.done .num { background: var(--ok-soft); color: var(--ok); }
.steps li.active button { color: var(--text); background: var(--brand-soft); }
.steps li.active .num { background: var(--brand); color: #fff; transform: scale(1.08); box-shadow: 0 0 0 4px var(--brand-ring); }
@media (max-width: 760px) { .steps li:not(.active) .label-text { display: none; } .steps li { flex: 0 0 auto; } }
.step-body { padding: 26px 28px 4px; }
.step-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.step-icon {
  width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-2)); box-shadow: var(--shadow-cta);
}
.step-icon svg { width: 22px; height: 22px; }
.step-title h2 { margin: 0 0 2px; }
.step-title p { margin: 0; color: var(--muted); }
.wizard-foot { padding: 6px 28px 24px; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.wizard-nav .hint { color: var(--faint); font-size: .8rem; }
.wizard-nav .hint kbd { font: inherit; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); }
@media (max-width: 600px) {
  .wizard-head { padding: 18px 16px 0; } .step-body { padding: 20px 16px 4px; } .wizard-foot { padding: 4px 16px 18px; }
  .wizard-nav .hint { display: none; } .wizard-nav .btn-primary { flex: 1; }
  .step-icon { width: 40px; height: 40px; border-radius: 12px; }
}

/* transisi langkah */
.step-enter { animation: stepIn .45s var(--ease-out) both; }
.step-enter.back { animation-name: stepInBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.step-enter .field, .step-enter .flow-block { animation: rise .5s var(--ease-out) both; }
.step-enter .field:nth-child(2) { animation-delay: .03s; } .step-enter .field:nth-child(3) { animation-delay: .06s; }
.step-enter .field:nth-child(4) { animation-delay: .09s; } .step-enter .field:nth-child(5) { animation-delay: .12s; }
.step-enter .field:nth-child(n+6) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* catatan simpan otomatis */
.save-note {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--muted); font-size: .88rem; margin: 18px 0 0;
}
.save-note svg.i { color: var(--ok); margin-top: 2px; }
.save-note strong { color: var(--text); }
.autosave {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--muted);
  padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  transition: color .3s, border-color .3s;
}
.autosave .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(23, 128, 79, .5); }
.autosave.flash { color: var(--ok); border-color: var(--ok); }
.autosave.flash .dot { animation: ping .9s var(--ease-out); }
@keyframes ping { from { box-shadow: 0 0 0 0 rgba(23, 128, 79, .55); } to { box-shadow: 0 0 0 8px rgba(23, 128, 79, 0); } }
@media (max-width: 600px) { .autosave .txt { display: none; } }

/* toast */
.toast-wrap { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45); font-size: .9rem;
  animation: toastIn .5s var(--ease-spring) both;
}
.toast.out { animation: toastOut .3s ease-in both; }
.toast .grow { flex: 1; }
.toast button { background: none; border: 0; color: inherit; font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* ---- pill */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.accent { background: var(--brand-soft); color: var(--brand); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* ---- review / jawaban */
.review-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 20px; }
.answers { display: grid; grid-template-columns: minmax(160px, 34%) 1fr; gap: 10px 18px; margin: 0; }
.answers dt { color: var(--muted); font-size: .88rem; }
.answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 500; }
.answers-section { margin: 22px 0 10px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 800; }
.answers-section:first-child { margin-top: 0; }
@media (max-width: 600px) { .answers { grid-template-columns: 1fr; gap: 2px; } .answers dd { margin-bottom: 12px; } }

/* ---- progres */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div {
  height: 100%; border-radius: 999px; transition: width .7s var(--ease-out);
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-2));
}
.progress.done > div { background: var(--ok); }
.stepper { display: flex; margin: 18px 0 6px; padding: 0; list-style: none; overflow-x: auto; gap: 0; }
.stepper li { flex: 1 0 84px; text-align: center; font-size: .72rem; color: var(--faint); position: relative; padding-top: 24px; }
.stepper li::before {
  content: ""; position: absolute; top: 5px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--border); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--muted); }
.stepper li.done::before { background: var(--brand); border-color: var(--brand); }
.stepper li.done::after, .stepper li.current::after { background: var(--brand); }
.stepper li.current { color: var(--text); font-weight: 800; }
.stepper li.current::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-ring); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px transparent; } }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand);
}
.timeline li.client::before { border-color: var(--ok); }
.timeline li.internal::before { border-color: var(--warn); border-style: dashed; }
.timeline .meta { font-size: .8rem; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timeline .meta strong { color: var(--text); }
.timeline .msg { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.kv div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.kv dt { font-size: .72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.kv dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; background: var(--brand-soft); }
.alert.error { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.code-box {
  font: 800 1.9rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .14em;
  background: var(--surface-2); border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 18px; text-align: center; margin: 14px 0;
}
details.box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 16px; transition: background-color .2s; }
details.box > summary { cursor: pointer; padding: 13px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .25s var(--ease-out); margin-right: 4px; }
details.box[open] > summary::before { transform: rotate(45deg); }
details.box > summary:hover { color: var(--brand); }
details.box[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 14px; }
details.box[open] { padding-bottom: 16px; }

/* ---- sukses */
.success { text-align: center; position: relative; overflow: hidden; }
.success .big-check {
  width: 84px; height: 84px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok); animation: pop .6s var(--ease-spring) both;
}
.success .big-check svg { width: 42px; height: 42px; stroke-width: 3; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .35s var(--ease-out) forwards; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success .row-actions { justify-content: center; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: fall 2.4s var(--ease-out) forwards; }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(420px) rotate(540deg); } }

/* ---- admin */
.admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 140px; }
.list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 220px); overflow: auto; }
@media (max-width: 960px) { .list { max-height: none; } }
.list li button {
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border);
  padding: 12px 8px; cursor: pointer; color: inherit; font: inherit; display: grid; gap: 5px; border-radius: 10px; transition: background .15s;
}
.list li button:hover { background: var(--surface-2); }
.list li button.active { background: var(--brand-soft); }
.list .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.list .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.stats button { cursor: pointer; border: 0; font: inherit; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; cursor: pointer; }
.inline-check input { accent-color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; flex: none; }
.footer { text-align: center; color: var(--faint); font-size: .8rem; padding: 24px 16px 32px; }

/* ---- alur per modul */
.flow-block {
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px 20px 2px; margin: 0 0 18px; min-width: 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 90px);
}
.flow-block legend { font-weight: 800; padding: 0 8px; display: flex; gap: 8px; align-items: center; }
.flow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.flow-grid.wide { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .flow-grid, .flow-grid.wide { grid-template-columns: 1fr; } .flow-block { padding: 14px 14px 2px; } }
.flow-answer { white-space: pre-wrap; margin-bottom: 10px; }
.flow-answer:last-child { margin-bottom: 0; }
.flow-answer > span { display: block; font-size: .76rem; color: var(--faint); white-space: normal; font-weight: 600; }

/* ---- animasi masuk halaman */
.fade-up { animation: rise .6s var(--ease-out) both; }
.fade-up.d1 { animation-delay: .08s; } .fade-up.d2 { animation-delay: .16s; }

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

/* ---- isian "Lainnya" */
.other-input { margin: -6px 0 20px; padding: 14px 16px 2px; border-left: 3px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--brand-soft); }
.other-input:not(.hidden) { animation: otherIn .4s var(--ease-out) both; transform-origin: top; }
.other-input .field { margin-bottom: 12px; }
@keyframes otherIn { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } to { opacity: 1; transform: none; } }
