/**
 * Site forms (App\Helpers\Forms, views/partials/xpt-form.twig), same look as
 * the old Gravity Forms styling: form on a light panel with a green top
 * edge, white fields with soft borders, green focus ring, site fonts.
 * Submit button: .btn in assets/styles/buttons.css.
 *
 * Plain CSS outside the Sass build; enqueued only on pages with a form.
 */

.xpt-form {
  max-width: 960px;
  margin: 40px auto clamp(56px, 7vw, 96px);
  padding: clamp(28px, 4vw, 48px);
  border-top: 4px solid #00ce7c;
  background: #f4f6f5;
  color: #16201d;
  scroll-margin-top: 120px;
}

.xpt-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
}

.xpt-form__field { grid-column: 1 / -1; min-width: 0; }
.xpt-form__field--half { grid-column: auto; }

.xpt-form__label {
  display: block;
  margin: 0 0 8px;
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-weight: normal;
  font-size: 17px;
  line-height: 1.3;
  color: #16201d;
}

.xpt-form__required {
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: #5f6b67;
}

.xpt-form :is(input[type="text"], input[type="email"], input[type="tel"], textarea) {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #cfd6d2;
  border-radius: 2px;
  background: #fff;
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  color: #16201d;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.xpt-form textarea { min-height: 180px; resize: vertical; }

.xpt-form input[type="file"] {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed #cfd6d2;
  border-radius: 2px;
  background: #fff;
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: #16201d;
  cursor: pointer;
}

.xpt-form input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 8px 14px;
  border: 2px solid #16201d;
  border-radius: 2px;
  background: transparent;
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #16201d;
  cursor: pointer;
}

.xpt-form :is(input, textarea):hover { border-color: #9aa6a1; }

.xpt-form :is(input, textarea):focus {
  border-color: #00a866;
  box-shadow: 0 0 0 3px rgba(0, 206, 124, 0.3);
  outline: none;
}

/* .xpt-form prefix on the p rules: theme.css sets `.has-background p { color: currentcolor }`, which
   otherwise wins and turns these texts black (2026-10-23). */
.xpt-form .xpt-form__description {
  margin: 8px 0 0;
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #5f6b67;
}

/* Errors: red border on the field and a bold red message under it. */
.xpt-form .xpt-form__field--error :is(input, textarea) {
  border-color: #b3261e;
  box-shadow: inset 0 0 0 1px #b3261e;
}

.xpt-form .xpt-form__error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: #b3261e;
}

.xpt-form .xpt-form__error::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #b3261e;
  font-size: 12px;
  line-height: 1;
  color: #fff;
}

.xpt-form__error-summary {
  margin: 0 0 28px;
  padding: 14px 18px;
  border-left: 4px solid #b3261e;
  background: #fff;
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: #b3261e;
}

.xpt-form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}

/* Cloudflare Turnstile (App\Helpers\Turnstile): own row above the button. */
.xpt-form .xpt-turnstile { flex: 0 0 100%; max-width: 400px; }

.xpt-form .xpt-form__success p {
  margin: 0;
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.4;
  color: #16201d;
}

.xpt-form__success:focus { outline: none; }

/* Honeypot: off screen for people, still filled in by many bots. */
.xpt-form__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .xpt-form { margin-top: 24px; padding: 24px 18px; }
  .xpt-form__fields { grid-template-columns: 1fr; }
  .xpt-form__field--half { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .xpt-form :is(input, textarea) { transition: none; }
}
