/* ==========================================================================
   ://WEBGOLD — Contact page Formidable form
   Scope: add the class `wg-contact-form` to the Elementor container/widget
   that holds the [formidable id=X] shortcode.
   ========================================================================== */

.wg-contact-form {
  --wgf-text: #191919;          /* Blackout */
  --wgf-muted: #3A3A3A;         /* Slate */
  --wgf-placeholder: #A89E8E;
  --wgf-line: rgba(25, 25, 25, 0.14);
  --wgf-line-focus: #191919;
  --wgf-pill-bg: #FFFFFF;
  --wgf-pill-hover: #FAF8F5;
  --wgf-accent: #FC4521;        /* Orange — required asterisk / focus only */
  --wgf-error: #DC2626;
  --wgf-font: 'DM Sans', sans-serif;
}

/* --- Reset Formidable chrome ------------------------------------------- */
.wg-contact-form .frm_forms.with_frm_style,
.wg-contact-form .frm_forms {
  max-width: 100%;
  font-family: var(--wgf-font);
  color: var(--wgf-text);
}

.wg-contact-form .frm_forms fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.wg-contact-form .frm_forms legend.frm_hidden,
.wg-contact-form .frm_forms .frm_screen_reader {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* --- Grid: two columns, generous row rhythm ---------------------------- */
.wg-contact-form .frm_forms .frm_fields_container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 2rem;
  row-gap: 2.5rem;
}

.wg-contact-form .frm_forms .frm_form_field {
  grid-column: span 12;
  margin: 0;
  padding: 0;
}

.wg-contact-form .frm_forms .frm_form_field.frm6,
.wg-contact-form .frm_forms .frm_form_field.frm_half {
  grid-column: span 6;
}

/* Intro line (HTML field with class wg-form-intro) */
.wg-contact-form .wg-form-intro,
.wg-contact-form .wg-form-intro p {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.45;
  max-width: 22rem;
  margin: 0;
  color: var(--wgf-text);
}

/* --- Labels ------------------------------------------------------------- */
.wg-contact-form .frm_forms .frm_primary_label {
  display: block;
  font-family: var(--wgf-font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--wgf-text);
  padding: 0;
  margin: 0 0 0.75rem;
}

.wg-contact-form .frm_forms .frm_required {
  color: var(--wgf-accent);
  font-size: 0.75em;
  vertical-align: super;
  margin-left: 0.1em;
}

.wg-contact-form .frm_forms .frm_description {
  font-size: 0.75rem;
  color: var(--wgf-muted);
  margin-top: 0.4rem;
  padding: 0;
}

/* --- Text inputs + textarea: underline style --------------------------- */
.wg-contact-form .frm_forms input[type="text"],
.wg-contact-form .frm_forms input[type="email"],
.wg-contact-form .frm_forms input[type="tel"],
.wg-contact-form .frm_forms input[type="url"],
.wg-contact-form .frm_forms input[type="number"],
.wg-contact-form .frm_forms select,
.wg-contact-form .frm_forms textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--wgf-line);
  border-radius: 0;
  box-shadow: none;
  padding: 0.5rem 0 0.875rem;
  font-family: var(--wgf-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--wgf-text);
  height: auto;
  transition: border-color 0.25s ease;
}

.wg-contact-form .frm_forms textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.wg-contact-form .frm_forms input::placeholder,
.wg-contact-form .frm_forms textarea::placeholder {
  color: var(--wgf-placeholder);
  opacity: 1;
  font-size: 0.8125rem;
}

.wg-contact-form .frm_forms input:focus,
.wg-contact-form .frm_forms select:focus,
.wg-contact-form .frm_forms textarea:focus {
  outline: none;
  box-shadow: none;
  background: transparent;
  border-bottom-color: var(--wgf-line-focus);
}

/* --- Radio groups as pill chips ---------------------------------------- */
.wg-contact-form .frm_forms .frm_opt_container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding-top: 0.5rem;
}

.wg-contact-form .frm_forms .frm_radio,
.wg-contact-form .frm_forms .frm_checkbox {
  display: block;
  margin: 0;
  padding: 0;
}

