/* ===== Contact Form Modal Styles ===== */
:root {
    --primary-background-color-form: rgb(247, 247, 247);
}

.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    font-family: "TT-Norms-Pro-Regular", "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

.contact-modal.show {
    display: flex;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Disable clicking on overlay */
}

.contact-modal.show .contact-overlay {
    opacity: 1;
}

.contact-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 10000;
    background: rgb(144, 137, 135);
    padding: 0;
    border-radius: 8px;
    max-width: 850px;
    width: 90%;
    max-height: 90vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.contact-modal.show .contact-box {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.contact-close {
    display: none !important; /* Hide close button - form can only be closed after submission */
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.5rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
    z-index: 100;
}

.contact-close:hover {
    color: #ccc;
}

/* Contact Form Container */
.contact-form-container {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    flex: 1;
    overflow: hidden;
    padding: 2.5rem 2rem;
}

.contact-form-container-heading {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    background: rgb(144, 137, 135);
    z-index: 50;
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

.form-heading-text {
    font-size: 24px;
    line-height: 30px;
    font-weight: 500;
    color: #fff;
    margin: 0;
    font-family: "TT-Norms-Pro-Medium", sans-serif;
}

.form-subtitle-text {
    font-size: 12px;
    line-height: 18px;
    color: #fff;
    margin: 0;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
}

.form-heading-note {
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    margin: 0.35rem 0 0 0;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
}

.required-asterisk {
    color: #d32f2f;
    font-weight: bold;
    margin-left: 4px;
}

.form-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.form-contact {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
}

.contact-form-content {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5rem;
}

/* Form Groups */
.form-group {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

.form-group.relative {
    position: relative;
}

/* Form Input Styles */
.form-input {
    width: 100%;
    height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--primary-background-color-form);
    border: 0.5px solid transparent;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    font-size: 16px;
    color: #000;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

.form-input::placeholder {
    color: #818181;
    font-size: 16px;
}

.form-input.error {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 1px #d32f2f !important;
}

/* Form Textarea Styles */
.form-textarea {
    width: 100%;
    height: 150px;
    min-height: 150px;
    padding: 0.75rem 1rem 2.5rem 1rem;
    border-radius: 8px;
    background: var(--primary-background-color-form);
    border: 0.5px solid transparent;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    font-size: 16px;
    color: #000;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    resize: vertical;
    position: relative;
}

.form-textarea:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

.form-textarea::placeholder {
    color: #818181;
    font-size: 16px;
}

.form-textarea.error {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 1px #d32f2f !important;
}

/* Floating Input Styles */
.floating-input {
    width: 100%;
    height: 80px;
    padding: 1.5rem 1rem 0.75rem 1rem;
    border-radius: 8px;
    background: var(--primary-background-color-form);
    border: 0.5px solid transparent;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    font-size: 16px;
    color: #000;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.floating-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

.floating-input::placeholder {
    color: transparent;
}

.floating-input.error {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 1px #d32f2f !important;
}

.floating-textarea {
    width: 100%;
    height: 150px;
    min-height: 150px;
    padding: 1.5rem 1rem 2.5rem 1rem;
    border-radius: 8px;
    background: var(--primary-background-color-form);
    border: 0.5px solid transparent;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    font-size: 16px;
    color: #000;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    resize: vertical;
}

.floating-textarea:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

.floating-textarea::placeholder {
    color: transparent;
}

.floating-textarea.error {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 1px #d32f2f !important;
}

/* Floating Labels */
.floating-label {
    position: absolute;
    left: 1rem;
    top: 0.5rem;
    font-size: 16px;
    color: #818181;
    transition: all 0.2s ease;
    pointer-events: none;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
}

.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label,
.floating-textarea:focus ~ .floating-label,
.floating-textarea:not(:placeholder-shown) ~ .floating-label {
    top: -0.5rem;
    font-size: 12px;
    color: #818181;
}

/* Model Dropdown */
.model-dropdown-group {
    background: var(--primary-background-color-form);
    border-radius: 8px;
    overflow: hidden;
}

.form-group-dropdown {
    width: 100%;
    height: 44px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #000;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    background: var(--primary-background-color-form);
    border-radius: 8px;
}

.form-group-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 1px #000;
}

.placeholder {
    font-size: 16px;
    color: #000;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
}

.dropdown-arrow-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.dropdown-arrow-icon.rotated {
    transform: rotate(180deg);
}

.dropdown-container {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    background: var(--primary-background-color-form);
    border-radius: 8px;
}

.dropdown-container.open {
    max-height: 500px;
}

/* Show only the dropdown group that matches the active boat model.
   `data-model` on <html> is set by the bootstrap in index.html. */
.container-boat-label--p43,
.container-boat-label--gs60 { display: none !important; }
html[data-model="p43"]  .container-boat-label--p43,
html[data-model="gt65"] .container-boat-label--p43,
html[data-model="gs60"] .container-boat-label--gs60 { display: flex !important; }

.container-boat-label {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem;
    gap: 0.5rem;
}

.badge-product,
.v2-badge-product,
.mb-badge-product {
    min-width: 51px;
    font-size: 14px;
    line-height: 20px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    background: transparent;
    color: #000;
}

.badge-product:hover,
.v2-badge-product:hover,
.mb-badge-product:hover {
    background: rgba(0, 0, 0, 0.1);
}

.badge-product.chips-label-active,
.v2-badge-product.chips-label-active,
.mb-badge-product.chips-label-active {
    background: #000;
    color: #fff;
    border-color: transparent;
    font-family: "TT-Norms-Pro-Medium", sans-serif;
    font-weight: 500;
}

.badge-product.chips-label-active:hover,
.v2-badge-product.chips-label-active:hover,
.mb-badge-product.chips-label-active:hover {
    background: #333;
}

/* Character Counter */
.char-counter {
    position: absolute;
    right: 20px;
    bottom: 30px;
    font-size: 12px;
    line-height: 18px;
    color: #818181;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    pointer-events: none;
}

.form-group:has(.form-textarea) {
    position: relative;
}

/* Checkboxes Container */
.checkboxes-container {
    width: 100%;
    height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5rem;
    background: var(--primary-background-color-form);
    border-radius: 8px;
    flex-direction: column;
    padding: 1.5rem;
}

.checkboxes-inner {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.75rem;
}

.checkbox-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-input-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-checkbox {
    width: 16px;
    height: 16px;
    appearance: none;
    border: 1px solid #000;
    border-radius: 2px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 0.2rem;
    position: relative;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background: #000;
    border-color: #000;
}

.custom-checkbox:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.custom-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Profiling consent is disabled until marketing consent (primary) is
   checked — see syncProfilingConsentAvailability() in contact-form.js /
   contact-form-v2.js. */
.custom-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.custom-checkbox:disabled + .checkbox-label-text {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label-text {
    font-size: 12px;
    line-height: 18px;
    color: #000;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    cursor: pointer;
    flex: 1;
}

.privacy-link-inline {
    font-size: 12px;
    line-height: 18px;
    text-decoration: underline;
    color: #000;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    cursor: pointer;
}

.privacy-link-inline:hover {
    color: #333;
}

.privacy-link-container {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.privacy-link-main {
    font-size: 16px;
    line-height: 20px;
    text-decoration: underline;
    color: #000;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
}

.privacy-link-main:hover {
    color: #333;
}

/* Submit Button */
.submit-button-container {
    width: 100%;
    height: auto;
    display: flex;
}

.btn-submit {
    height: 48px;
    padding: 0.75rem 2rem;
    background: lightgray;
    opacity: 0.7;
    color: #000;
    font-size: 16px;
    line-height: 20px;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.75rem;
    pointer-events: none;
    width: 100%;
}

.btn-submit:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
    background: rgb(66 60 59);
    color: #fff;
}

.btn-submit:hover:not(:disabled) {
    opacity: 0.7;
}

.btn-submit:disabled {
    cursor: not-allowed;
}

/* Error Messages */
.error-message {
    display: block;
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
}

.form-status {
    text-align: center;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: #fff;
    min-height: 1.2rem;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
}

.form-status.success {
    color: #4caf50;
}

.form-status.error {
    color: #f44336;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .contact-box {
        width: 95%;
        max-height: 95vh;
    }

    .contact-form-container {
        padding: 2rem 1.5rem;
    }

    /* v2's compact modal (email/code steps) keeps its language flags floating
       at a fixed top offset (.v2-modal-topbar) — the heading's sticky,
       opaque background otherwise starts too close underneath them at this
       breakpoint's smaller padding, so the text runs up against the flags.
       Scoped to .v2-narrow only so v1's full contact form (also using
       .contact-form-container) keeps its normal padding. */
    .contact-box.v2-narrow .contact-form-container {
        padding-top: 2.5rem;
    }

    .form-heading-text {
        font-size: 20px;
        line-height: 26px;
    }

    .checkboxes-container {
        padding: 1rem;
    }

    .contact-form-container-heading {
        gap: 1.5rem;
        padding-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-box {
        width: 98%;
    }

    .contact-form-container {
        padding: 1.5rem 1rem;
    }

    .contact-box.v2-narrow .contact-form-container {
        padding-top: 2.5rem;
    }

    .form-heading-text {
        font-size: 18px;
        line-height: 24px;
    }
}

/* ========== Contact modal v2 — email OTP steps ========== */
.v2-step {
    display: none;
    width: 100%; /* .form-container is a flex column with align-items:
                    flex-start, so without this a block child shrinks to fit
                    its own content instead of stretching to the modal's
                    width — that's what was pinning everything to the left. */
}

.v2-step.v2-step-active {
    display: block;
}

.v2-step-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.v2-link-btn {
    background: none;
    border: none;
    padding: 0;
    /* Clickable/enabled — near-black for strong contrast against the grey
       modal background, signals "you can click this now". */
    color: #111;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: "TT-Norms-Pro-Regular", sans-serif;
    text-decoration: underline;
    cursor: pointer;
}

.v2-link-btn:disabled {
    /* Mid-grey (#aaa) on the grey modal background was low-contrast/hard to
       read — near-white instead, while still looking visually "disabled"
       via the removed underline + default cursor. */
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    text-decoration: none;
    cursor: default;
}

/* Compact modal for the code step — the full-size .contact-box
   (max-width: 850px, shared with v1's #contact-modal) is sized for the long
   multi-field lead form; the code step only has one input, so shrink +
   center it. The .v2-narrow class only ever gets added to v2/mb modals,
   never to v1's #contact-modal, so gating on the class alone (rather than
   an #contact-modal-v2 ID prefix) is enough to keep v1 unaffected — and
   lets #models-brand-modal reuse the same compact sizing. Toggled via JS
   (contact-form-v2.js showStep()) for the v2 modal — on for the code step,
   off for the lead form step, which needs the normal wide size. */
.contact-box.v2-narrow {
    max-width: 520px;
}

.contact-box.v2-narrow .contact-form-container-heading {
    align-items: center;
    text-align: center;
}

#v2-step-code {
    text-align: center;
    padding-right: 0.5rem; /* clear the top-right language flags */
}

#v2-step-code .form-group {
    align-items: center;
}

#v2-step-code .form-input {
    width: 100%;
    height: 48px;
    font-size: 18px;
    text-align: center;
}

#v2-step-code .submit-button-container {
    justify-content: center;
}

