/* ===== CONTACT MODAL (Final Updated) ===== */

/* Backdrop override */
body #contactModal {
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
}

/* Modal Content */
#contactModal .modal-content.form-glass {
    display: flex;
    width: 85vw;
    height: auto;
    max-width: 64rem;
    max-height: 85vh;
    background: #0D1428;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    transition: all 0.4s ease; /* Smooth transition for success state */
}

/* Left column: video */
.contact-modal-video-wrap {
    flex: 0 0 45%;
    position: relative;
    min-height: 520px;
    transition: all 0.4s ease;
}
.contact-modal-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.contact-modal-video-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, .35);
}

/* Right column: form */
.contact-modal-form-wrap {
    flex: 0 0 55%;
    padding: 2.5rem 3rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.4s ease;
}

/* Hide scrollbars but keep scrolling */
#contactModal .modal-content.form-glass,
#contactModal .contact-modal-form-wrap {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#contactModal .modal-content.form-glass::-webkit-scrollbar,
#contactModal .contact-modal-form-wrap::-webkit-scrollbar {
    display: none;
}

/* Header */
.form-header {
    margin-bottom: 2rem;
    text-align: center;
}
.form-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.07;
}
.form-header p {
    font-size: 0.97rem;
    font-weight: 400;
    line-height: 1.54;
    color: #b8e5f6;
    margin-top: .75rem;
}

/* Form Layout */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* CTA */
.form-cta {
    padding-top: .5rem;
}
.contact-submit-btn {
    width: 100%;
    background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
    color: #fff;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: .9rem;
    padding: 1rem 2rem;
    border-radius: 9999px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    transition: box-shadow .2s ease, filter .2s ease, transform .06s ease;
    box-shadow: 0 10px 28px rgba(37, 99, 235, .34),
                inset 0 -1px 0 rgba(255, 255, 255, .15);
}
.contact-submit-btn:hover {
    box-shadow: 0 14px 36px rgba(37, 99, 235, .42),
                inset 0 -1px 0 rgba(255, 255, 255, .18);
    filter: saturate(1.06);
}
.contact-submit-btn:active {
    transform: translateY(1px);
}

/* Button Loader */
.btn-loader {
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 999px;
    display: none;
    animation: spin .8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.btn-loader.active {
    display: inline-block;
}

/* Success Message */
.form-success-message {
    display: none;
    text-align: center;
    padding: 3rem 0;
}
.form-success-message h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.14rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.24;
}
.form-success-message p {
    color: #b8e5f6;
    font-size: 0.97rem;
    margin-top: .5rem;
}

/* Inputs */
.form-group {
    position: relative;
}
.form-input {
    width: 100%;
    border-radius: 12px;
    padding: .95rem 1rem;
    font-size: 0.97rem;
    color: #E8EEF9;
    background: rgba(10, 18, 36, .66);
    border: 1px solid rgba(96, 165, 250, .28);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.form-input::placeholder {
    color: transparent;
}
.form-input:focus {
    outline: none;
    border-color: #3B82F6;
    background: rgba(10, 18, 36, .78);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .22),
                inset 0 1px 0 rgba(255, 255, 255, .04);
}
.form-input[aria-invalid="true"] {
    border-color: #3B82F6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .22);
}

/* Labels */
.form-label {
    position: absolute;
    left: 1rem;
    top: .95rem;
    font-size: 0.97rem;
    color: #8A97AD;
    pointer-events: none;
    transform-origin: left top;
    transition: transform .18s, color .18s, background-color .18s, padding .18s;
}
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    transform: translateY(-1.65rem) scale(.82);
    color: #B9C4D6;
    background-color: #0D1428;
    padding: 0 .35rem;
    border-radius: 4px;
}

/* Tablet tweaks */
@media (max-width: 992px) {
    .contact-modal-video-wrap {
        flex-basis: 40%;
    }
    .contact-modal-form-wrap {
        flex-basis: 60%;
        padding: 2.5rem;
        justify-content: flex-start;
    }
}

/* ===== MOBILE FULL-SCREEN FIX ===== */
@media (max-width: 768px) {
    #contactModal .modal-content.form-glass {
        flex-direction: column;
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0;
        border: none;
        overflow: hidden;
    }
    .contact-modal-video-wrap {
        display: none;
    }
    .contact-modal-form-wrap {
        flex: 1;
        padding: 3rem 1.5rem 2rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .form-header {
        margin-bottom: 1.5rem;
    }
    .form-header p {
        font-size: 0.9rem;
        max-width: 100%;
    }
    .form-fields, .form-grid {
        gap: 0.75rem;
    }
    #contactModal .close-modal {
        position: absolute;
        top: 1rem;
        right: 1.5rem;
        z-index: 10;
    }
}

/* ===== BODY LOCK ===== */
body.no-scroll {
    overflow: hidden !important;
    height: 100%;
}

/* ✅ START: SUCCESS STATE STYLES */
#contactModal .modal-content.is-success .contact-modal-video-wrap {
    opacity: 0;
    flex-basis: 0;
    min-width: 0;
}
#contactModal .modal-content.is-success .contact-modal-form-wrap {
    flex-basis: 100%;
    align-items: center; /* Center the success message */
}
#contactModal .modal-content.is-success {
    width: 50vw; /* Make the success modal smaller on desktop */
    max-width: 480px;
}
/* ✅ FIX: Centered, smaller success window on tablet/mobile */
@media (max-width: 992px) {
    #contactModal .modal-content.is-success {
        width: 80vw;
        max-width: 400px;
        height: auto;
        max-height: 50vh;
    }
}
@media (max-width: 768px) {
    #contactModal .modal-content.is-success {
        width: 90vw !important;
        height: auto !important;
        max-height: 60vh !important;
    }
}
/* ✅ END: SUCCESS STATE STYLES */
