/* Contact form styles. Loaded only on the two Contact pages. Builds on the
   shared design tokens and the existing .field rules (dark section context). */

.contact-form-wrap {
  max-width: 42rem;
}

.contact-form-intro {
  color: var(--on-dark-muted);
}

.contact-form {
  margin-top: 1.5rem;
}

/* Entered text should be brighter than the faint default; placeholders stay faint. */
.contact-form .field input,
.contact-form .field textarea,
.contact-form .field select {
  color: var(--on-dark);
  width: 100%;
}

.contact-form .field input::placeholder,
.contact-form .field textarea::placeholder {
  color: var(--on-dark-faint);
}

.contact-form .field textarea {
  min-height: 8.5rem;
  resize: vertical;
  line-height: 1.5;
}

.contact-form .field select {
  font: inherit;
  font-size: 0.95rem;
  background: var(--ink-900);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--on-dark-muted) 50%),
    linear-gradient(135deg, var(--on-dark-muted) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 1.15rem, calc(100% - 0.75rem) 1.15rem;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

/* Required / optional markers inside labels */
.req,
.opt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--on-dark-faint);
  font-weight: 400;
}
.req {
  color: var(--signal-soft);
}

.field-help {
  font-size: 0.85rem;
  color: var(--on-dark-muted);
  margin: 0;
}

/* Errors are never signalled by colour alone: a text label plus a marker. */
.field-error {
  display: none;
  font-size: 0.85rem;
  color: var(--form-error, #ffb1a3);
  font-weight: 600;
  margin-top: 0.15rem;
}
.field-error.is-visible {
  display: block;
}
.field-error::before {
  content: "⚠ ";
}

.contact-form .field input[aria-invalid="true"],
.contact-form .field textarea[aria-invalid="true"],
.contact-form .field select[aria-invalid="true"] {
  border-color: var(--form-error-border, #e8846f);
  border-width: 2px;
}

:root {
  --form-error: #ffb1a3;
  --form-error-border: #e8846f;
}

/* Status region shown by the enhanced flow (success or failure). */
.form-status {
  border: 1px solid var(--ink-700);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  background: var(--ink-900);
}
.form-status[data-kind="success"] {
  border-left-color: var(--signal);
}
.form-status[data-kind="error"] {
  border-left-color: var(--form-error-border, #e8846f);
}
.form-status p {
  margin: 0;
  color: var(--on-dark);
}

.cf-turnstile {
  margin: 0.5rem 0 1.25rem;
  min-height: 65px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-top: 0.5rem;
}

.form-fallback {
  font-size: 0.92rem;
  color: var(--on-dark-muted);
  margin: 0;
}

.form-notice {
  font-size: 0.85rem;
  color: var(--on-dark-muted);
  margin-top: 1.75rem;
  max-width: 60ch;
}

.form-noscript p {
  border: 1px solid var(--ink-700);
  border-left: 3px solid var(--signal);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  color: var(--on-dark);
  margin: 0 0 1.25rem;
}

/* Honeypot: kept out of view, out of the tab order and hidden from assistive tech. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 30rem) {
  .form-actions {
    gap: 0.85rem;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Secondary direct-contact block on the two contact pages (paper section).
   A native <details>: keyboard-operable and functional without JavaScript.
   This is visual hierarchy only — the address stays in the served HTML and
   no anti-scraping or secrecy property is claimed or implied. */
.contact-direct {
  margin-top: 1rem;
}
.contact-direct summary {
  cursor: pointer;
  font-weight: 600;
}
.contact-direct[open] summary {
  margin-bottom: 0.5rem;
}
