/* =====================================================================
   Mazda UAE - form pages (Book a test drive, Contact us, Book a service), new design
   Loaded by Views/Partials/Facelift/_FormPage.cshtml after css/sales-campaign.css,
   whose form card (.scf-card) these pages use. This file only fits the form
   blocks' own markup into that card; every rule is scoped under .fpf.
   ===================================================================== */

/* The test drive form's own style sets ".page-container { min-height: 340vh }" on phones (a screen-high gap under the form). */
.page-container:has(.fpf) { min-height: 0 !important; }

/* Dropdowns (model, location, country code) may reach past the card's edge; the head keeps the rounded corners. */
.fpf .scf-card { overflow: visible; }
.fpf .scf-card__head { border-radius: 8px 8px 0 0; }
/* The page's picture shows a little more than on the register page (its heading is shorter there). */
.fpf .scf-card__head--page::before {
    background: linear-gradient(90deg, rgba(11, 11, 12, .9) 0%, rgba(11, 11, 12, .66) 50%, rgba(11, 11, 12, .2) 100%);
}
body.is-rtl .fpf .scf-card__head--page::before {
    background: linear-gradient(270deg, rgba(11, 11, 12, .9) 0%, rgba(11, 11, 12, .66) 50%, rgba(11, 11, 12, .2) 100%);
}

/* The block's own wrappers: no width, padding or background of their own. */
.fpf .forms,
.fpf .forms__inner-wrapper {
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    float: none !important;
    text-align: start !important;
}
.fpf .forms form#form { max-width: none !important; }

/* The intro line is in the card head; the block's copy of it is hidden. An error line after it still shows. */
.fpf .forms__header { margin: 0 0 22px !important; padding: 0 !important; }
.fpf .forms__header > .forms__sub-title:first-child { display: none !important; }
.fpf .forms__header:not(:has(> .forms__sub-title + .forms__sub-title)) { display: none !important; }
.fpf .forms__header > .forms__sub-title + .forms__sub-title {
    margin: 0 !important;
    font-family: var(--scf-font) !important;
    font-size: 14px !important;
    line-height: 1.5;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-align: start !important;
    color: var(--scf-accent-hi) !important;
}

/* Section headings run across both columns; sections are split by a neutral line. */
.fpf .scf-card .forms__group > .forms__section-header {
    grid-column: 1 / -1;
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--scf-font) !important;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1.3 !important;
    letter-spacing: .2em !important;
    text-transform: uppercase;
    text-align: start !important;
    color: var(--scf-ink) !important;
}
body.is-rtl .fpf .scf-card .forms__group > .forms__section-header { font-size: 15px !important; letter-spacing: 0 !important; }
.fpf .scf-card .forms__group + .forms__group,
.fpf .scf-card .forms__group .forms__group {
    margin-top: 10px !important;
    padding-top: 28px !important;
    border-top: 1px solid var(--scf-line);
}
.fpf .scf-card .forms__group + .forms__group { margin-top: 28px !important; }
/* The book a service form keeps its later sections, reCAPTCHA and button inside the first section. */
.fpf .scf-card .forms__group > .forms__group,
.fpf .scf-card .forms__group > .g-recaptcha,
.fpf .scf-card .forms__group > .btnSubmit,
.fpf .scf-card .forms__group > #errormsg { grid-column: 1 / -1; }
.fpf .scf-card .forms__group > .forms__group { margin-top: 8px !important; }
.fpf .scf-card .forms__group > .g-recaptcha { margin-top: 8px !important; }
.fpf .scf-card .forms__group > .btnSubmit { margin-top: 0 !important; }

/* A row that only holds hidden fields, and a section heading left empty in the CMS, take no place. */
.fpf .scf-card .forms__group > .input-row:not(:has(label, select, textarea, input:not([type="hidden"]))) { display: none !important; }
.fpf .scf-card .forms__group > .forms__section-header:empty { display: none !important; }

/* The forms keep spare submit buttons hidden with an inline style (the card's button rule would show them). */
.fpf .scf-card .btnSubmit[style*="display:none"],
.fpf .scf-card .btnSubmit[style*="display: none"] { display: none !important; }

