:root {
  --bg1: #f6f8fb;
  --bg2: #ecf3ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --ring: rgba(59, 130, 246, 0.3);
  --soft: rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html, body { font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

.app-bg {
  background: linear-gradient(175deg, var(--bg2) 0%, #e0f2fe 30%, var(--bg1) 100%);
}

.fade-in { animation: fadeIn .5s ease; }
@keyframes fadeIn { from {opacity:0; transform: translateY(10px)} to {opacity:1; transform: none} }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 14px var(--soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px var(--soft); }

.section-title {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; color: var(--text);
  border-bottom: 1px solid #e5e7eb; padding-bottom: .6rem; margin-bottom: 1rem;
}

.step-dot {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa); color: #fff; font-weight: 700; font-size: .9rem;
}

.label { display:block; font-size:.9rem; font-weight:600; color:#334155; margin-bottom:.35rem; }
.hint { font-size:.8rem; color:#64748b; margin-top:.35rem; }

.input-field {
  width: 100%; padding: 10px 12px;
  border-radius: 10px; border: 1px solid #d1d5db; background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.input-field:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 4px var(--ring);
}

/* [START] Animasi Tombol Dinamis */
.btn {
  padding: 10px 14px; border-radius: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease, color .2s ease, filter .15s ease, background-position .4s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(0,0,0,.06), 0 3px 6px rgba(0,0,0,.06);
}
.btn:active {
  transform: translateY(0px);
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  filter: brightness(0.95);
}
.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.btn-primary {
  color:#fff;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  background-size: 200% auto;
}
.btn-primary:hover {
  background-position: right center;
}

.btn-secondary { background:#eef2f7; color:#1f2937; border-color: #e5e7eb; }
.btn-secondary:hover { background-color: #e5e7eb; }

.btn-tertiary { background:#f8fafc; color:#475569; border:1px dashed #cbd5e1; }
.btn-tertiary:hover { background-color: #f1f5f9; border-color: #94a3b8; }

.btn-danger { background: #ef4444; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #dc2626; }


.ghost-btn {
  font-size: .85rem; padding: 6px 10px; border-radius: 8px; color:#64748b;
  background: transparent; border: 1px solid #e5e7eb;
}
.ghost-btn:hover { background:#f1f5f9; color:#0f172a; transform: translateY(-1px); }
.ghost-btn:active { transform: translateY(0); filter: brightness(0.95); }
.ghost-btn.danger:hover { border-color:#fecaca; background:#fee2e2; color:#b91c1c; }
/* [END] Animasi Tombol Dinamis */


.title-group {
  border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; background:#fafafa;
  animation: zoomIn .25s ease; position: relative;
  overflow: hidden; /* Tambahkan untuk animasi hapus yang rapi */
}
@keyframes zoomIn { from {opacity:0; transform: scale(.98)} to {opacity:1; transform: none} }
.group-title { color:#0f172a; }

/* [START] Animasi Hapus Grup */
@keyframes fadeOutShrink {
  from { opacity: 1; transform: scaleY(1); }
  to {
    opacity: 0;
    transform: scaleY(0);
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
    height: 0;
  }
}
.title-group.removing {
  transform-origin: top;
  animation: fadeOutShrink 0.3s ease-out forwards;
}
/* [END] Animasi Hapus Grup */


.form-row { display:block; }
.form-error { font-size:.8rem; color:#b91c1c; margin-top:.35rem; }

.info-box {
  border:1px solid #bfdbfe; background:#eff6ff; border-radius: 12px; padding: 10px 12px;
}

.code-wrap { border-radius: 12px; overflow:auto; background:#0b1020; border:1px solid #111827; }
.code-block {
  color:#f8fafc; font-size:.875rem; padding: 14px; white-space: pre; min-height: 160px;
}

.toggle-input { display:none; }
.toggle-track {
  width: 44px; height: 26px; background:#d1d5db; border-radius: 999px; position: relative;
}
.toggle-track::after {
  content:""; position:absolute; top:3px; left:3px; width:20px; height:20px;
  background:#fff; border-radius:999px; transition: transform .2s ease, background .2s ease;
}
.toggle-input:checked + .toggle-track { background:#3b82f6; }
.toggle-input:checked + .toggle-track::after { transform: translateX(18px); }

/* Dark mode */
.dark body, .dark .app-bg { background: radial-gradient(1200px 800px at 20% 0%, #0b1220, #0b1220 20%, #0f172a 100%); }
.dark .card { background:#0b1220; box-shadow: 0 0 0 1px rgba(148,163,184,.08); }
.dark .section-title { border-color: rgba(148,163,184,.12); color:#e2e8f0; }
.dark .label { color:#cbd5e1; }
.dark .input-field { background:#0b1220; color:#e2e8f0; border-color:#24344d; }
.dark .input-field:focus { border-color:#60a5fa; }
.dark .info-box { background:#0b243f; border-color:#1e40af; }
.dark .code-wrap { background:#020617; border-color:#0b1220; }
.dark .code-block { color:#e2e8f0; }
.dark .ghost-btn { border-color:#24344d; color:#93a3b8; }
.dark .ghost-btn:hover { background:#0b1626; color:#e2e8f0; }
.dark .btn-secondary { background:#0b1626; color:#e2e8f0; border-color: #24344d; }
.dark .btn-secondary:hover { background-color: #1e293b; }
.dark .btn-tertiary { background:#0b1626; color:#93a3b8; border-color:#24344d; }
.dark .btn-tertiary:hover { background-color: #1e293b; border-color: #475569; }
.dark .btn-danger { background: #991b1b; border-color: #7f1d1d; }
.dark .btn-danger:hover { background: #7f1d1d; }

/* [START] Custom Modal Styles */
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-zoom-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none; /* Diubah oleh JS */
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.custom-modal-overlay.visible {
  display: flex;
  animation: modal-fade-in 0.3s ease forwards;
}
.custom-modal {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.custom-modal-overlay.visible .custom-modal {
  animation: modal-zoom-in 0.3s ease forwards;
}
.dark .custom-modal {
  background: #0b1220;
  box-shadow: 0 0 0 1px rgba(148,163,184,.08);
}
.dark .custom-modal h3, .dark .custom-modal p {
  color: #e2e8f0;
}
/* [END] Custom Modal Styles */