/* ================================================================
   contact.css — Contact page styles
   Depends on: tokens.css, global.css, home.css
   ================================================================ */

/* Active nav link */
.primary-nav a[aria-current="page"] {
  color: var(--color-text);
}

/* Hide reCAPTCHA badge (legal note is shown inline instead) */
.grecaptcha-badge {
  visibility: hidden !important;
}

/*
 * The HTML `hidden` attribute lives only in the browser's user-agent stylesheet
 * at the lowest possible specificity. Any author `display:` rule overrides it.
 * This rule restores the expected behaviour for all [hidden] elements on this page.
 */
[hidden] {
  display: none !important;
}

/* ── Page hero (same pattern as other inner pages) */

.page-hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-24) var(--space-16);
  text-align: center;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}

.page-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 65% 80% at 50% -20%,
    rgb(99 102 241 / 0.2) 0%,
    transparent 65%
  );
  pointer-events: none;
}

.page-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.page-hero h1 {
  font-size: clamp(var(--text-4xl), 6vw, 4.5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.page-hero-sub {
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  color: var(--color-muted);
  max-width: 52ch;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   CONTACT SECTION
═══════════════════════════════════════════════════════════════ */

.contact-section {
  padding-block: var(--space-24);
}

.contact-inner {
  max-width: 660px;
  margin-inline: auto;
}

/* ── Form wrap ─────────────────────────────────────────────── */

.form-section-heading {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* ── Individual field ──────────────────────────────────────── */

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
}

.required-mark {
  color: #f87171;
  font-size: 0.9em;
}

.optional-label {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-muted);
}

/* ── Inputs & textarea ─────────────────────────────────────── */

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  /* Prevent iOS zoom on focus */
  font-size: max(1rem, 16px);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.18);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgb(148 163 184 / 0.45);
}

/* Error state */
.form-input.is-invalid,
.form-textarea.is-invalid {
  border-color: rgb(248 113 113 / 0.65);
  box-shadow: 0 0 0 3px rgb(248 113 113 / 0.1);
}

.form-input.is-invalid:focus,
.form-textarea.is-invalid:focus {
  border-color: rgb(248 113 113 / 0.8);
  box-shadow: 0 0 0 3px rgb(248 113 113 / 0.15);
}

/* Textarea specifics */
.form-textarea {
  resize: vertical;
  min-height: 160px;
}

/* Textarea footer row: error left, counter right */
.textarea-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 1.25rem; /* prevents layout shift when error appears */
}

/* ── Field-level error ─────────────────────────────────────── */

.field-error {
  font-size: var(--text-sm);
  color: #f87171;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ── Character counter ─────────────────────────────────────── */

.char-counter {
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: color var(--transition-fast);
}

.char-counter.is-over-limit {
  color: #f87171;
  font-weight: 500;
}

/* ── reCAPTCHA note ────────────────────────────────────────── */

.recaptcha-note {
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.5;
  max-width: none;
  margin-top: calc(var(--space-2) * -1); /* pull up slightly from gap */
}

.recaptcha-note a {
  color: var(--color-muted);
  text-decoration: underline;
  text-decoration-color: rgb(148 163 184 / 0.4);
}

.recaptcha-note a:hover {
  color: var(--color-text);
}

/* ── Submit button ─────────────────────────────────────────── */

.submit-btn {
  align-self: flex-start;
  padding-inline: var(--space-8);
  min-width: 160px;
  justify-content: center;
  position: relative;
}

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

/* Loading spinner (appended via JS) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgb(255 255 255 / 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Generic error banner ──────────────────────────────────── */

.form-error-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background-color: rgb(248 113 113 / 0.08);
  border: 1px solid rgb(248 113 113 / 0.3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: #fca5a5;
  line-height: 1.5;
  margin-bottom: var(--space-6);
}

.form-error-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Success message ───────────────────────────────────────── */

.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-12) var(--space-8);
  background-color: var(--color-surface);
  border: 1px solid rgb(34 211 238 / 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 0 48px rgb(34 211 238 / 0.06);
}

.form-success h2 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  letter-spacing: -0.02em;
}

.form-success p {
  font-size: var(--text-base);
  color: var(--color-muted);
  max-width: 40ch;
  text-align: center;
}
