/* =========================================
   CONTACT MODAL — Premium Design
   ========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Container */
.modal-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(165deg, #0f1729 0%, #0b111e 50%, #101b2e 100%);
    border: 1px solid rgba(0, 209, 209, 0.15);
    border-radius: 24px;
    padding: clamp(28px, 5vw, 44px);
    box-shadow:
        0 32px 100px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(0, 209, 209, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transform: translateY(40px) scale(0.92);
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

/* Glow accent at top */
.modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 209, 209, 0.5), transparent);
}

/* Subtle corner glow */
.modal-container::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at top right, rgba(0, 209, 209, 0.08), transparent 70%);
    border-radius: 0 24px 0 0;
    pointer-events: none;
}

/* Scrollbar */
.modal-container::-webkit-scrollbar { width: 3px; }
.modal-container::-webkit-scrollbar-track { background: transparent; }
.modal-container::-webkit-scrollbar-thumb { background: rgba(0, 209, 209, 0.2); border-radius: 10px; }

/* Close Button */
.modal-close {
    position: absolute;
    top: 18px;
    left: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.modal-close:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: rgba(255, 77, 77, 0.25);
    color: #ff6b6b;
    transform: rotate(90deg) scale(1.05);
}

/* Header */
.modal-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.modal-header .section-tag {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(0, 209, 209, 0.08);
    border: 1px solid rgba(0, 209, 209, 0.2);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-blue, #00d1d1);
    letter-spacing: 0.5px;
}

.modal-title {
    font-family: 'Tajawal', sans-serif;
    font-size: clamp(1.35rem, 3.5vw, 1.8rem);
    font-weight: 800;
    color: #fff;
    margin-top: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.modal-subtitle {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

/* ═══ Form Styles ═══ */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    position: relative;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.92rem;
    transition: all 0.35s ease;
    outline: none;
    box-sizing: border-box;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.22);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(0, 209, 209, 0.5);
    background: rgba(0, 209, 209, 0.03);
    box-shadow: 0 0 0 4px rgba(0, 209, 209, 0.06), 0 0 20px rgba(0, 209, 209, 0.04);
}

/* Filled state glow */
.form-group input:not(:placeholder-shown),
.form-group textarea:not(:placeholder-shown) {
    border-color: rgba(0, 209, 209, 0.2);
}

/* Select */
.form-group select {
    cursor: pointer;
    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='%2300d1d1' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 38px;
}

.form-group select option {
    background: #0b111e;
    color: #fff;
    padding: 10px;
}

.form-group textarea {
    resize: vertical;
    min-height: 85px;
    line-height: 1.6;
}

.form-other-input.hidden {
    display: none;
}

.form-other-input {
    margin-top: 8px;
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ Service Type Radio Cards ═══ */
.service-type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 6px;
}

.service-option {
    cursor: pointer;
}

.service-option input[type="radio"] {
    display: none;
}

.service-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    text-align: center;
    transition: all 0.35s ease;
    color: rgba(255, 255, 255, 0.45);
    position: relative;
    overflow: hidden;
}

.service-option-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 209, 209, 0.06), transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.service-option-card span {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.service-option-card svg {
    position: relative;
    z-index: 1;
    transition: all 0.35s ease;
}

.service-option-card:hover {
    border-color: rgba(0, 209, 209, 0.2);
    color: rgba(255, 255, 255, 0.65);
}

.service-option input[type="radio"]:checked + .service-option-card {
    border-color: rgba(0, 209, 209, 0.45);
    background: rgba(0, 209, 209, 0.06);
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 209, 209, 0.08), inset 0 0 30px rgba(0, 209, 209, 0.03);
}

.service-option input[type="radio"]:checked + .service-option-card::before {
    opacity: 1;
}

.service-option input[type="radio"]:checked + .service-option-card svg {
    color: var(--accent-blue, #00d1d1);
    filter: drop-shadow(0 0 8px rgba(0, 209, 209, 0.4));
}

/* ═══ Submit Button ═══ */
.modal-submit-btn {
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    background: linear-gradient(135deg, #00d1d1, #00b4b4);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 30px rgba(0, 209, 209, 0.2);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.modal-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
}

.modal-submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 209, 209, 0.35);
}

.modal-submit-btn:not(:disabled):hover::before {
    left: 100%;
}

.modal-submit-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.modal-submit-btn:disabled {
    background: linear-gradient(135deg, rgba(0, 209, 209, 0.3), rgba(0, 180, 180, 0.3));
    box-shadow: none;
}

/* ═══ Success State ═══ */
.modal-success {
    display: none;
    text-align: center;
    padding: 50px 20px 30px;
}

.modal-success.show {
    display: block;
    animation: modalSuccessIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(0, 209, 209, 0.15), rgba(0, 209, 209, 0.05));
    border: 2px solid rgba(0, 209, 209, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue, #00d1d1);
    position: relative;
    animation: successPulse 2s ease-in-out infinite;
}

.modal-success-icon::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(0, 209, 209, 0.1);
    animation: successRing 2s ease-in-out infinite;
}

.modal-success h4 {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.modal-success p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    line-height: 1.6;
}

@keyframes modalSuccessIn {
    from { opacity: 0; transform: scale(0.85) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 209, 209, 0.15); }
    50% { box-shadow: 0 0 0 12px rgba(0, 209, 209, 0); }
}

@keyframes successRing {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0; }
}

/* ═══ Responsive ═══ */
@media (max-width: 480px) {
    .modal-container {
        padding: 22px 18px;
        border-radius: 20px;
    }
    .service-type-options {
        grid-template-columns: 1fr;
    }
    .modal-close {
        top: 12px;
        left: 12px;
        width: 34px;
        height: 34px;
    }
    .modal-title {
        font-size: 1.25rem;
    }
    .modal-success-icon {
        width: 64px;
        height: 64px;
    }
}
