/* DNSai Contact form + modal */

.contact-page {
  max-width: 720px;
  margin: 0 auto;
  /* The public nav is position:fixed and overlays the top of the page, so the
     title has to clear it. It previously started 24px from the top and sat
     underneath the logo. */
  padding: calc(var(--nav-h) + 40px) 20px 64px;
}
.contact-page .page-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.contact-page .page-subtitle {
  color: var(--text-secondary, #9fb3c8);
  margin: 0 0 28px;
  font-size: 1rem;
}

.contact-card {
  background: var(--bg-card, #1a1a1a);
  border: 1px solid var(--border-default, #2a2a2a);
  border-radius: 14px;
  padding: 28px;
}

/* Fields */
.contact-field { margin-bottom: 18px; }
.contact-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 7px;
}
.contact-field .req { color: var(--brand-cyan, #26c4ff); }
.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input, #111);
  border: 1px solid var(--border-default, #2a2a2a);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text-primary, #fff);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-field textarea { resize: vertical; min-height: 120px; }
.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--brand-cyan, #26c4ff);
  box-shadow: 0 0 0 3px rgba(38, 196, 255, 0.15);
}

/* Submit button — brand gradient */
.contact-submit {
  width: 100%;
  border: none;
  border-radius: 9px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #26c4ff 0%, #0054ff 100%);
  transition: opacity 0.15s ease;
}
.contact-submit:hover { opacity: 0.92; }
.contact-submit:disabled { opacity: 0.6; cursor: default; }

/* Status message */
.contact-status { margin: 14px 0 0; font-size: 0.9rem; min-height: 1.2em; }
.contact-status--ok { color: var(--color-success, #00c853); }
.contact-status--error { color: var(--color-error, #ff5252); }
.contact-recaptcha-note { margin: 10px 0 0; font-size: 0.75rem; color: var(--text-secondary, #888); }

/* Honeypot — visually hidden, kept in the a11y tree off-screen */
.contact-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---- Two-column form on wider screens ----
   Pairs Name/Work email and Company/I'm interested in so the form reads as one
   screenful instead of a long single column. Scoped to .contact-card so the
   520px-wide pricing modal keeps its single-column layout. */
@media (min-width: 640px) {
  .contact-card .contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
  }
  /* Message textarea (5th div) and everything that isn't a field — honeypot,
     hidden input, submit, status, reCAPTCHA note — run the full width. */
  .contact-card .contact-form > .contact-field:nth-of-type(5),
  .contact-card .contact-form > *:not(.contact-field) {
    grid-column: 1 / -1;
  }
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .contact-page {
    padding: calc(var(--nav-h) + 24px) 16px 48px;
  }
  .contact-page .page-subtitle {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }
  .contact-card {
    padding: 20px 16px;
    border-radius: 12px;
  }
  .contact-field { margin-bottom: 15px; }
  /* 16px keeps iOS Safari from zooming the viewport on focus. */
  .contact-field input,
  .contact-field select,
  .contact-field textarea,
  .contact-submit {
    font-size: 16px;
  }
  .contact-field input,
  .contact-field select,
  .contact-field textarea {
    padding: 12px;
  }
  .contact-field textarea { min-height: 104px; }
  .contact-submit { padding: 14px 20px; }
}

/* ---- Modal (pricing page) ---- */
.contact-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  padding: 20px;
  overflow-y: auto;
}
.contact-modal.open { display: flex; align-items: flex-start; justify-content: center; }
.contact-modal-dialog {
  background: var(--bg-card, #1a1a1a);
  border: 1px solid var(--border-default, #2a2a2a);
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 520px;
  margin: 6vh auto;
  position: relative;
}
.contact-modal-title { font-size: 1.3rem; font-weight: 700; color: var(--text-primary, #fff); margin: 0 0 4px; }
.contact-modal-sub { color: var(--text-secondary, #9fb3c8); font-size: 0.9rem; margin: 0 0 20px; }
.contact-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--text-secondary, #999);
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
}
.contact-modal-close:hover { color: var(--text-primary, #fff); }

/* Hide the floating reCAPTCHA v3 badge — compliant because the form shows the
   required "protected by reCAPTCHA" attribution text (Google Privacy/Terms links).
   Use visibility (not display:none) so the invisible challenge still executes. */
.grecaptcha-badge { visibility: hidden; }