.wg-contact-form .frm_forms .frm_radio label,
.wg-contact-form .frm_forms .frm_checkbox label {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  background: var(--wgf-pill-bg);
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--wgf-font);
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--wgf-text);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.wg-contact-form .frm_forms .frm_radio label:hover,
.wg-contact-form .frm_forms .frm_checkbox label:hover {
  background: var(--wgf-pill-hover);
  border-color: rgba(25, 25, 25, 0.2);
}

/* Hide the native control but keep it focusable/accessible */
.wg-contact-form .frm_forms .frm_radio input[type="radio"],
.wg-contact-form .frm_forms .frm_checkbox input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* Selected */
.wg-contact-form .frm_forms .frm_radio label:has(input:checked),
.wg-contact-form .frm_forms .frm_checkbox label:has(input:checked) {
  background: var(--wgf-text);
  border-color: var(--wgf-text);
  color: #FFFFFF;
}

/* Keyboard focus */
.wg-contact-form .frm_forms .frm_radio label:has(input:focus-visible),
.wg-contact-form .frm_forms .frm_checkbox label:has(input:focus-visible) {
  outline: 2px solid var(--wgf-accent);
  outline-offset: 2px;
}

/* --- Submit: white pill with dark circular arrow ----------------------- */
.wg-contact-form .frm_forms .frm_submit {
  grid-column: span 12;
  margin: 0.5rem 0 0;
  padding: 0;
}

.wg-contact-form .frm_forms .frm_submit button,
.wg-contact-form .frm_forms .frm_submit input[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.3125rem 1.5rem 0.3125rem 0.3125rem;
  margin: 0;
  background: #FFFFFF;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  font-family: var(--wgf-font);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--wgf-text);
  height: auto;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.wg-contact-form .frm_forms .frm_submit button::before {
  content: "";
  flex: 0 0 auto;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: 50%;
  background: var(--wgf-text)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E")
    center / 1rem no-repeat;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.wg-contact-form .frm_forms .frm_submit button:hover,
.wg-contact-form .frm_forms .frm_submit button:focus-visible {
  background: var(--wgf-text);
  color: #FFFFFF;
}

.wg-contact-form .frm_forms .frm_submit button:hover::before,
.wg-contact-form .frm_forms .frm_submit button:focus-visible::before {
  background-color: var(--wgf-accent);
  transform: rotate(45deg);
}

.wg-contact-form .frm_forms .frm_submit button:focus-visible {
  outline: 2px solid var(--wgf-accent);
  outline-offset: 3px;
}

/* Formidable loading spinner — keep it tidy */
.wg-contact-form .frm_forms .frm_submit button.frm_loading_now::before {
  animation: wgf-spin 0.9s linear infinite;
}

@keyframes wgf-spin {
  to { transform: rotate(360deg); }
}

/* --- Validation + messages --------------------------------------------- */
.wg-contact-form .frm_forms .frm_blank_field input,
.wg-contact-form .frm_forms .frm_blank_field textarea,
.wg-contact-form .frm_forms .frm_blank_field select {
  border-bottom-color: var(--wgf-error);
}

.wg-contact-form .frm_forms .frm_blank_field .frm_primary_label {
  color: var(--wgf-text);
}

.wg-contact-form .frm_forms .frm_error {
  font-size: 0.75rem;
  color: var(--wgf-error);
  margin-top: 0.4rem;
  padding: 0;
}

.wg-contact-form .frm_error_style {
  background: #FFDFD9;
  border: 0;
  border-radius: 4px;
  color: #9A2410;
  font-size: 0.875rem;
  padding: 0.875rem 1rem;
  margin-bottom: 2rem;
}

.wg-contact-form .frm_message {
  background: #FFFFFF;
  border: 0;
  border-left: 3px solid var(--wgf-accent);
  border-radius: 4px;
  color: var(--wgf-text);
  font-size: 0.9375rem;
  line-height: 1.6;
  padding: 1.25rem 1.5rem;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 767px) {
  .wg-contact-form .frm_forms .frm_fields_container {
    row-gap: 2rem;
  }

  .wg-contact-form .frm_forms .frm_form_field.frm6,
  .wg-contact-form .frm_forms .frm_form_field.frm_half {
    grid-column: span 12;
  }
}
