/* Make Umbraco Forms output match the design's .contact-form aesthetic.
   Scoped to .cta__form so we don't restyle Forms in unrelated contexts. */

/* Outer form wrapper — frosted glass card */
.cta__form .umbraco-forms-form {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius, 16px);
    padding: 40px 40px 32px;
    position: relative;
}

/* Strip Umbraco Forms' bootstrap-like wrappers */
.cta__form .umbraco-forms-form fieldset,
.cta__form .umbraco-forms-form .umbraco-forms-page {
    border: 0;
    padding: 0;
    margin: 0;
}
.cta__form .umbraco-forms-form legend {
    display: none;
}
.cta__form .umbraco-forms-form .row-fluid {
    margin: 0;
}

/* Two-column grid for fields. Any field containing a textarea, plus
   data consent / checkbox fields, span both columns. */
.cta__form .umbraco-forms-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    row-gap: 10px;
    width: 100%;
    float: none;
}
.cta__form .umbraco-forms-field {
    margin: 0;
    min-width: 0; /* let grid items shrink properly */
}
.cta__form .umbraco-forms-field.longanswer,
.cta__form .umbraco-forms-field.message,
.cta__form .umbraco-forms-field:has(textarea),
.cta__form .umbraco-forms-field.dataconsent,
.cta__form .umbraco-forms-field.checkbox,
.cta__form .umbraco-forms-field.singlecheckbox {
    grid-column: 1 / -1;
}

