/*
  Scoped styling for the contact form fields. Section-level layout
  (spacing, heading, intro copy) lives on the Tailwind classes in
  index.html, matching every other section on the page. This file only
  styles what Tailwind's utility classes don't cover: form field
  internals. Colors reference the site's real design-system variables
  (--z0-*, defined in styles.css) rather than one-off hex values.
*/

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.form-field .optional {
  font-weight: 400;
  color: var(--z0-stone-600);
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid var(--z0-stone-200);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--z0-sage);
  box-shadow: 0 0 0 3px rgba(107, 122, 100, 0.25);
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: #c0492f;
}

.field-error {
  font-size: 0.8rem;
  color: #c0492f;
  min-height: 1rem;
  margin: 0;
}

.char-count {
  font-size: 0.75rem;
  color: var(--z0-stone-600);
  text-align: right;
  margin: 0;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-banner {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.form-banner.success {
  background: #eaf4e6;
  color: #2e5c22;
  border: 1px solid #bcdcae;
}

.form-banner.error {
  background: #fbeceb;
  color: #8e2b21;
  border: 1px solid #f0bdb7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--z0-sage);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--z0-sage-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
