/* Contact Form v3 — WCAG 2.2 AA styles
   Prefix: cf — all selectors scoped to .cf to avoid conflicts.
   To match a site, change the variables below. */

.cf {
  /* Avid Hawk theme — every text color is 7:1 or higher (WCAG AAA) */
  --cf-text:        #1a2733;
  --cf-muted:       #3d5166;
  --cf-bg:          #ffffff;
  --cf-panel:       #f4f7fa;   /* background behind the security check */
  --cf-border:      #6b8aa3;   /* input borders (3.6:1 on white) */
  --cf-border-soft: #c4d4e0;   /* container / box borders */
  --cf-accent:      #215375;   /* button: white text 8.2:1 */
  --cf-accent-dark: #153a54;
  --cf-focus:       #215375;
  --cf-error:       #991b1b;   /* 8.3:1 on white */
  --cf-success:     #14532d;
  --cf-radius:      6px;
  --cf-scroll-offset: 24px;    /* the site header is not sticky */

  max-width: 46rem;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.5;
  color: var(--cf-text);
  background-color: var(--cf-bg);
}

.cf *,
.cf *::before,
.cf *::after { box-sizing: border-box; }

.cf [hidden] { display: none !important; }

/* Focused fields scroll clear of sticky headers (WCAG 2.4.11 Focus Not Obscured) */
.cf input, .cf select, .cf textarea, .cf button, .cf a,
.cf__summary, .cf__status { scroll-margin-top: var(--cf-scroll-offset); scroll-margin-bottom: 24px; }

/* Container */
.cf__container {
  background: var(--cf-bg);
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--cf-border-soft);
}

/* Heading & description */
.cf__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #153a54;
}
.cf__description {
  margin: 0 0 20px;
  font-size: 1rem;
  color: var(--cf-muted);
}
.cf__required-note {
  font-size: 0.875rem;
  color: var(--cf-muted);
  margin: 0 0 24px;
}

/* Groups & labels */
.cf__group { margin-bottom: 22px; }

.cf__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--cf-text);
}
.cf__required {
  color: var(--cf-error);
  margin-left: 3px;
  font-weight: 700;
}
.cf__hint {
  display: block;
  margin: -2px 0 8px;
  font-size: 0.875rem;
  color: var(--cf-muted);
}

/* Inputs, textarea, select */
.cf__input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--cf-border);
  border-radius: var(--cf-radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--cf-text);
  background-color: var(--cf-bg);
  transition: border-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}
.cf__input:hover { border-color: var(--cf-accent); }
.cf__input:focus {
  outline: 3px solid var(--cf-focus);
  outline-offset: 2px;
  border-color: var(--cf-focus);
}
.cf__input::placeholder { color: #555555; opacity: 1; }

/* Date & time: keep the browser's own picker; sensible width */
.cf__input--date,
.cf__input--time {
  appearance: auto;
  -webkit-appearance: auto;
  max-width: 16rem;
  min-height: 2.9rem;
}

.cf__textarea {
  min-height: 140px;
  resize: vertical;
}

/* Native select arrow (no background image) */
.cf__select {
  appearance: auto;
  -webkit-appearance: menulist;
  cursor: pointer;
}

/* Checkbox field — 24px box meets WCAG 2.5.8 Target Size; label is clickable too */
.cf__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9375rem;
}
.cf__check label { cursor: pointer; padding-top: 1px; }
.cf__check input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--cf-accent);
  flex-shrink: 0;
  cursor: pointer;
}
.cf__check input:focus {
  outline: 3px solid var(--cf-focus);
  outline-offset: 2px;
}

/* Character counter */
.cf__count {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--cf-muted);
  text-align: right;
}
.cf__count--near  { color: #7c2d12; }
.cf__count--limit { color: var(--cf-error); font-weight: 600; }

/* Inline errors */
.cf__error {
  display: none;
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--cf-error);
  font-weight: 600;
}
.cf__error--show { display: block; }

.cf__input--error { border-color: var(--cf-error); }
.cf__input--error:focus {
  outline-color: var(--cf-error);
  border-color: var(--cf-error);
}

