/* Enhanced Modal Styles - matching website design */

/* Modal overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 27, 30, 0.7);
    backdrop-filter: blur(4px);
    width: 100%;
    overflow: hidden;
    max-height: 100%;
    display: none;
    transform: translateY(-100%);
    z-index: 9999;
}

.modal.active {
    display: block;
    animation: showModal 0.3s ease-out both;
}

@keyframes showModal {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal wrapper for centering */
.modal .wrapper {
    overflow: auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal container - white card with shadow */
.modal_container {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 48px 40px;
    max-width: 520px;
    width: 100%;
    margin: auto;
    animation: modalSlideIn 0.4s ease-out 0.1s both;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Close button - styled X */
.close_modal {
    cursor: pointer;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close_modal::before,
.close_modal::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #1b1b1e;
    transition: background 0.2s;
    margin-top: -1px;
    margin-left: -10px;
}

.close_modal::before {
    transform: rotate(45deg);
}

.close_modal::after {
    transform: rotate(-45deg);
}

.close_modal:hover {
    background: #fb6221;
}

.close_modal:hover::before,
.close_modal:hover::after {
    background: #ffffff;
}

/* Form title styling */
.custom-form__title {
    font-size: 28px;
    font-weight: 700;
    color: #1b1b1e;
    margin-bottom: 12px;
    line-height: 1.2;
}

/* Form description */
.custom-form__desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Success message styling */
.custom-form__success {
    text-align: center;
    padding: 40px 20px;
}

.custom-form__success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #ffffff;
    margin: 0 auto 24px;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.custom-form__success p {
    font-size: 16px;
    color: #1b1b1e;
    margin-bottom: 8px;
}

.custom-form__success p:first-of-type {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Fix label positioning for placeholder=" " fields - override modal-form.css */
/* Override modal-form.css :not(:placeholder-shown) with high specificity */
#form_popup2 .custom-form__field input[placeholder=" "]:is(:not(:focus), :placeholder-shown) ~ label,
#form_popup2.custom-form__field input[placeholder=" "] ~ label {
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 0.95rem !important;
    color: #999 !important;
}

/* When input has placeholder=" " and IS focused, move label up */
#form_popup2 .custom-form__field input[placeholder=" "]:focus ~ label {
    top: 8px !important;
    transform: none !important;
    font-size: 0.72rem !important;
    color: #fb6221 !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .modal_container {
        padding: 36px 24px;
        border-radius: 12px;
    }

    .custom-form__title {
        font-size: 22px;
    }

    .close_modal {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 400px) {
    .modal .wrapper {
        padding: 10px;
    }

    .modal_container {
        padding: 28px 20px;
    }

    .custom-form__title {
        font-size: 20px;
    }
}
