/* ============================================================
   contact.css -- Contact page styles
   All colour values reference main.css design tokens.
   ============================================================ */

/* ── Form card ─────────────────────────────────────────────── */
.contact-form-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.25rem 2.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 520px) {
  .contact-form-wrap {
    padding: 1.5rem 1.25rem 1.75rem;
    border-radius: var(--radius-lg);
  }
}

/* ── Fields ────────────────────────────────────────────────── */
.contact-field {
  margin-bottom: 1.375rem;
}

.contact-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bark);
  margin-bottom: 0.4rem;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6875rem 0.9rem;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--bark);
  background: var(--linen);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.contact-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239C8070' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px var(--clay-mid);
  background: var(--white);
}

.contact-field input.has-error,
.contact-field select.has-error,
.contact-field textarea.has-error {
  border-color: #B91C1C;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.contact-field textarea {
  resize: vertical;
  min-height: 148px;
  line-height: 1.65;
}

/* ── Field errors ──────────────────────────────────────────── */
.contact-field-error {
  display: block;
  font-size: 0.8125rem;
  color: #B91C1C;
  margin-top: 0.35rem;
  min-height: 1.1em;
}

/* ── Submit ────────────────────────────────────────────────── */
.contact-actions {
  margin-top: 1.75rem;
}

/* Spinner inside button */
.contact-btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: contact-spin 0.65s linear infinite;
  flex-shrink: 0;
}

.btn.is-loading .contact-btn-spinner {
  display: inline-block;
}

.btn.is-loading .contact-btn-label {
  opacity: 0.75;
}

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

/* ── Status message ────────────────────────────────────────── */
.contact-status {
  margin-top: 1rem;
  font-size: 0.9375rem;
  min-height: 1.5em;
  text-align: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.contact-status.status-success {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.75rem 1rem;
}

.contact-status.status-error {
  color: #9b1a1a;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0.75rem 1rem;
}

/* ── Alt contact ───────────────────────────────────────────── */
.contact-alt {
  text-align: center;
  font-size: 0.9rem;
  color: var(--dust);
  line-height: 1.7;
  padding-bottom: 1rem;
}

.contact-alt p + p {
  margin-top: 0.25rem;
}

.contact-alt a {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-alt a:hover {
  color: var(--clay-dark);
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .contact-btn-spinner {
    animation: none;
    opacity: 0.5;
  }
}
