html, body {
    overflow-x: hidden;
    max-width: 100%;
}

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.form-label,
.form-floating label {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: #495057;
    margin-top: 1.2rem;
    margin-bottom: 0.4rem;
    font-family: inherit;
}

/* Select Dropdown */

.form-select {
    display: block;
    width: 100%;
    padding: 1rem 0;
    font-size: 0.9rem;
    font-family: inherit;
    color: #6c757d;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='12' viewBox='0 0 16 16' fill='%236c757d' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%236c757d' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 12px;
}

.form-select:focus {
    outline: none;
    box-shadow: none;
    border-bottom: 1px solid #8AADA0;
}

.form-select option {
    color: #212529;
}

/* Checkbox and Form Text */

.form-check-label {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    color: #495057;
}

#contactForm .mb-3 {
    margin-bottom: 2rem !important;
}

#contactForm textarea.form-control {
    border-bottom: 1px solid #dee2e6;
}

#contactForm .text-muted {
    font-size: 0.85rem;
}

/* Buttons */

.Confirmation {
    display: flex;
    justify-content: center;
    align-items: center;
}

#clearButton:hover {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    transition: 0.2s ease;
}

/* reCAPTCHA */

.captcha-box {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

/* Invalid Field State*/

.is-invalid {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2) !important;
    background-color: #fff5f5 !important;
}

/* Error Popup Modal */

body.popup-open {
    overflow: hidden;
}

#formPopupBox {
    width: 90% !important;
    max-width: 620px !important;
    background-color: #ffffff !important;
    border: 2px solid #dc3545 !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28) !important;
    padding: 28px 32px !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

#formPopupTitle {
    margin: 0 0 14px !important;
    color: #842029 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

#formPopupMessage {
    display: block !important;
    color: #842029 !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    margin-bottom: 22px !important;
    white-space: pre-line !important;
}

#formPopupClose {
    display: inline-block !important;
    border: none !important;
    background-color: #8AADA0 !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    padding: 10px 30px !important;
    cursor: pointer !important;
    font-size: 15px !important;
}

#formPopupClose:hover {
    background-color: #7aa093 !important;
}

.flash-modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background-color: rgba(0, 0, 0, 0.38);
    justify-content: center;
    align-items: center;
}

.flash-modal-box {
    background: #ffffff;
    border: 2px solid #8AADA0;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    padding: 32px 36px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.flash-modal-box p {
    margin: 0 0 20px;
    font-size: 1rem;
    color: #166534;
    line-height: 1.6;
}

.flash-modal-button {
    border: none;
    background-color: #8AADA0;
    color: #ffffff;
    border-radius: 999px;
    padding: 10px 30px;
    cursor: pointer;
    font-size: 15px;
}

.flash-modal-button:hover {
    background-color: #7aa093;
}

.btn-clear {
    position: relative;
    background-color: transparent;
    border: 1.5px solid #ff0000;
    color: #ff0000;
    padding: 14px 14px;
    border-radius: 50px;
    transition: background-color 0.3s, color 0.3s, transform 0.3s, border-color 0.3s;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    z-index: 0;
    outline: none;
    animation: FadeUp 1s ease-in;
}

.btn-tri:hover {
   background-color: #fff !important;
   color: #000 !important;

}

.btn-clear:before {
    content: '';
    background: linear-gradient(45deg, #ff8989, #ff5757, #ff3838, #ff1e1e, #ff5252);
    position: absolute;
    top: -2px;
    color: #ffffff;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 10s linear infinite;
    opacity: 0;
    transition: opacity .3s ease-in-out;
    border-radius: 50px;
}

.btn-clear:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    color: #ffffff;
    background: transparent;
    left: 0;
    top: 0;
    border-radius: 50px;
    transition: background-color 0.3s;
}

.btn-clear:hover,
.btn-clear:focus {
    background-color: #ff5252 !important;
    color: #ffffff;
    transform: translateY(-4px);
    border-color: #ff0000;

}

.btn-clear:hover:before {
    opacity: 1;
     color: #ffffff;
}

.btn-clear:hover:after {
    background: #ff5252;
    color: #ffffff;
}

.btn-clear:active {
    background-color: #990000;
     color: #ffffff;
}

.btn-clear:active:after {
    background: transparent;
    color: #ffffff;
}

@keyframes glowing {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}




@media (max-width: 576px) {
    #formPopup {
        padding: 85px 14px 20px !important;
    }
    #formPopupBox {
        width: 94% !important;
        padding: 24px !important;
    }
    #formPopupTitle {
        font-size: 18px !important;
    }
    #formPopupMessage {
        font-size: 14px !important;
    }
    .masthead {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }
    #mainNav {
        width: 100% !important;
        max-width: 100vw !important;
    }
    .g-recaptcha {
        transform: scale(0.77);
        transform-origin: left center;
    }
    main .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
        overflow: hidden;
    }
    .Confirmation {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    #submitButton,
    #clearButton {
        width: 100% !important;
        padding: 1rem !important;
    }
}
