/* ================================================================
   Pioneer Hearing & Tinnitus - Contact Form 7 markup overlay
   ----------------------------------------------------------------
   Maps CF7's wrapper markup onto the theme's form vocabulary
   (.pht-form / .pht-fieldrow / .pht-consents / .pht-button) and
   drives the success-card swap. Load AFTER css/styles.css.
   ================================================================ */

/* CF7 wraps each control in a span; make it fill the grid label cell. */
.pht-form .wpcf7-form-control-wrap { display: block; width: 100%; }

/* Consent rows - reproduce the .pht-consents checkbox + inline text layout
   around CF7's [acceptance] span tree. Wrapper class is .pht-cf7-consent. */
.pht-consents .pht-cf7-consent .wpcf7-form-control-wrap,
.pht-consents .pht-cf7-consent .wpcf7-acceptance,
.pht-consents .pht-cf7-consent .wpcf7-list-item { display: block; margin: 0; width: 100%; }
.pht-consents .pht-cf7-consent .wpcf7-list-item label {
    display: block;
    margin: 0;
    font-size: .8rem;
    line-height: 1.5;
    cursor: pointer;
}
.pht-consents .pht-cf7-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 7px 0 0;
    vertical-align: top;
    accent-color: var(--gold);
}
.pht-consents .pht-cf7-consent .wpcf7-list-item-label a { text-decoration: underline; }

/* CF7 adds class "optional" to [acceptance ... optional] wrappers - neutralize. */
.pht-consents .pht-cf7-consent .wpcf7-acceptance.optional {
    display: block; margin: 0; padding: 0; background: none;
    color: inherit; font-size: inherit; letter-spacing: normal; text-transform: none;
}

/* Validation tips - match the theme's light error color on the dark form band. */
.pht-form .wpcf7-not-valid-tip {
    display: block;
    margin-top: 4px;
    color: #ffd4c8;
    font-size: .76rem;
    font-weight: 700;
}

/* CF7 response banner. */
.wpcf7-form .wpcf7-response-output {
    margin: 12px 0 0;
    padding: .6rem .9rem;
    border: 1px solid rgba(255, 255, 255, .3);
    font-size: .85rem;
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
    border-color: #ffd4c8;
    color: #ffd4c8;
    background: rgba(255, 212, 200, .08);
}
.wpcf7 form.sent .wpcf7-response-output { display: none; }
.wpcf7-form p { margin: 0; }

/* Success-card swap driven by the wpcf7mailsent handlers. */
#optin-fields.hidden,
#contact-fields.hidden { display: none; }
.pht-formsuccess { display: none; }
.pht-formsuccess.visible { display: block; }
.pht-formsuccess p { margin: 12px 0 0; font-weight: 700; }
