:root{
  --bg:#000;
  --text:#e8eefc;
  --muted:#9fb0d0;
  --line:rgba(255,255,255,.12);
  --primary:#5aa7ff;
  --primary2:#2d7dff;
  --shadow: 0 18px 40px rgba(0,0,0,.55);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
}

.app{max-width:1100px;margin:0 auto;padding:18px 14px 28px}
.header{padding:10px 6px 18px}
.header h1{margin:0 0 6px;font-size:1.55rem;text-align: center;font-family: 'Times New Roman', Times, serif;}
.header p{margin:0;color:var(--muted);line-height:1.45}

.grid{display:grid;grid-template-columns:1fr;gap:14px}
@media (min-width: 900px){ .grid{grid-template-columns:520px 1fr;gap:16px} }

.card{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.card-soft{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding: 12px;
}

.card h2{margin:8px 0 10px;font-size:1.05rem}
.form{display:flex;flex-direction:column;gap:12px}
.row{display:flex;flex-direction:column;gap:6px}

.two{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
@media (min-width: 520px){ .two{grid-template-columns:1fr 1fr} }

label{font-size:.9rem;color:var(--muted)}

input, select, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: none;
  resize: vertical;
}

select option{
  background: #0b0b0b !important;
  color: #fff !important;
}


input:focus, select:focus, textarea:focus{
  border-color: rgba(90,167,255,.65);
  box-shadow: 0 0 0 3px rgba(90,167,255,.12);
}

.sep{
  border:0;
  border-top:1px solid rgba(255,255,255,.12);
  margin: 6px 0;
}

.actions{display:flex;gap:10px;margin-top:6px}
.btn{
  flex:1;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  cursor:pointer;
  font-weight:700;
  color:var(--text);
  background: rgba(255,255,255,.06);
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:active{transform:translateY(1px)}
.btn.primary{
  border-color: rgba(90,167,255,.35);
  background: linear-gradient(180deg, rgba(90,167,255,.95), rgba(45,125,255,.95));
  color:#071126;
}
.btn.ghost:hover{border-color:rgba(255,255,255,.22);background:rgba(255,255,255,.08)}
.btn.primary:hover{filter:brightness(1.03)}

.hint{margin:6px 0 0;color:var(--muted);font-size:.85rem;line-height:1.4}
.mini{margin:0;font-size:.82rem}
.muted{color:var(--muted)}

.preview-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.badge{
  font-size:.78rem;
  color:var(--text);
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  padding:6px 10px;
  border-radius:999px;
}

.preview{
  margin-top:10px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.02);
  padding:14px;
  min-height:360px;
  overflow:auto;
}
.preview pre{
  margin:0;
  white-space:pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size:.92rem;
  line-height:1.55;
}

.footer{margin-top:16px;text-align:center;color:var(--muted)}

/* ===== Toggle Switch ===== */
.toggle-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}
@media (min-width: 520px){
  .toggle-grid{grid-template-columns:1fr 1fr 1fr}
}

.toggle{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  cursor:pointer;
  user-select:none;
}

.toggle input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.toggle .txt{
  color:var(--text);
  font-size:.9rem;
  font-weight:650;
}

.track{
  width:46px;
  height:26px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  position:relative;
  flex: 0 0 auto;
  transition: .18s ease;
}

.thumb{
  width:22px;
  height:22px;
  border-radius:999px;
  background: rgba(255,255,255,.85);
  position:absolute;
  top:50%;
  left:2px;
  transform: translateY(-50%);
  transition: .18s ease;
}

.toggle:has(input:checked) .track{
  background: linear-gradient(180deg, rgba(90,167,255,.95), rgba(45,125,255,.95));
  border-color: rgba(90,167,255,.45);
}
.toggle:has(input:checked) .thumb{
  left: 22px;
  background: #071126;
}

.ttd-box {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  width: 100%;
  max-width: 400px;
  height: 180px;
  position: relative;
}

#signaturePad {
  width: 100%;
  height: 100%;
  touch-action: none; /* penting untuk mobile */
}

.ttd-actions {
  margin-top: 8px;
}