/* ═══════════════════════════════════════════════════════════════════════════
   S3 Gfx — Contact Popup Modal
   Design: Dark glass, split-panel (info + form)
═══════════════════════════════════════════════════════════════════════════ */

.contact-popup-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.contact-popup-modal.active {
    opacity: 1;
    visibility: visible;
}

.contact-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.contact-popup-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--cp-panel-bg, linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(15, 15, 26, 0.98)));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.1);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.35s ease;
}

.contact-popup-modal.active .contact-popup-panel {
    transform: scale(1) translateY(0);
}

.contact-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.contact-popup-close:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: transparent;
    color: #fff;
    transform: rotate(90deg);
}

.contact-popup-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 90vh;
    overflow: hidden;
}

/* ── Info Side ───────────────────────────────────────────────────────────── */
.contact-popup-info {
    position: relative;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.contact-popup-info-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(23, 14, 46, 0.85), rgba(0, 28, 33, 0.7));
}

.contact-popup-info-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/MAP.png') center/cover;
    opacity: 0.2;
}

.contact-popup-info-content {
    position: relative;
    z-index: 1;
}

.contact-popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.contact-popup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.contact-popup-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.contact-popup-contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-popup-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.contact-popup-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.contact-popup-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    margin: 0;
    line-height: 1.2;
}

.contact-popup-value {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0.15rem 0 0;
}

.contact-popup-social {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.contact-popup-social-link {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
}

.contact-popup-social-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ── Form Side ─────────────────────────────────────────────────────────── */
.contact-popup-form-side {
    padding: 2rem 2.25rem;
    overflow-y: auto;
    max-height: 90vh;
}

.contact-popup-form-header {
    margin-bottom: 1.5rem;
}

.contact-popup-form-header h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
}

.contact-popup-form-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 0;
}

.contact-popup-field {
    margin-bottom: 1rem;
}

.contact-popup-field label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contact-popup-field label i {
    color: #8b5cf6;
    font-size: 0.75rem;
}

.contact-popup-field .glass-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.contact-popup-field .glass-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.contact-popup-field .glass-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.contact-popup-field select.glass-input {
    cursor: pointer;
    appearance: none;
    
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

.contact-popup-field select.glass-input option {
    background: var(--cp-option-bg, #1a1a2e);
    color: var(--cp-option-text, #fff);
}

.contact-popup-field textarea.glass-input {
    resize: none;
    min-height: 100px;
}

/* Form Validation */
.form-error {
    color: #f87171;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

.form-error.hidden {
    display: none;
}

.glass-input.is-invalid {
    border-color: #ef4444 !important;
}

#popup-form-message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

#popup-form-message.hidden {
    display: none;
}

#popup-form-message.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

#popup-form-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.contact-popup-field:last-of-type {
    margin-bottom: 1.25rem;
}

/* ── Mobile Responsive ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .contact-popup-modal {
        padding: 0;
        align-items: flex-end;
    }

    .contact-popup-panel {
        /* Slide up from bottom like a sheet */
        max-height: 88vh;
        height: auto;
        border-radius: 1.25rem 1.25rem 0 0;
        width: 100%;
        max-width: 100%;
        transform: translateY(40px) scale(1) !important;
        display: flex;
        flex-direction: column;
    }

    .contact-popup-modal.active .contact-popup-panel {
        transform: translateY(0) scale(1) !important;
    }

    .contact-popup-content {
        grid-template-columns: 1fr;
        flex: 1;
        overflow: hidden;
        max-height: none;
    }

    /* Hide the image/info side completely on mobile */
    .contact-popup-info {
        display: none !important;
    }

    /* Form side takes full width, scrolls independently */
    .contact-popup-form-side {
        padding: 1.25rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Close button: larger tap target on mobile */
    .contact-popup-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        z-index: 100;
    }

    .contact-popup-form-header {
        margin-bottom: 1rem;
        padding-top: 0.25rem;
    }

    .contact-popup-form-header h3 {
        font-size: 1.15rem;
    }

    .contact-popup-field {
        margin-bottom: 0.85rem;
    }

    .contact-popup-field .glass-input {
        padding: 0.6rem 0.85rem;
        font-size: 1rem; /* Prevents iOS zoom on focus (must be >= 16px native) */
    }

    .contact-popup-field label {
        font-size: 0.82rem;
    }

    /* Push form content above keyboard when it opens */
    .contact-popup-panel:has(input:focus),
    .contact-popup-panel:has(textarea:focus) {
        max-height: 100vh;
    }
}

/* iPhone notch / safe area support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 767px) {
        .contact-popup-form-side {
            padding-bottom: calc(env(safe-area-inset-bottom) + 1.5rem);
        }
    }
}

