/**
 * Ford Dynamic Test Drive Modal Styling
 * Desktop: Wide Landscape Banner with Car on the right (Lampiran 1)
 * Mobile: Vertical Portrait Card with Car on top (Lampiran 2)
 */

.ftd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ftd-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.ftd-modal-dialog {
    position: relative;
    width: 90vw;
    max-width: 90vw;
    min-height: 650px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background-color: #030a1c;
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    box-sizing: border-box;
    padding: 0;
}

.ftd-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #0b1a30;
    border: none;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.ftd-modal-close:hover {
    transform: scale(1.08);
    background-color: #f1f5f9;
}

.ftd-modal-scroll {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.ftd-modal-scroll::-webkit-scrollbar {
    width: 6px;
}
.ftd-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.ftd-modal-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}
.ftd-modal-scroll::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.ftd-modal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 650px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 45px 70px;
    box-sizing: border-box;
    background: transparent;
    z-index: 10;
}

.ftd-content-wrap {
    max-width: 460px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ftd-title-main {
    font-family: 'FordF1TC', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.12;
    color: #ffffff;
    margin: 0 0 20px 0;
    letter-spacing: -0.5px;
    text-transform: none;
    width: 100%;
    text-align: left;
}

.ftd-title-sub {
    display: block;
    text-align: left;
}

.ftd-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
    align-items: center;
}

.ftd-form-field {
    position: relative;
    width: 100%;
}

.ftd-input,
.ftd-select {
    width: 100%;
    height: 40px;
    padding: 8px 14px;
    font-family: 'FordF1TC', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: #0b1a30;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.ftd-input::placeholder {
    color: #0b1a30;
    opacity: 1;
    font-weight: 500;
}

.ftd-input:focus,
.ftd-select:focus {
    border-color: #006bf5;
    box-shadow: 0 0 0 2px rgba(0, 107, 245, 0.2);
}

.ftd-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%230b1a30' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.ftd-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 32px;
    font-family: 'FordF1TC', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    background-color: #006bf5;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 4px 15px rgba(0, 107, 245, 0.35);
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: fit-content;
    align-self: center;
}

.ftd-btn-submit:hover {
    background-color: #0056cc;
    transform: translateY(-1px);
}

.ftd-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ftd-msg-box {
    display: none;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    line-height: 1.35;
}

.ftd-msg-box.success {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid #22c55e;
}

.ftd-msg-box.error {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #ef4444;
}

.ftd-mobile-header-img {
    display: none;
}

/* Mobile View (<= 768px): Centered Layout matching Lampiran 1 */
@media (max-width: 768px) {
    .ftd-modal-dialog {
        width: 95vw;
        max-width: 420px;
        height: auto;
        max-height: 92vh;
        border-radius: 12px;
        background-image: none !important;
        background-color: #00142e;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }

    .ftd-modal-close {
        top: 12px !important;
        right: 12px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        z-index: 100 !important;
        position: absolute !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    }

    .ftd-modal-scroll {
        width: 100%;
        overflow-y: auto;
        flex: 1 1 auto;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        -webkit-overflow-scrolling: touch;
    }

    .ftd-mobile-header-img {
        display: block;
        width: 100%;
        height: 200px;
        object-fit: cover;
        object-position: center;
        flex-shrink: 0;
    }

    .ftd-modal-inner {
        padding: 24px 20px 30px;
        background: linear-gradient(180deg, rgba(0, 20, 46, 0.85) 0%, #00142e 20%, #00142e 100%);
        text-align: center;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .ftd-content-wrap {
        max-width: 320px;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .ftd-title-main {
        width: 100%;
        font-size: 1.65rem;
        margin-bottom: 18px;
        text-align: left;
    }

    .ftd-title-sub {
        display: block;
        text-align: left;
    }

    .ftd-form-wrap {
        max-width: 290px;
        width: 100%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .ftd-form-field {
        width: 100%;
    }

    .ftd-input,
    .ftd-select {
        width: 100%;
        height: 44px;
        font-size: 16px !important;
        border-radius: 6px;
    }

    .ftd-select option {
        font-size: 16px;
        color: #0b1a30;
        background-color: #ffffff;
        padding: 8px 10px;
    }

    .ftd-btn-submit {
        width: fit-content;
        height: 42px;
        padding: 0 32px;
        margin: 12px auto 0 auto;
        border-radius: 50px;
        align-self: center;
    }

    .ftd-modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .grecaptcha-badge {
        bottom: 75px !important;
    }
}

/* Google reCAPTCHA v3 invisible badge styling */
.rc-anchor-invisible,
.grecaptcha-badge {
    visibility: hidden !important;
    z-index: -10 !important;
}
