/* ── Form container ───────────────────────────────────────────────────── */
.formham-form {
    /* Theme tokens — override per-form; text/font inherit from the host so
       the form blends in. Add data-formham-theme="dark" for a dark variant. */
    --fh-accent: #2563eb;
    --fh-accent-ring: rgba(37,99,235,.15);
    --fh-border: #d1d5db;
    --fh-input-bg: #ffffff;
    --fh-radius: 5px;
    --fh-required: #dc2626;
    --fh-success-bg: #e7f6ec; --fh-success-fg: #14532d; --fh-success-border: #b7e0c4;
    --fh-error-bg: #fdeaea;   --fh-error-fg: #8a1c1c;   --fh-error-border: #f3c2c2;

    display: flex;
    flex-wrap: wrap;
    column-gap: 10px;
    row-gap: 15px;
    width: 100%;
    box-sizing: border-box;
    color: inherit;
    font-family: inherit;
}
.formham-form[data-formham-theme="dark"] {
    --fh-border: #3f3f46;
    --fh-input-bg: #18181b;
    --fh-required: #f87171;
    --fh-success-bg: #14321f; --fh-success-fg: #b7e0c4; --fh-success-border: #1f5132;
    --fh-error-bg: #3a1717;   --fh-error-fg: #f3c2c2;   --fh-error-border: #5b2121;
    color: #e5e7eb;
}

/* ── Field groups ─────────────────────────────────────────────────────── */
.formham-field-group {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-grow: 1;
    min-width: 0;
}

/* ── Labels ───────────────────────────────────────────────────────────── */
.formham-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: inherit;
    line-height: 1.4;
}

/* ── Inputs, textareas, selects ───────────────────────────────────────── */
.formham-input {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--fh-border);
    border-radius: var(--fh-radius);
    background: var(--fh-input-bg);
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.5;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: auto;
}
.formham-input:focus {
    border-color: var(--fh-accent);
    box-shadow: 0 0 0 3px var(--fh-accent-ring);
}
/* Validation feedback — only after interaction (:user-invalid), plus a
   JS-toggled class for older browsers. */
.formham-input:user-invalid,
.formham-input.formham-invalid {
    border-color: var(--fh-required);
    box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}
textarea.formham-input {
    resize: vertical;
    height: 120px;
    min-height: 60px;
}
select.formham-input { cursor: pointer; }

/* ── Radio buttons ────────────────────────────────────────────────────── */
.formham-radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}
.formham-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

/* ── Checkbox / terms ─────────────────────────────────────────────────── */
.formham-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.5;
    margin-top: 4px;
}
.formham-checkbox {
    margin-top: 3px;
    flex-shrink: 0;
}

/* ── Required star ────────────────────────────────────────────────────── */
.formham-required { color: var(--fh-required); }

/* ── Submit group ─────────────────────────────────────────────────────── */
.formham-submit-group { flex-basis: 100%; width: 100%; }

.formham-submit {
    display: inline-block;
    max-width: 100%;
    margin: 0;
    background: var(--fh-accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--fh-radius);
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    line-height: 1.5;
}
.formham-submit:hover { opacity: .88; }
.formham-submit:disabled { opacity: .55; cursor: not-allowed; }

/* ── Inline success / error messages (replaces window.alert) ──────────── */
.formham-message {
    padding: 12px 14px;
    border-radius: 5px;
    margin: 12px 0;
    font-size: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}
.formham-message-success { color: var(--fh-success-fg); background: var(--fh-success-bg); border: 1px solid var(--fh-success-border); }
.formham-message-error   { color: var(--fh-error-fg);   background: var(--fh-error-bg);   border: 1px solid var(--fh-error-border); }

/* ── Responsive: stack every field full-width on narrow screens. The inline
      flex-basis set by the renderer needs !important to override. ──────── */
@media (max-width: 480px) {
    .formham-field-group { flex-basis: 100% !important; }
}

/* ── reCAPTCHA ────────────────────────────────────────────────────────── */
.formham-form .g-recaptcha { flex-basis: 100%; }
.grecaptcha-badge { visibility: visible !important; opacity: 1 !important; z-index: 2147483647 !important; }

/* ── Suppress Elementor Pro's own error banner ────────────────────────── */
.elementor-message.elementor-message-danger { display: none !important; }