.overlay {
    position: fixed;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    inset: 0;
    z-index: 0;
}

button * {
    pointer-events: none;
}

.modal {
    display: none;
}

.modal.show {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 999999999999;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(1rem, 3vh, 2rem);
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: none;
}

.modal.show .overlay {
    pointer-events: auto;
}

.modal.show .modal-content {
    pointer-events: auto;
}

.modal-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(400px, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 20px 50px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0;
    border-bottom: 0;
}

.modal-header.flex-column {
    position: relative;
    align-items: stretch;
    padding-right: 3.25rem;
}

.modal-header.flex-column > .btn-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.modal-title-text {
    margin: 0.35rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #64748b;
}

.modal-body {
    padding: 1rem 1.25rem 1.25rem;
}

.modal-form-control {
    min-height: 48px;
    padding: 0.75rem 1rem;
    border: 1px solid #d7dce3;
    border-radius: 12px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-form-control:focus {
    border-color: #f58220;
    box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
    outline: none;
}

.modal-form-control::placeholder {
    color: #94a3b8;
}

.check-footer-modal {
    margin: 0 0 1.25rem;
}

.modal_footer {
    max-width: none;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #64748b;
}

.modal_footer a {
    color: #0f172a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.modal_footer a:hover {
    color: #f58220;
}

.modal-body .button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 0.65rem;
    width: 100%;
    margin: 0;
}

.button_modal {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 8.5rem;
    min-height: 46px;
    padding: 0.65rem 1.1rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.button_modal[type="submit"],
.button_modal:not(.button_modal_cancle) {
    background-color: #f58220 !important;
    color: #fff !important;
    border-color: #f58220;
}

.button_modal[type="submit"]:hover,
.button_modal:not(.button_modal_cancle):hover {
    background-color: #e9530d !important;
    border-color: #e9530d;
}

.button_modal_cancle {
    background-color: #fff !important;
    color: #334155 !important;
    border: 1px solid #d0d5dd !important;
}

.button_modal_cancle:hover {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
}

.modal .btn-close {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 1rem;
    opacity: 1;
    transition: background 0.2s ease;
}

.modal .btn-close:hover {
    background-color: #e2e8f0;
}

#preloader {
    position: relative;
    left: 0;
    top: 0;
    z-index: 999;
    width: 100%;
    height: 200px;
    overflow: visible;
    background: #fbfbfb url('1486.gif') no-repeat center center;
}

.visible {
    visibility: visible;
    opacity: 1;
    transition: opacity 2s linear;
}

.hidden {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 2s, opacity 2s linear;
}

@media (min-width: 992px) {
    .modal-content {
        max-width: min(560px, calc(100vw - 3rem));
        border-radius: 22px;
    }

    .modal-header {
        padding: clamp(1.5rem, 2.5vw, 2rem) clamp(1.75rem, 3vw, 2.25rem) 0;
    }

    .modal-header.flex-column {
        padding-right: clamp(3.5rem, 4vw, 4rem);
    }

    .modal-header.flex-column > .btn-close {
        top: clamp(1.5rem, 2.5vw, 2rem);
        right: clamp(1.75rem, 3vw, 2.25rem);
    }

    .modal-body {
        padding: clamp(1rem, 2vw, 1.35rem) clamp(1.75rem, 3vw, 2.25rem) clamp(1.5rem, 2.5vw, 2rem);
    }

    .modal-title {
        font-size: clamp(1.35rem, 2vw, 1.65rem);
    }

    .modal-form-control {
        min-height: 52px;
        font-size: 1.0625rem;
    }

    .modal_footer {
        font-size: 0.8125rem;
        line-height: 1.55;
    }

    .button_modal {
        min-height: 50px;
        font-size: 1rem;
    }

    .round-img {
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 1200px) {
    .modal-content {
        max-width: min(600px, calc(100vw - 4rem));
    }
}