/* Labels */
.cta__form .umbraco-forms-form .umbraco-forms-label,
.cta__form .umbraco-forms-form .umbraco-forms-field > label {
    display: block;
    font-size: 1.0625rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Indicator (the asterisk for mandatory) — smaller and coral so it doesn't shout */
.cta__form .umbraco-forms-indicator {
    color: var(--coral, #f6ab93);
    margin-left: 4px;
    font-weight: 700;
}

/* The field-wrapper div around inputs/textareas — make sure it takes full width */
.cta__form .umbraco-forms-field-wrapper {
    width: 100%;
    display: block;
}

/* Inputs and textarea */
.cta__form .umbraco-forms-form input[type="text"],
.cta__form .umbraco-forms-form input[type="email"],
.cta__form .umbraco-forms-form input[type="tel"],
.cta__form .umbraco-forms-form input[type="url"],
.cta__form .umbraco-forms-form input[type="number"],
.cta__form .umbraco-forms-form textarea {
    /* width 100% + min-width 100% defeats Umbraco Forms' cols="20" attribute
       which would otherwise set a narrow intrinsic width on the textarea */
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    display: block;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-xs, 8px);
    color: #fff;
    font-size: 1.1875rem;
    font-family: inherit;
    transition: all var(--transition, 0.2s ease);
}
.cta__form .umbraco-forms-form textarea {
    resize: vertical;
    /* Override Umbraco Forms' default theme which sets height: 250px */
    height: auto;
    min-height: 120px;
}
.cta__form .umbraco-forms-form input::placeholder,
.cta__form .umbraco-forms-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}
.cta__form .umbraco-forms-form input:focus,
.cta__form .umbraco-forms-form textarea:focus {
    outline: none;
    border-color: var(--coral, #f6ab93);
    background: rgba(255, 255, 255, 0.16);
}

/* Outer "Consent" caption — keep the standard uppercase label styling */
.cta__form .umbraco-forms-field.dataconsent > label,
.cta__form .umbraco-forms-field.singlecheckbox > label,
.cta__form .umbraco-forms-field.checkbox > label {
    display: block;
    font-size: 1.0625rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Inner consent statement (the "Yes, I give consent..." next to the checkbox) */
.cta__form .umbraco-forms-field.dataconsent .umbraco-forms-field-wrapper label,
.cta__form .umbraco-forms-field.singlecheckbox .umbraco-forms-field-wrapper label,
.cta__form .umbraco-forms-field.checkbox .umbraco-forms-field-wrapper label {
    display: inline;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.9);
}
.cta__form .umbraco-forms-field.dataconsent input[type="checkbox"],
.cta__form .umbraco-forms-field.singlecheckbox input[type="checkbox"],
.cta__form .umbraco-forms-field.checkbox input[type="checkbox"] {
    width: auto;
    min-width: 0;
    margin-right: 8px;
    accent-color: var(--coral, #f6ab93);
    transform: scale(1.15);
    vertical-align: middle;
}

/* Submit button — coral pill, anchored to bottom-left of the card */
.cta__form .umbraco-forms-navigation {
    margin-top: 8px;
}
.cta__form .umbraco-forms-form button[type="submit"],
.cta__form .umbraco-forms-form input[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--coral, #f6ab93);
    color: var(--dark-blue, #003845);
    border: none;
    /* Match .btn.btn--sm size on the Read More pills */
    padding: 14px 28px;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 60px;
    cursor: pointer;
    transition: transform var(--transition, 0.2s ease), box-shadow var(--transition, 0.2s ease);
    position: absolute;
    bottom: -22px;
    left: 24px;
    box-shadow: 0 6px 24px rgba(246, 171, 147, 0.35);
}
.cta__form .umbraco-forms-form button[type="submit"]:hover,
.cta__form .umbraco-forms-form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(246, 171, 147, 0.45);
}

/* Trailing arrow on the submit button — mimics the design's <span class="btn__arrow">.
   Two paths because Umbraco Forms might render either form across versions:
   - <button> uses ::after (preferred, scales nicely)
   - <input type="submit"> uses background-image SVG (pseudo-elements not allowed on void elements) */
.cta__form .umbraco-forms-form button[type="submit"]::after {
    content: "\2192"; /* → */
    margin-left: 10px;
    display: inline-block;
    transition: transform var(--transition, 0.2s ease);
}
.cta__form .umbraco-forms-form button[type="submit"]:hover::after {
    transform: translateX(4px);
}
.cta__form .umbraco-forms-form input[type="submit"] {
    padding-right: 44px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M3 8h10m0 0L9 4m4 4L9 12' stroke='%23003845' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px 16px;
}
.cta__form .umbraco-forms-form input[type="submit"]:hover {
    background-position: right 12px center;
}

/* Validation summary / field validation messages */
.cta__form .field-validation-error,
.cta__form .umbraco-forms-form .validation-summary-errors {
    color: var(--coral, #f6ab93);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Stack to a single column on smaller screens */
@media (max-width: 720px) {
    .cta__form .umbraco-forms-container {
        grid-template-columns: 1fr;
    }
    .cta__form .umbraco-forms-form {
        padding: 28px 24px 56px;
    }
}

/* =====================================================================
   Salesforce Web-to-Lead form additions
   ---------------------------------------------------------------------
   The .sf-lead-form is rendered by _SalesforceLeadForm.cshtml. It uses
   the same .umbraco-forms-* classnames so all the rules above style it
   for free. The bits below are specific to the SF form:
     • reCAPTCHA widget — fixed 304×78 iframe, needs scaling on narrow
       viewports so it doesn't overflow the card.
     • Notice line — the "protected by reCAPTCHA" footnote required by
       Google's ToS. Small + muted.
   ===================================================================== */

/* reCAPTCHA widget is iframe-based at a fixed 304×78px size. On viewports
   < 380px wide (Galaxy S8 portrait, iPhone SE, etc.) the form card has
   less than 304px of inner width and the widget overflows the right edge.
   transform: scale shrinks the rendered widget while keeping the iframe
   at its required intrinsic size — Google's accepted workaround. */
.cta__form .sf-recaptcha-field {
    margin-top: 8px;
}
.cta__form .sf-recaptcha-field .g-recaptcha {
    /* transform-origin keeps the widget left-aligned with the form fields
       as it shrinks instead of pulling to the centre. */
    transform-origin: 0 0;
    /* Round the corners to match the 8px on the input fields. The widget
       is a Google iframe — we can't touch what's INSIDE it (the white
       background, the checkbox shape, the typography) — but the outer
       wrapper IS in our DOM, so border-radius + overflow:hidden clips
       the iframe's square corners to whatever curve we pick. At 8px the
       corners are mostly empty white space at the iframe's edge, so
       nothing readable gets shaved.
       inline-block sizes the wrapper to the iframe's intrinsic 304px
       instead of stretching to fill the form column — keeps the
       rounded clip tight against the widget. */
    display: inline-block;
    border-radius: var(--radius-xs, 8px);
    overflow: hidden;
    /* Subtle outer ring matches the frosted-glass input affordance.
       The widget draws its own 1px grey border INSIDE the iframe which
       we can't restyle, but a faint white ring around the OUTSIDE ties
       it visually to the surrounding fields. */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10);
}
@media (max-width: 380px) {
    .cta__form .sf-recaptcha-field .g-recaptcha {
        transform: scale(0.88);
        /* The scaled-down widget leaves a gap below — pull subsequent
           content up by the difference. */
        margin-bottom: -10px;
    }
}

/* "Protected by reCAPTCHA" notice — required by Google's ToS when you
   hide the reCAPTCHA branding (we don't, but the line is good UX). */
.cta__form .sf-recaptcha-notice {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
    margin: 18px 0 0;
}
.cta__form .sf-recaptcha-notice a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.25);
    transition: color var(--transition), text-decoration-color var(--transition);
}
.cta__form .sf-recaptcha-notice a:hover {
    color: var(--coral, #f6ab93);
    text-decoration-color: var(--coral, #f6ab93);
}
