/* --- Popup Modal Styles --- */
        .modal {
            display: none; /* Hidden by default */
            position: fixed; /* Stay in place */
            z-index: 1000; /* Sit on top */
            left: 0;
            top: 0;
            width: 100%; /* Full width */
            height: 100%; /* Full height */
            overflow: auto; /* Enable scroll if needed */
            background-color: rgb(0,0,0); /* Fallback color */
            background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
            padding-top: 50px;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background-color: #fefefe;
            margin: auto; /* Centered by flex on parent */
            padding: 30px;
            border: 1px solid #888;
            width: 80%; /* Could be more or less, depending on screen size */
            max-width: 600px;
            border-radius: 10px;
            position: relative;
            box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
            background-size: cover;
            background-position: center;
            color: #333; /* Default text color, adjust if background is dark */
            max-height: 90vh; /* Ensure modal content does not exceed viewport height */
            overflow-y: auto; /* Allow scrolling for content that overflows */
        }

        .modal-content.dark-text-on-light-bg {
            color: #333;
        }
        .modal-content.light-text-on-dark-bg {
            color: #fff;
        }
        .modal-content.light-text-on-dark-bg input::placeholder,
        .modal-content.light-text-on-dark-bg select {
            color: #ccc; /* Lighter placeholder for dark backgrounds */
        }
        .modal-content.light-text-on-dark-bg select option {
            color: #333; /* Options in select dropdown usually have their own styling */
        }
        .modal-content.light-text-on-dark-bg .error {
            color: #ffdddd; /* Lighter red for errors on dark bg */
        }


        .close-button {
            color: #aaa;
            position: absolute;
            top: 15px;
            right: 25px;
            font-size: 35px;
            font-weight: bold;
        }

        .close-button:hover,
        .close-button:focus {
            color: black;
            text-decoration: none;
            cursor: pointer;
        }

        .popup-title {
            text-align: center;
            font-size: 24px;
            margin-bottom: 10px;
        }

        .popup-subtitle {
            text-align: center;
            font-size: 16px;
            margin-bottom: 20px;
            color: #555;
        }
        .modal-content.light-text-on-dark-bg .popup-subtitle {
            color: #eee;
        }

        /* --- Form Styles (Copied and adapted) --- */
        .form-group {
            margin-bottom: 15px;
        }

        .form-group input[type="text"],
        .form-group input[type="email"],
        .form-group input[type="tel"],
        .form-group select {
            width: 100%;
            padding: 12px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-sizing: border-box; /* So padding doesn't add to width */
            font-size: 16px;
        }
        .modal-content.light-text-on-dark-bg .form-group input,
        .modal-content.light-text-on-dark-bg .form-group select {
            background-color: rgba(255,255,255,0.1);
            border-color: rgba(255,255,255,0.3);
            color: #fff;
        }


        .phone-group {
            display: flex;
            align-items: center;
        }

        .phone-group div:first-child {
            flex: 0 0 130px; /* Fixed width for country code */
            margin-right: 10px;
        }

        .phone-group div:last-child {
            flex: 1; /* Phone number takes remaining space */
        }

        .error {
            color: red;
            font-size: 0.9em;
            display: none; /* Hidden by default */
            margin-top: 5px;
        }

        #leadForm button[type="submit"] {
            background-color: #4CAF50; /* Green */
            color: white;
            padding: 14px 20px;
            margin-top: 10px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            width: 100%;
            font-size: 18px;
            font-weight: bold;
        }

        #leadForm button[type="submit"]:hover {
            background-color: #45a049;
        }

        /* --- Responsive Adjustments --- */
        @media (max-width: 768px) {
            .modal-content {
                width: 90%;
                padding: 20px;
            }

            .popup-title {
                font-size: 22px;
            }

            .popup-subtitle {
                font-size: 15px;
            }

            .form-group input[type="text"],
            .form-group input[type="email"],
            .form-group input[type="tel"],
            .form-group select {
                font-size: 15px;
                padding: 10px;
            }

            #leadForm button[type="submit"] {
                font-size: 16px;
                padding: 12px;
            }

            .close-button {
                font-size: 30px;
                top: 10px;
                right: 15px;
            }
        }

        @media (max-width: 480px) {
            .modal-content {
                width: 95%;
                padding: 15px;
                max-height: 95vh; /* Allow a bit more vertical space if needed */
            }

            .popup-title {
                font-size: 20px;
                margin-bottom: 8px;
            }

            .popup-subtitle {
                font-size: 14px;
                margin-bottom: 15px;
            }
            
            .form-group {
                margin-bottom: 12px;
            }

            .form-group input[type="text"],
            .form-group input[type="email"],
            .form-group input[type="tel"],
            .form-group select {
                font-size: 14px;
                padding: 10px;
            }

            #leadForm button[type="submit"] {
                font-size: 15px;
                padding: 12px;
                margin-top: 8px;
            }

            .phone-group {
                align-items: center; /* Make children take full width */
            }

            .phone-group div:first-child {
                flex-basis: 80px; /* Reset fixed basis */
                margin-right: 10px;
                margin-bottom: 0px; /* Space between country code and phone number */
            }
            
            .phone-group div:last-child {
                flex-basis: auto;
            }
            
            .phone-group div:first-child select {
                width: 80px;
            }

            .close-button {
                font-size: 28px;
                top: 10px;
                right: 10px;
            }
        }