/* ── Error summary (top of form) ── */
.cf__summary {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 3px solid var(--cf-error);
  border-radius: var(--cf-radius);
  background: #fef2f2;
}
.cf__summary:focus { outline: 3px solid var(--cf-focus); outline-offset: 3px; }
.cf__summary-title {
  margin: 0 0 8px;
  font-weight: 700;
  color: #7f1d1d;
}
.cf__summary-list { margin: 0; padding-left: 20px; }
.cf__summary-list li { margin: 4px 0; }
.cf__summary-list a {
  color: var(--cf-error);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cf__summary-list a:hover { text-decoration-thickness: 2px; }
.cf__summary-list a:focus { outline: 3px solid var(--cf-focus); outline-offset: 2px; }

/* ── Spam-check boxes (first letter + security check) ── */
fieldset.cf__check-box { margin-left: 0; margin-right: 0; min-width: 0; }
.cf__legend {
  float: left;          /* keeps the legend inside the box instead of on its border */
  width: 100%;
  padding: 0;
}
.cf__legend + * { clear: both; }
.cf__check-box {
  background: var(--cf-panel);
  border: 1px solid var(--cf-border-soft);
  border-radius: 10px;
  padding: 20px 22px;
}
.cf__input--letter {
  width: 3.5rem;
  text-align: center;
  font-size: 1.125rem;
  text-transform: uppercase;
  padding: 10px 0;
}
.cf__input--captcha { max-width: 18rem; }
.cf__honeypot { border: 0; margin: 0; padding: 0; }

.cf__captcha-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: 14px;
  border: 2px solid var(--cf-border-soft);
  border-radius: 8px;
  background: #ffffff;
}
.cf__prompt {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  color: var(--cf-text);
}
.cf__captcha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.cf__btn {
  min-height: 40px;     /* well above the 24px minimum (WCAG 2.5.8) */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--cf-bg);
  color: var(--cf-text);
  border: 2px solid var(--cf-border);
  border-radius: var(--cf-radius);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.cf__btn:hover { border-color: var(--cf-accent); background: #e8f1f8; }
.cf__btn:focus {
  outline: 3px solid var(--cf-focus);
  outline-offset: 2px;
}
.cf__passed {
  margin: 0 0 22px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #15803d;
  color: var(--cf-success);
  font-weight: 600;
}

/* Submit button */
.cf__submit {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background-color: var(--cf-accent);
  color: #ffffff;
  border: 2px solid var(--cf-accent);
  border-radius: 999px;
  min-height: 52px;
  font-size: 1.0625rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 10px;
}
.cf__submit:hover  { background-color: var(--cf-accent-dark); }
.cf__submit:focus  { outline: 3px solid var(--cf-focus); outline-offset: 3px; }
.cf__submit:active { background-color: #10304a; }
/* While sending: aria-disabled (not disabled) so keyboard focus stays on the button */
.cf__submit[aria-disabled="true"] {
  background-color: #3d5166;
  border-color: #3d5166;
  cursor: progress;
}

/* Status banner */
.cf__status {
  display: none;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--cf-radius);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid var(--cf-border);
}
.cf__status--show { display: block; }
.cf__status:focus { outline: 3px solid var(--cf-focus); outline-offset: 3px; }
.cf__status--success { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.cf__status--error   { background: #fef2f2; border-color: var(--cf-error); color: #7f1d1d; }
.cf__status--blocked { background: #fffbeb; border-color: #d97706; color: #78350f; }

/* Honeypot — off-screen, not display:none, so bots still see it */
.cf__honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}


@media (max-width: 600px) {
  .cf__container { padding: 20px 16px; }
  .cf__title     { font-size: 1.25rem; }
  .cf__check-box { padding: 16px; }
}

/* Windows High Contrast / forced colors: keep borders and states visible */
@media (forced-colors: active) {
  .cf__input--error,
  .cf__summary { border-style: double; border-width: 4px; }
  .cf__submit, .cf__btn { border: 2px solid ButtonText; }
  .cf__submit[aria-disabled="true"] { color: GrayText; }
}

@media (prefers-reduced-motion: reduce) {
  .cf__input,
  .cf__submit { transition: none; }
}

/* Checkbox groups (fieldset + legend) */
.cf__fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.cf__options { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.cf__options .cf__check { align-items: center; min-height: 44px; margin: 0; }
.cf__options label { padding-top: 0; }

/* Visible status line for "Sending…" and similar announcements */
.cf__live { margin: 12px 0 0; min-height: 1.5em; font-size: 0.9375rem; color: var(--cf-muted); text-align: center; }

/* Form sections (fieldset + legend) */
.cf__section { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.cf__section-legend {
  float: left;
  width: 100%;
  margin: 0 0 16px;
  padding: 0 0 8px;
  border-bottom: 3px solid #3e92cc;
  font-size: 1.125rem;
  font-weight: 700;
  color: #153a54;
}
.cf__section-legend + * { clear: both; }

/* Security-check choices: radio buttons in a grid */
.cf__pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.cf__options--grid { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 2px 12px; }
.cf__check input[type="radio"] { width: 24px; height: 24px; margin: 0; accent-color: var(--cf-accent); flex-shrink: 0; cursor: pointer; }
.cf__pick.cf__input--error { border-left: 4px solid var(--cf-error); padding-left: 12px; }

/* "Please enable JavaScript" message: hidden once JavaScript runs */
.js .cf .no-js-only { display: none; }
