/* ==========================================================================
   The shared contact form — includes/contact_form.php
   Loaded by contact.php and index.php.

   Two variants from one rule set:
     .gx-cf            full width, two fields per row, labels visible
     .gx-cf--compact   narrow column (the home hero card), labels for screen
                       readers only, placeholders carry the visible naming

   Tokens come from css/tokens.css where they exist, with literal fallbacks so
   this file still renders correctly on a page that has not loaded tokens.
   ========================================================================== */

.gx-cf {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.gx-cf__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* The hero card is ~340px wide; two inputs side by side there leave about
   150px each, which is not enough for an email address. */
.gx-cf__row--stack {
  grid-template-columns: 1fr;
}

.gx-cf__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;                 /* lets a long value shrink instead of overflowing the grid */
}

.gx-cf__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gx-gray-700, #334155);
}

/* Visually hidden, still announced. clip-path over display:none because a
   display:none label is skipped by screen readers too. */
.gx-cf__label--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.gx-cf input,
.gx-cf select,
.gx-cf textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--gx-gray-200, #e2e8f0);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--gx-gray-900, #0f172a);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.gx-cf textarea {
  resize: vertical;
  min-height: 84px;
}

.gx-cf input:focus,
.gx-cf select:focus,
.gx-cf textarea:focus {
  outline: none;
  border-color: var(--gx-primary, #1a3c6e);
  box-shadow: 0 0 0 3px rgba(26, 60, 110, .12);
}

/* :invalid alone would paint every required field red before the visitor has
   typed anything. :user-invalid only applies after they have interacted. */
.gx-cf input:user-invalid,
.gx-cf select:user-invalid,
.gx-cf textarea:user-invalid {
  border-color: #dc2626;
}

.gx-cf__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gx-primary, #1a3c6e), #2c5aa0);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.gx-cf__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26, 60, 110, .28);
}

.gx-cf__submit:active {
  transform: none;
}

.gx-cf__note {
  margin: 0;
  font-size: 12px;
  color: var(--gx-gray-500, #64748b);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Compact (home hero) ──
   The hero card is 540px wide now (it was 340px), which leaves 492px inside its
   24px padding. Measured against https://iglobexinfotech.com/: gap 11px, fields
   40px tall with a 9px radius, and two 240px fields per row — 492px minus an
   11px gap is 240.5 each, so the same numbers fall out. */
.gx-cf--compact {
  gap: 11px;
}

/* Both rows go two-up now. At 308px only the short name fields fitted; at 492px
   an email address has room as well. */
.gx-cf--compact .gx-cf__row--stack {
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.gx-cf--compact input,
.gx-cf--compact select,
.gx-cf--compact textarea {
  padding: 8px 12px;
  font-size: 13.5px;
  border-radius: 9px;
}

.gx-cf--compact textarea {
  min-height: 76px;
}

.gx-cf--compact .gx-cf__submit {
  padding: 11px 18px;
  font-size: 14.5px;
}

.gx-cf--compact .gx-cf__note {
  font-size: 11px;
  line-height: 1.4;
  align-items: flex-start;
}

/* ── Narrow screens ──
   Two-per-row becomes one-per-row; below this the full variant has the same
   problem the hero card has at any width. */
/* The full variant (contact.php) stacks at 560px — its fields are wider and
   two of them stop fitting there. The compact variant holds its two-up rows
   much further down: at a 500px viewport the hero card is 460px wide, so each
   field is ~195px, which is what the reference site uses at that width. */
@media (max-width: 560px) {
  .gx-cf__row { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .gx-cf--compact .gx-cf__row--stack { grid-template-columns: 1fr; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .gx-cf input,
  .gx-cf select,
  .gx-cf textarea,
  .gx-cf__submit { transition: none; }
  .gx-cf__submit:hover { transform: none; }
}