#v2-step-code .btn-submit {
    height: 46px;
    font-size: 16px;
}

.v2-step-subtitle {
    font-size: 15px;
    line-height: 22px;
}

/* Language switch — top-right of the v2 modal box */
/* Top-right bar of the v2 modal: close button, then a gap, then the
   language flags — replaces the separate absolute-positioned .contact-close
   (hidden everywhere else, per the comment above: "form can only be closed
   after submission") and .v2-lang-switch positioning. */
.v2-modal-topbar {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    /* Must beat .contact-form-container-heading's z-index:50 (sticky, opaque
       grey background) — that heading's initial offset equals
       .contact-form-container's padding-top, which shrinks at the 768px/
       480px breakpoints until it overlaps this bar's vertical range,
       painting over (hiding) the bottom of the flags. */
    z-index: 60;
    /* Keeps the flags from ever needing more width than the box has, on top
       of the .contact-box overflow:hidden clip — belt and suspenders against
       them getting cut off on narrow mobile screens. */
    max-width: calc(100% - 2rem);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .v2-modal-topbar {
        top: 0.6rem;
        right: 0.6rem;
        gap: 0.6rem;
    }

    .v2-lang-btn svg {
        width: 18px;
        height: 14px;
    }
}

/* ID prefixes bump specificity above the bare .contact-close rule above
   (which hides it everywhere else, i.e. v1's #contact-modal), regardless of
   source order. */
#contact-modal-v2 .v2-close,
#models-brand-modal .v2-close {
    display: flex !important;
    position: static;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#contact-modal-v2 .v2-close:hover,
#models-brand-modal .v2-close:hover {
    opacity: 1;
}

.v2-lang-switch {
    display: flex;
    gap: 0.4rem;
}

.v2-lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1.5px solid transparent;
    border-radius: 4px;
    padding: 0.25rem;
    line-height: 0;
    opacity: 0.55;
    cursor: pointer;
    transition: all 0.2s ease;
}

.v2-lang-btn:hover {
    opacity: 0.8;
}

.v2-lang-btn.v2-lang-active {
    opacity: 1;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
}
