/* Modal Overlay */
.modal-overlay {
    display: none !important; /* Force hide initially */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important; /* Force show when active */
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Container */
.contact-modal-container {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.contact-modal-header {
    padding: 32px 40px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    border-bottom: none;
}

.contact-modal-title {
    color: #191818;
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;

    margin: 0 0 0 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: left;
}

.contact-modal-back {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 24px;
    transition: opacity 0.2s ease;
}

.contact-modal-back:hover {
    opacity: 0.7;
}

.contact-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 24px;
    transition: opacity 0.2s ease;
}

.contact-modal-close:hover {
    opacity: 0.7;
}

.contact-modal-close svg {
    width: 24px;
    height: 24px;
}

/* Modal Body */
.modal-body {
    padding: 0 40px 40px;
}

.modal-subtitle {
    color: #5F5E5E;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 24px; /* 171.429% */

    margin: 0 0 32px;
}

/* Form Styles */
.contact-form-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input {
    color: #5F5E5E;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 22px; /* 157.143% */

    padding: 12px;
    border: 1px solid #D9D9D9;
    border-radius: 12px;
    font-family: "Lexend", -apple-system, sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #518910;
    box-shadow: 0 0 0 3px rgba(81, 137, 16, 0.1);
}

.form-group input::placeholder {
    color: #5F5E5E;
}

/* Checkbox Styles */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-group:last-of-type {
    margin-bottom: 32px;
}

.form-checkbox:last-of-type {
    margin-bottom: 32px;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #518910;
}

.form-checkbox label {
    color: #5F5E5E;
    font-size: 12px;
    font-style: normal;
    font-weight: 300;
    line-height: 20px; /* 166.667% */

    cursor: pointer;
}

.form-checkbox label a {
    color: #5F5E5E;
    text-decoration: underline;
}

.form-checkbox label a:hover {
    text-decoration: none;
}

/* Submit Button */
.submit-btn {
    background: #518910;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Lexend", -apple-system, sans-serif;
    margin-top: 8px;
}

.submit-btn:hover {
    background: #6BAB35;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(81, 137, 16, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-container {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .modal-header {
        padding: 24px 24px 12px;
    }

    .modal-header h2 {
        font-size: 24px;
    }

    .modal-body {
        padding: 0 24px 24px;
    }

    .modal-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .contact-form-modal {
        gap: 16px;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 15px;
    }

    .form-checkbox label {
        font-size: 13px;
    }

    .submit-btn {
        padding: 14px 28px;
        font-size: 15px;
    }

    .modal-overlay.active {
        align-items: start;
        justify-items: start;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end; /* Align to bottom on mobile */
    }

    .modal-container {
        margin: 0;
        max-height: 85vh; /* Leave some space at top */
        width: 100%;
        max-width: 100%;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .modal-header {
        padding: 20px 20px 12px;
        position: sticky;
        top: 0;
        background: white;
        border-radius: 24px 24px 0 0;
    }

    .modal-body {
        padding: 0 20px 20px;
        overflow-y: auto;
    }
}

