#sheragencyPopup.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#sheragencyPopup.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#sheragencyPopup .modal {
    display: flex;
    width: 100%;
    max-width: 1000px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    position: relative;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#sheragencyPopup.modal-overlay.is-open .modal {
    opacity: 1;
    transform: scale(1);
}

#sheragencyPopup .modal-image-col {
    flex: 0 0 50%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#sheragencyPopup .dog-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

#sheragencyPopup .dog-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

#sheragencyPopup .dog-image.active {
    opacity: 1;
}

#sheragencyPopup .modal-form-col {
    flex: 1 1 auto;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

#sheragencyPopup .modal-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.2;
    color: #111;
}

#sheragencyPopup .modal-form input[type="email"],
#sheragencyPopup .modal-form input[type="text"],
#sheragencyPopup .modal-form input[type="tel"],
#sheragencyPopup .modal-form textarea,
#sheragencyPopup .modal-form select {
    width: 100%;
    height: 46px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 24px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#sheragencyPopup .modal-form input:focus,
#sheragencyPopup .modal-form textarea:focus,
#sheragencyPopup .modal-form select:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

#sheragencyPopup .modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 8px;
}

#sheragencyPopup .modal-terms {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    max-width: 220px;
}

#sheragencyPopup .modal-terms a {
    color: #000;
    text-decoration: underline;
}

#sheragencyPopup .modal-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

#sheragencyPopup .modal-submit:hover {
    background: #333;
}

#sheragencyPopup .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    z-index: 10;
    transition: background 0.2s ease;
    padding: 0;
}

#sheragencyPopup .modal-close:hover {
    background: #333;
}

#sheragencyPopup .modal-thanks-text {
    font-size: 16px;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

#sheragencyPopup .form-step[hidden] {
    display: none;
}

@media (max-width: 900px) {
    #sheragencyPopup .modal-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    #sheragencyPopup .modal-submit {
        width: 100%;
    }
}

@media (max-width: 700px) {
    #sheragencyPopup .modal {
        flex-direction: column;
        max-width: 420px;
    }
    #sheragencyPopup .modal-image-col {
        flex: 0 0 260px;
        min-height: 260px;
    }
    #sheragencyPopup .modal-form-col {
        padding: 32px 24px;
    }
    #sheragencyPopup .modal-title {
        font-size: 26px;
    }
    #sheragencyPopup .modal-form input[type="email"],
    #sheragencyPopup .modal-form input[type="text"],
    #sheragencyPopup .modal-form input[type="tel"],
    #sheragencyPopup .modal-form textarea,
    #sheragencyPopup .modal-form select {
        margin-bottom: 0;
    }
    #sheragencyPopup .modal-close {
        background: #fff;
        color: #333;
        border: 1px solid #e0e0e0;
    }
    #sheragencyPopup .modal-close:hover {
        background: #f5f5f5;
    }
}

#sheragencyPopup .gfield--input-type-html.gfield--width-half {
    grid-column: span 12 !important;
    max-width: 310px;
}

#sheragencyPopup .gfield--type-submit {
    width: 100%;
    height: 50px;
    display: flex !important;
    align-self: flex-start !important;
    position: relative;
}

#sheragencyPopup .gfield--type-submit::after {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: #fff;
}

#sheragencyPopup .gfield--type-submit .gform_button.gform-has-spinner,
#sheragencyPopup .gfield--type-submit .gform_button.gform-has-spinner:hover,
#sheragencyPopup .gfield--type-submit .gform_button.gform-has-spinner:focus,
#sheragencyPopup .gfield--type-submit .gform-button.gform-has-spinner,
#sheragencyPopup .gfield--type-submit .gform-button.gform-has-spinner:hover,
#sheragencyPopup .gfield--type-submit .gform-button.gform-has-spinner:focus,
#sheragencyPopup .gfield--type-submit input[type="submit"].gform-has-spinner,
#sheragencyPopup .gfield--type-submit input[type="submit"].gform-has-spinner:hover,
#sheragencyPopup .gfield--type-submit input[type="submit"].gform-has-spinner:focus,
#sheragencyPopup .gfield--type-submit button[type="submit"].gform-has-spinner,
#sheragencyPopup .gfield--type-submit button[type="submit"].gform-has-spinner:hover,
#sheragencyPopup .gfield--type-submit button[type="submit"].gform-has-spinner:focus {
    color: #fff !important;
    background: #000 !important;
    border: none !important;
}

#sheragencyPopup .gfield--type-submit .gform_button.gform-has-spinner::before,
#sheragencyPopup .gfield--type-submit .gform_button.gform-has-spinner::after,
#sheragencyPopup .gfield--type-submit .gform-button.gform-has-spinner::before,
#sheragencyPopup .gfield--type-submit .gform-button.gform-has-spinner::after,
#sheragencyPopup .gfield--type-submit input[type="submit"].gform-has-spinner::before,
#sheragencyPopup .gfield--type-submit input[type="submit"].gform-has-spinner::after,
#sheragencyPopup .gfield--type-submit button[type="submit"].gform-has-spinner::before,
#sheragencyPopup .gfield--type-submit button[type="submit"].gform-has-spinner::after {
    display: none !important;
    content: none !important;
}

#sheragencyPopup .gfield--type-submit .gform_button.gform-has-spinner > *,
#sheragencyPopup .gfield--type-submit .gform-button.gform-has-spinner > * {
    display: none !important;
}

#sheragencyPopup .gfield--type-submit .gform-button,
#sheragencyPopup .gfield--type-submit input[type="submit"],
#sheragencyPopup .gfield--type-submit button[type="submit"] {
    width: 100%;
    padding-right: 40px;
    height: 50px !important;
}

#sheragencyPopup .gform_wrapper.gravity-theme .gform_fields {
    display: flex !important;
    flex-direction: column;
}