/* Select boxes: the site turns them into Choices.js boxes, restyled here to match the card's fields. */
.fpf .scf-card .input-row .choices { margin: 0 !important; }
.fpf .scf-card .input-row .choices__inner {
    display: flex;
    align-items: center;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 1px solid #dcdcd8;
    border-radius: 4px;
    background-color: var(--scf-field);
    transition: border-color .25s, background-color .25s, box-shadow .25s;
}
.fpf .scf-card .input-row .choices:hover .choices__inner { border-color: #b9b9b4; }
.fpf .scf-card .input-row .choices.is-focused .choices__inner,
.fpf .scf-card .input-row .choices.is-open .choices__inner {
    border: 1px solid var(--scf-ink);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(11, 11, 12, .07);
}
.fpf .scf-card .input-row .choices.is-open .choices__inner { border-radius: 4px 4px 0 0; }
.fpf .scf-card .input-row .choices.is-disabled .choices__inner { border-color: #e2e2de; background-color: #ececea; cursor: not-allowed; }
.fpf .scf-card .input-row .choices__list--single { padding: 0 44px 0 14px; line-height: 50px; }
.fpf .scf-card .input-row .choices[dir="rtl"] .choices__list--single { padding: 0 14px 0 44px; }
.fpf .scf-card .input-row .choices__list .choices__item {
    font-family: var(--scf-font) !important;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: #111;
}
.fpf .scf-card .input-row .choices__list--single .choices__item { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fpf .scf-card .input-row .choices__list .choices__item[data-value=""] { color: #7d7d78; }
.fpf .scf-card .input-row .choices.is-disabled .choices__list .choices__item { color: #8a8a86; }
.fpf .scf-card .input-row .choices__list--dropdown {
    z-index: 5;
    border: 1px solid var(--scf-ink);
    border-top-color: var(--scf-line);
    border-radius: 0 0 4px 4px;
    background: #fff;
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .4);
    white-space: normal;
}
.fpf .scf-card .input-row .choices__list--dropdown .choices__item { padding: 12px 14px; font-size: 14.5px; line-height: 1.35; color: #3a3a3a; }
.fpf .scf-card .input-row .choices__list--dropdown .choices__item.is-highlighted { background-color: var(--scf-field); color: #111; }
.fpf .scf-card .input-row .choices__list--dropdown .choices__item[data-value=""] { color: #7d7d78; }
.fpf .scf-card .input-row .choices__list--dropdown .choices__item--selectable::after { content: none; display: none; }
.fpf .scf-card .input-row .choices[data-type*="select-one"]::after {
    content: "";
    width: 12px;
    height: 8px;
    margin-top: -4px;
    border: 0;
    inset-inline-start: auto;
    right: 16px;
    left: auto;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230b0b0c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 8px;
    font-size: 0;
}
.fpf .scf-card .input-row .choices[data-type*="select-one"][dir="rtl"]::after { right: auto; left: 16px; }
/* Arabic: some boxes are built without dir="rtl" (model, body); all of them follow the page direction. */
.fpf .scf-card__body[dir="rtl"] .input-row .choices__list { direction: rtl; text-align: right; }
.fpf .scf-card__body[dir="rtl"] .input-row .choices__list--single { padding: 0 14px 0 44px; }
.fpf .scf-card__body[dir="rtl"] .input-row .choices[data-type*="select-one"]::after { right: auto; left: 16px; }
.fpf .scf-card .input-row .choices[data-type*="select-one"].is-open::after { transform: rotate(180deg); margin-top: -4px; }
.fpf .scf-card .input-row .choices.is-disabled::after { opacity: .4; }

/* The page's own copy in the card head (the hero's text and links). */
.fpf .scf-card__head .fpf-copy p { margin: 0 !important; color: inherit !important; font-size: inherit !important; line-height: inherit !important; text-align: start !important; }
.fpf .scf-card__head .fpf-copy p + p { margin-top: 8px !important; }
.fpf .scf-card__head .scf-card__lead a { color: #fff !important; text-decoration: underline; text-underline-offset: 3px; }
.fpf .scf-card__head .scf-card__lead + .scf-card__lead { margin-top: 8px !important; }

/* Inputs the card's rules do not cover: the field wrapper and the date field. */
.fpf .scf-card .input-row__field-wrapper { width: auto !important; margin: 0 !important; padding: 0 !important; float: none !important; }
.fpf .scf-card .input-row .form-field:not([type="checkbox"]):not(select):not(textarea) { line-height: normal; }
.fpf .scf-card .input-row .form-field:disabled { background-color: #ececea !important; color: #8a8a86 !important; cursor: not-allowed; }

/* Consent rows: the box and its text side by side. */
.fpf .scf-card .input-row--checkbox { margin-top: 2px !important; }
.fpf .scf-card .input-row--checkbox .privacynotice { margin: 0 !important; }

/* Field error lines from the site's validation. */
.fpf .scf-card .pristine-error,
.fpf .scf-card .input-row__required {
    margin-top: 6px !important;
    font-family: var(--scf-font) !important;
    font-size: 12.5px !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: var(--scf-accent-hi) !important;
}

/* The thank-you or error message after sending, when shown on the page itself. */
.fpf .thankyou { margin: 0 !important; padding: 0 !important; background: none !important; }
.fpf .thankyou__inner-wrapper { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
.fpf .thankyou__title,
.fpf .thankyou__sub-title { text-align: start !important; }

/* ---------- phone ---------- */
@media (max-width: 599px) {
    .fpf .scf-card .forms__group + .forms__group { margin-top: 24px !important; padding-top: 24px !important; }
    .fpf .scf-card .forms__group .forms__group { padding-top: 24px !important; }
}
