/* ── Contact Form (popin) — v1.1 ──────────────────────
   Mirrors waitlist-wizard popin pattern visually but lives in its own
   namespace (.cf-*) so we never touch the waitlist module.
   Inherits --bg, --bg-dark, --bg-card, --fg, --dim, --purple, --green,
   --red, --glow, --radius, --mono, --sans from the parent stylesheet.
   Brand: primary = --purple, success/validation = --green.
*/

/* ── Backdrop ───────────────────────────────────── */
.cf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}
.cf-backdrop.cf-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal ──────────────────────────────────────── */
.cf-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-dark, #1e1f29);
  border: 1px solid var(--bg-card, #44475a);
  border-radius: calc(var(--radius, 8px) * 2);
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(189, 147, 249, 0.18);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s ease;
}
.cf-backdrop.cf-open .cf-modal {
  transform: translateY(0) scale(1);
}

.cf-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--dim, #6272a4);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}
.cf-close:hover {
  color: var(--fg, #f8f8f2);
  background: var(--bg-card, #44475a);
}

.cf-title {
  font-family: var(--sans, sans-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--fg, #f8f8f2);
  text-align: center;
}
.cf-subtitle {
  font-family: var(--sans, sans-serif);
  font-size: 0.85rem;
  color: var(--dim, #6272a4);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ── Form fields ────────────────────────────────── */
.cf-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.cf-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cf-label {
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim, #6272a4);
}
.cf-input,
.cf-select,
.cf-textarea {
  width: 100%;
  font-family: var(--mono, monospace);
  font-size: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg, #282a36);
  border: 1px solid var(--bg-card, #44475a);
  border-radius: var(--radius, 8px);
  color: var(--fg, #f8f8f2);
  outline: none;
  transition: border-color 0.2s;
}
.cf-input::placeholder,
.cf-textarea::placeholder { color: var(--dim, #6272a4); }
.cf-input:focus,
.cf-select:focus,
.cf-textarea:focus {
  border-color: var(--purple, #bd93f9);
}
.cf-textarea {
  min-height: 130px;
  resize: vertical;
  font-family: var(--mono, monospace);
  line-height: 1.5;
}
.cf-charcount {
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  color: var(--dim, #6272a4);
  text-align: right;
  margin-top: -0.1rem;
}
.cf-charcount.cf-charcount-max {
  color: var(--red, #ff5555);
}

/* honeypot — visually + a11y hidden but DOM-present so bots fill it */
.cf-honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Submit + states ────────────────────────────── */
.cf-submit {
  font-family: var(--mono, monospace);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.8rem 1.5rem;
  background: var(--purple, #bd93f9);
  color: var(--bg, #282a36);
  border: none;
  border-radius: var(--radius, 8px);
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.2s, opacity 0.2s;
  margin-top: 0.5rem;
}
.cf-submit:hover {
  background: color-mix(in srgb, var(--purple, #bd93f9) 85%, white);
  box-shadow: 0 0 20px var(--glow, rgba(189, 147, 249, 0.4));
  transform: translateY(-1px);
}
.cf-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cf-error {
  font-family: var(--mono, monospace);
  font-size: 0.78rem;
  color: var(--red, #ff5555);
  margin-top: 0.5rem;
  min-height: 1.2em;
  text-align: center;
}
.cf-success {
  font-family: var(--sans, sans-serif);
  font-size: 0.9rem;
  color: var(--green, #50fa7b);
  text-align: center;
  margin: 1rem 0;
  line-height: 1.5;
}

/* throttle (24h cooldown) panel */
.cf-throttle {
  font-family: var(--mono, monospace);
  font-size: 0.78rem;
  color: var(--orange, #ffb86c);
  background: rgba(255, 184, 108, 0.08);
  border: 1px solid rgba(255, 184, 108, 0.25);
  border-radius: var(--radius, 8px);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .cf-modal { padding: 2rem 1.25rem 1.5rem; }
  .cf-title { font-size: 1.05rem; }
}
