/* ============================================================
   cipta-form.css — tampilan status/validasi untuk form kontak
   yang dihidupkan oleh cipta-form.js. Netral terhadap tema situs:
   hanya menambah keadaan error, status sukses, dan toast.
   ============================================================ */

/* input tidak valid */
.cf-invalid input,
.cf-invalid select,
.cf-invalid textarea,
input.cf-invalid,
select.cf-invalid,
textarea.cf-invalid {
  border-color: #e0453a !important;
  box-shadow: 0 0 0 3px rgba(224, 69, 58, 0.16) !important;
  outline: none !important;
}
.cf-invalid label { color: #e0453a !important; }

.cf-err {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  color: #e0453a;
}

/* kotak status di bawah form */
.cf-status {
  display: none;
  margin: 0.9rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.55;
  border: 1px solid transparent;
}
.cf-status.cf-status--ok,
.cf-status.cf-status--warn { display: block; }

.cf-status--ok {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.45);
  color: #0d7a42;
}
.cf-status--warn {
  background: rgba(224, 69, 58, 0.10);
  border-color: rgba(224, 69, 58, 0.40);
  color: #b0342b;
}
/* tema gelap: teks lebih terang */
@media (prefers-color-scheme: dark) {
  .cf-status--ok { color: #7BE3A5; }
  .cf-status--warn { color: #FF9A92; }
}
[data-theme="dark"] .cf-status--ok,
.section--ink .cf-status--ok,
.hero--dark .cf-status--ok { color: #8ef0b4; }
[data-theme="dark"] .cf-status--warn,
.section--ink .cf-status--warn { color: #ffb3ac; }

.cf-status a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
}

.cf-status .cf-copy {
  display: block;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.9);
  color: #1b1b1b;
  resize: vertical;
}

/* baris tombol sekunder (kirim lewat email) */
.cf-alt {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
}
.cf-alt:hover { opacity: 1; }

/* toast saat validasi gagal */
.cf-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 9999;
  max-width: min(92vw, 460px);
  padding: 0.8rem 1.05rem;
  border-radius: 10px;
  background: #1f1f22;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.cf-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* tombol submit saat menunggu */
form[data-cf-wa] [type="submit"][disabled],
form[data-cf-email] [type="submit"][disabled] {
  opacity: 0.7;
  cursor: progress;
}
