/* ===== Token warna & ukuran ===== */
:root {
  --teal-800: #0b4f50;
  --teal-700: #0f6264;
  --teal-600: #137c7e;
  --teal-100: #d5ebe9;
  --teal-50:  #eaf5f4;
  --beige-100: #f6f0e4;
  --beige-200: #ece3d0;
  --beige-300: #d9cdb2;
  --white: #ffffff;
  --ink: #1c2b2b;
  --ink-soft: #4d5f5f;
  --danger: #a3261f;
  --radius: 10px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--beige-100);
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ===== Header ===== */
.site-header { background: var(--teal-700); color: var(--white); padding: 28px 0 24px; }
.site-header h1 { margin: 0 0 8px; font-family: var(--font-head); font-size: 1.6rem; line-height: 1.2; font-weight: 700; }
.lead { margin: 0 0 14px; max-width: 62ch; color: #e3f1f0; }
.mode-note {
  margin: 0; max-width: 70ch; padding: 10px 14px;
  background: var(--teal-800); border-left: 4px solid var(--beige-300);
  border-radius: 6px; font-size: .9rem; color: #e3f1f0;
}

/* ===== Layout ===== */
.layout { display: grid; gap: 20px; padding-top: 20px; padding-bottom: 48px; }
.panel { background: var(--white); border: 1px solid var(--beige-200); border-radius: var(--radius); padding: 18px; }

/* ===== Form ===== */
form.panel { display: block; }
fieldset { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 12px; font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; color: var(--teal-800); }
.field { margin-bottom: 14px; }
label { display: block; margin-bottom: 5px; font-weight: 600; font-size: .95rem; }
.req { margin-left: 6px; font-weight: 400; font-size: .8rem; color: var(--ink-soft); }

input[type="text"], textarea, select {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--beige-300); border-radius: 8px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #7b8a8a; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }

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

.hint { margin: 5px 0 0; font-size: .85rem; color: var(--ink-soft); }
.error { margin: 5px 0 0; font-size: .88rem; color: var(--danger); font-weight: 600; }
.error:empty { display: none; }
.form-error { margin-bottom: 12px; }

/* ===== Tombol ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 20px;
  font: inherit; font-weight: 700; border-radius: 8px; border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:disabled { cursor: wait; opacity: .75; }
.btn-primary { width: 100%; background: var(--teal-700); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--teal-800); }
.btn-secondary { background: var(--white); color: var(--teal-800); border-color: var(--teal-600); }
.btn-secondary:hover { background: var(--teal-50); }
.btn-small { min-height: 44px; padding: 6px 14px; font-size: .9rem; }

/* ===== Hasil ===== */
.empty h2 { margin: 0 0 8px; font-family: var(--font-head); font-size: 1.15rem; color: var(--teal-800); }
.empty p { margin: 0; color: var(--ink-soft); }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.results-head h2 { margin: 0; font-family: var(--font-head); font-size: 1.3rem; color: var(--teal-800); }
.disclaimer { margin: 8px 0 16px; font-size: .88rem; color: var(--ink-soft); }

.group { margin-bottom: 22px; }
.group > h3 { margin: 0 0 10px; font-family: var(--font-head); font-size: 1.05rem; color: var(--teal-800); }

.card { background: var(--white); border: 1px solid var(--beige-200); border-left: 4px solid var(--teal-600); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-label { font-size: .9rem; font-weight: 700; color: var(--teal-700); }
.card textarea { min-height: 80px; background: var(--beige-100); border-color: var(--beige-200); }
.card textarea.tall { min-height: 220px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 32px); padding: 10px 16px;
  background: var(--teal-800); color: var(--white); border-radius: 8px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Tablet & desktop ===== */
@media (min-width: 640px) {
  .site-header h1 { font-size: 2rem; }
  .panel { padding: 24px; }
}
@media (min-width: 920px) {
  .layout { grid-template-columns: minmax(320px, 400px) 1fr; align-items: start; }
  form.panel { position: sticky; top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
