/**
 * Blue Ridge Core Theme — Forms & Inputs
 * See docs/design-system/12-forms.md and 13-inputs.md for full rationale.
 */

/* --- GHL embed placeholder wrapper (see patterns/estimate-form.php) --- */
.ghl-embed-placeholder {
  border: 2px dashed var(--wp--custom--color--gray-300);
  border-radius: var(--wp--custom--radius--lg);
  padding: var(--wp--preset--spacing--xl);
}

.ghl-embed-placeholder__notice {
  margin-bottom: var(--wp--preset--spacing--lg);
  padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--md);
  background-color: var(--wp--custom--color--heating-orange-tint);
  color: var(--wp--preset--color--heating-orange-text);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: var(--wp--custom--typography--font-weight-medium);
  border-radius: var(--wp--custom--radius--sm);
}

/* --- Live GoHighLevel form embed wrapper --- */
/* Card-style frame around the real embedded GHL iframe (see
   patterns/estimate-form.php and patterns/contact-content.php). The iframe
   itself declares a fallback height to avoid layout shift before GHL's
   form_embed.js script measures the real content and resizes it. */
.ghl-form-embed {
  background-color: var(--wp--preset--color--white);
  border-radius: var(--wp--custom--radius--lg);
  box-shadow: var(--wp--preset--shadow--sm);
  padding: var(--wp--preset--spacing--md);
}

.ghl-form-embed iframe {
  display: block;
  width: 100%;
  border: none;
}

.estimate-form .form-fieldset {
  margin-block-end: var(--wp--preset--spacing--lg);
}

.estimate-form .form-fieldset .form-choice {
  display: inline-flex;
  margin-right: var(--wp--preset--spacing--md);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--tiny);
  margin-block-end: var(--wp--preset--spacing--lg);
}

.form-fieldset {
  border: none;
  padding: 0;
  margin-block-end: var(--wp--preset--spacing--xxl);
}

.form-fieldset + .form-fieldset {
  border-top: 1px solid var(--wp--preset--color--gray-200);
  padding-top: var(--wp--preset--spacing--xxl);
}

.form-label {
  font-size: var(--wp--preset--font-size--sm);
  font-weight: var(--wp--custom--typography--font-weight-medium);
  color: var(--wp--preset--color--gray-900);
}

.form-helper {
  font-size: var(--wp--preset--font-size--sm);
  color: var(--wp--preset--color--gray-500);
}

.form-error {
  display: flex;
  align-items: center;
  gap: var(--wp--preset--spacing--tiny);
  font-size: var(--wp--preset--font-size--sm);
  color: var(--wp--preset--color--error);
}

/* --- Inputs --- */

.input,
.textarea,
.select {
  height: 48px;
  padding-inline: var(--wp--preset--spacing--sm);
  font-family: var(--wp--preset--font-family--system-sans);
  font-size: var(--wp--preset--font-size--base); /* 18px — prevents iOS auto-zoom on focus */
  color: var(--wp--preset--color--gray-900);
  background-color: var(--wp--preset--color--white);
  border: 1.5px solid var(--wp--custom--color--gray-300);
  border-radius: var(--wp--custom--radius--sm);
  transition:
    border-color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-out),
    box-shadow var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-out);
}

.textarea {
  height: auto;
  min-height: 8rem;
  padding-block: var(--wp--preset--spacing--sm);
  resize: vertical;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--wp--custom--color--gray-400);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--wp--preset--color--cooling-blue-text);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--wp--preset--color--error);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background-color: var(--wp--custom--color--gray-50);
  color: var(--wp--custom--color--gray-400);
  cursor: not-allowed;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--wp--custom--color--gray-400);
}

/* --- Checkbox / radio --- */
/* Native <input type="checkbox|radio"> — never a <div> substitute.
   Visible box is compact; clickable label area meets the 44px tap target. */

.form-choice {
  display: inline-flex;
  align-items: center;
  gap: var(--wp--preset--spacing--xs);
  min-height: 44px;
  padding-block: var(--wp--preset--spacing--tiny);
  cursor: pointer;
}

.form-choice input[type="checkbox"],
.form-choice input[type="radio"] {
  width: 24px;
  height: 24px;
  accent-color: var(--wp--preset--color--navy);
}
