/* Klaviyo preference centre form (klaviyo-follow-up-page)
   Klaviyo injects its own triple-class styles, so overrides need !important. */

.klaviyo-form-XhXhwK {
    --kl-pref-black: #000;
    --kl-pref-radio: 18px;
    --kl-pref-indent: 30px; /* hanging indent for the question number */
    text-align: left;
    font-family: 'Montserrat', sans-serif;
}

.klaviyo-form-XhXhwK form.klaviyo-form {
    padding: 40px 0 !important;
}

/* Questions first, email + submit last */
.klaviyo-form-XhXhwK form.klaviyo-form > div > [data-testid="form-row"]:first-child:has(.klaviyo-emailinput) {
    order: 99;
}

.klaviyo-form-XhXhwK [data-testid="form-component"] {
    padding: 0 !important;
}

/* Question blocks */
.klaviyo-form-XhXhwK :is(.klaviyo-checkboxes, .klaviyo-radiobuttons, .klaviyo-dropdown) {
    margin-bottom: 80px;
}

.klaviyo-form-XhXhwK fieldset {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Question headings: fieldset legends, plus the dropdown's label ("6. Annual spend") */
.klaviyo-form-XhXhwK legend,
.klaviyo-form-XhXhwK .klaviyo-dropdown label {
    display: block;
    width: 100%;
    margin: 0 0 24px !important;
    padding: 0 0 0 var(--kl-pref-indent) !important;
    text-indent: calc(-1 * var(--kl-pref-indent));
    font-family: 'Montserrat', sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-transform: uppercase;
    color: var(--kl-pref-black) !important;
}

/* "Select all that apply:" hint, split out of the legend in assets/js/klaviyo-preference-form.js */
.klaviyo-form-XhXhwK legend .ec-kl-hint {
    display: block;
    margin: 6px 0 0 calc(-1 * var(--kl-pref-indent));
    text-indent: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
}

/* Options: two balanced columns, single column for the radio question */
.klaviyo-form-XhXhwK [role="group"] {
    columns: 2;
    column-gap: 24px;
    max-width: 720px;
}

.klaviyo-form-XhXhwK [role="radiogroup"] {
    columns: 1;
}

.klaviyo-form-XhXhwK :is([role="group"], [role="radiogroup"]) label {
    position: relative;
    padding: 0 0 12px calc(var(--kl-pref-radio) + 12px) !important;
    break-inside: avoid;
}

/* Hide Klaviyo's square checkbox SVGs. Repeated class outweighs Klaviyo's
   `.klaviyo-form x3 input:checked + label > * { display: inline-block !important }` */
.klaviyo-form-XhXhwK.klaviyo-form.klaviyo-form.klaviyo-form.klaviyo-form :is([role="group"], [role="radiogroup"]) label > svg {
    display: none !important;
}

.klaviyo-form-XhXhwK :is([role="group"], [role="radiogroup"]) label > div {
    top: 0 !important;
    margin: 0 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    line-height: var(--kl-pref-radio) !important;
    color: var(--kl-pref-black) !important;
}

/* Round marker for checkboxes and radios alike, filled when selected */
.klaviyo-form-XhXhwK :is([role="group"], [role="radiogroup"]) label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--kl-pref-radio);
    height: var(--kl-pref-radio);
    box-sizing: border-box;
    border: 1px solid var(--kl-pref-black);
    border-radius: 50%;
    background: #fff;
    transition: background-color .15s ease;
}

.klaviyo-form-XhXhwK :is([role="group"], [role="radiogroup"]) label:hover::before {
    background: #e6e6e6;
}

.klaviyo-form-XhXhwK :is([role="group"], [role="radiogroup"]) input:checked + label::before {
    background: var(--kl-pref-black);
}

.klaviyo-form-XhXhwK :is([role="group"], [role="radiogroup"]) input:focus-visible + label::before {
    outline: 2px solid var(--kl-pref-black);
    outline-offset: 2px;
}

/* Contact row: email, postcode, DOB, telephone + submit */
.klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput) {
    /* End in line with the footer newsletter's JOIN NOW button: that block is
       1000px wide and centred, so its right edge sits 500px past the centre */
    max-width: min(100%, calc(50% + 500px));
    flex-wrap: wrap;
    gap: 12px;
}

/* "7. Your details" heading. Added here rather than as a Klaviyo text block because
   this row is first in Klaviyo and only moved to the bottom by `order` above.
   :has() keeps it off the success step, whose first row has no email field. */
.klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput)::before {
    content: '7. Your details';
    flex: 0 0 100%;
    margin-bottom: 12px; /* + the row's 12px gap = the 24px under question headings */
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    color: var(--kl-pref-black);
}

.klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput) > [data-testid="form-component"] {
    flex: 1 1 160px !important;
    min-width: 0;
}

/* Extra room for the country flag so "Telephone number" isn't cut off */
.klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput) > [data-testid="form-component"]:has(.klaviyo-phoneinput) {
    flex-grow: 1.4 !important;
}

.klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput) > [data-testid="form-component"]:last-child {
    flex: 0 0 auto !important;
    margin: 0 !important;
}

/* Shared field box. The phone and dropdown inputs sit inside a bordered
   wrapper (with the flag / arrow button), so the wrapper gets the box. */
.klaviyo-form-XhXhwK :is(.klaviyo-emailinput, .klaviyo-textinput, .klaviyo-dateinput) input,
.klaviyo-form-XhXhwK .klaviyo-phoneinput > div:first-child,
.klaviyo-form-XhXhwK .klaviyo-dropdown div:has(> input[role="combobox"]) {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 50px !important;
    border: 1px solid var(--kl-pref-black) !important;
    border-radius: 0 !important;
    background: #fff !important;
}

.klaviyo-form-XhXhwK :is(.klaviyo-emailinput, .klaviyo-textinput, .klaviyo-dateinput) input,
.klaviyo-form-XhXhwK :is(.klaviyo-phoneinput, .klaviyo-dropdown) input {
    padding: 0 16px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    color: var(--kl-pref-black) !important;
}

.klaviyo-form-XhXhwK :is(.klaviyo-phoneinput, .klaviyo-dropdown) input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100% !important;
    border: 0 !important;
    background: transparent !important;
}

.klaviyo-form-XhXhwK input::placeholder {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    color: #767676 !important;
}

/* Flag and arrow buttons: undo the black 100px button from footer.css's
   `.klaviyo-form div.needsclick button.needsclick` rule (repeated class to outweigh it) */
.klaviyo-form-XhXhwK.klaviyo-form.klaviyo-form :is(.klaviyo-phoneinput, .klaviyo-dropdown) div button {
    flex: 0 0 auto;
    width: auto !important;
    height: 100% !important;
    padding: 0 4px 0 14px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--kl-pref-black) !important;
}

.klaviyo-form-XhXhwK.klaviyo-form.klaviyo-form .klaviyo-dropdown div button {
    padding: 0 16px !important;
}

/* Annual spend dropdown */
.klaviyo-form-XhXhwK .klaviyo-dropdown > div {
    width: 100%;
    max-width: 360px;
}

.klaviyo-form-XhXhwK .klaviyo-dropdown [role="listbox"] {
    border: 1px solid var(--kl-pref-black) !important;
    border-top: 0 !important;
    border-radius: 0 !important;
    max-height: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
}

.klaviyo-form-XhXhwK .klaviyo-dropdown [role="listbox"]:empty {
    display: none;
}

.klaviyo-form-XhXhwK .klaviyo-dropdown [role="option"] {
    padding: 12px 16px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    color: var(--kl-pref-black) !important;
}

/* Repeated class outweighs footer.css's black 100px / height:100% Klaviyo button rule */
.klaviyo-form-XhXhwK.klaviyo-form.klaviyo-form div .klaviyo-form-button {
    width: auto !important;
    height: 50px !important;
    padding: 0 32px !important;
    border-radius: 0 !important;
    background: var(--kl-pref-black) !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
}

.klaviyo-form-XhXhwK .klaviyo-form-button:hover {
    opacity: .85;
}

/* Thank-you (success) step: two Klaviyo rich-text rows (h1 + p) whose Arial
   font, sizes and centring are inline styles, hence the !importants */
.klaviyo-form-XhXhwK form.klaviyo-form:not(:has(.klaviyo-emailinput)) {
    padding: 120px 0 !important;
}

.klaviyo-form-XhXhwK .klaviyo-form-richtext :is(h1, p, span) {
    font-family: 'Montserrat', sans-serif !important;
    color: var(--kl-pref-black) !important;
    text-align: center !important;
}

.klaviyo-form-XhXhwK .klaviyo-form-richtext :is(h1, h1 span) {
    margin: 0 0 16px !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-transform: uppercase;
}

.klaviyo-form-XhXhwK .klaviyo-form-richtext :is(p, p span) {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

@media screen and (max-width: 767px) {
    .klaviyo-form-XhXhwK {
        --kl-pref-indent: 22px;
    }

    .klaviyo-form-XhXhwK form.klaviyo-form {
        padding: 24px 0 !important;
    }

    .klaviyo-form-XhXhwK :is(.klaviyo-checkboxes, .klaviyo-radiobuttons, .klaviyo-dropdown) {
        margin-bottom: 48px;
    }

    .klaviyo-form-XhXhwK legend,
    .klaviyo-form-XhXhwK .klaviyo-dropdown label {
        margin-bottom: 20px !important;
        font-size: 18px !important;
    }

    .klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput)::before {
        flex: 0 0 auto;
        margin-bottom: 8px;
        font-size: 18px;
    }

    .klaviyo-form-XhXhwK legend .ec-kl-hint {
        margin-top: 12px;
    }

    .klaviyo-form-XhXhwK [role="group"] {
        columns: 1;
    }

    .klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput) {
        flex-direction: column !important;
    }

    /* Stacked: stop the 160px flex-basis turning into field height */
    .klaviyo-form-XhXhwK [data-testid="form-row"]:first-child:has(.klaviyo-emailinput) > [data-testid="form-component"] {
        flex: 0 0 auto !important;
    }

    .klaviyo-form-XhXhwK .klaviyo-dropdown > div {
        max-width: none;
    }

    .klaviyo-form-XhXhwK.klaviyo-form.klaviyo-form div .klaviyo-form-button {
        width: 100% !important;
    }

    .klaviyo-form-XhXhwK form.klaviyo-form:not(:has(.klaviyo-emailinput)) {
        padding: 64px 0 !important;
    }

    .klaviyo-form-XhXhwK .klaviyo-form-richtext :is(h1, h1 span) {
        font-size: 24px !important;
    }
}
