body.mdp-auth-modal-open,
html.mdp-auth-modal-open {
    overflow: hidden;
}

.mdp-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.mdp-auth-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mdp-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 15, 20, 0.62);
    backdrop-filter: blur(2px);
}

.mdp-auth-modal__dialog {
    position: relative;
    display: grid;
    grid-template-columns: minmax(300px, 422px) minmax(320px, 1fr);
    width: min(100%, 845px);
    min-height: 505px;
    background: #fff;
    border: 2px solid #3b99fc;
    border-radius: 3px;
    box-shadow: 0 24px 60px rgba(17, 15, 20, 0.2);
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s ease;
}

.mdp-auth-modal.is-open .mdp-auth-modal__dialog {
    transform: translateY(0) scale(1);
}

.mdp-auth-modal__close {
    position: absolute;
    top: 12px;
    right: 13px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #242424;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.mdp-auth-modal__media {
    padding: 23px 15px 23px 23px;
    background: #fff;
}

.mdp-auth-modal__media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 458px;
    object-fit: cover;
    border-radius: 8px;
}

.mdp-auth-modal__content {
    position: relative;
    padding: 18px 28px 26px 17px;
    overflow: hidden;
    background: #fff;
}

.mdp-auth-modal__title {
    color: #222;
    font-family: 'Libre Baskerville', serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 19px;
    padding-right: 28px;
}

.mdp-auth-modal__subtitle {
    color: #666;
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 22px;
    max-width: 340px;
}

.mdp-auth-view {
    position: absolute;
    inset: 18px 28px 26px 17px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(18px);
    transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
}

.mdp-auth-view.is-active {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.mdp-auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.mdp-auth-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mdp-auth-form__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mdp-auth-form__field span {
    color: #2d2d2d;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.mdp-auth-form__field input {
    width: 100%;
    height: 44px;
    border: 1px solid #dfdfdf;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    padding: 0 14px;
    color: #232323;
    font-size: 18px;
    font-family: 'Josefin Sans', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mdp-auth-form__field input::placeholder {
    color: #a5a5a5;
}

.mdp-auth-form__field input:focus {
    outline: none;
    border-color: rgba(218, 10, 86, 0.55);
    box-shadow: 0 0 0 3px rgba(218, 10, 86, 0.12);
}

.mdp-auth-form__password-wrap {
    position: relative;
}

.mdp-auth-form__password-wrap input {
    padding-right: 48px;
}

.mdp-auth-form__toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #555;
    cursor: pointer;
    padding: 0;
}

.mdp-auth-form__toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.mdp-auth-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -2px;
}

.mdp-auth-form__link,
.mdp-auth-form__inline-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: #f05a24;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Josefin Sans', sans-serif;
    cursor: pointer;
}

.mdp-auth-form__submit {
    height: 44px;
    margin-top: 18px;
    border: 0;
    background: #da0a56;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Josefin Sans', sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.mdp-auth-form__submit:hover,
.mdp-auth-form__submit:focus {
    background: #bf084a;
}

.mdp-auth-form__submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

.mdp-auth-form__vendor-cta {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #f3d2dc;
    border-radius: 6px;
    background: #fff6f9;
}

.mdp-auth-form__vendor-text {
    margin: 0 0 10px;
    color: #3d3d3d;
    font-size: 14px;
    line-height: 1.45;
}

.mdp-auth-form__vendor-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #da0a56;
    border-radius: 4px;
    color: #da0a56;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Josefin Sans', sans-serif;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.mdp-auth-form__vendor-link:hover,
.mdp-auth-form__vendor-link:focus {
    background: #da0a56;
    color: #fff;
}

.mdp-auth-form__messages {
    display: none;
    padding: 11px 14px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.45;
}

.mdp-auth-form__messages.is-visible {
    display: block;
}

.mdp-auth-form__messages.is-error {
    background: #fff1f4;
    border: 1px solid #f3b1c8;
    color: #8d123f;
}

.mdp-auth-form__messages.is-success {
    background: #eefaf3;
    border: 1px solid #b2e0c0;
    color: #1e6a39;
}

.mdp-auth-form__footer {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
    color: #8f8f8f;
    font-size: 15px;
    line-height: 1.4;
}

@media (max-width: 860px) {
    .mdp-auth-modal {
        padding: 16px;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mdp-auth-modal__dialog {
        grid-template-columns: 1fr;
        width: min(100%, 460px);
        min-height: 0 !important;
        height: fit-content;
        margin: 0 auto;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
    }

    .mdp-auth-modal__media {
        display: none;
    }

    .mdp-auth-modal__content {
        padding: 18px 16px 22px;
        overflow: visible;
    }

    .mdp-auth-modal__close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 30px;
    }

    .mdp-auth-modal__title {
        padding-right: 56px;
    }
}

@media (max-width: 520px) {
    .mdp-auth-modal {
        padding: 10px;
    }

    .mdp-auth-modal__dialog {
        width: 100%;
    }

    .mdp-auth-modal__title {
        font-size: 21px;
        margin-bottom: 16px;
    }

    .mdp-auth-form__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mdp-auth-form__field input {
        font-size: 17px;
    }

    .mdp-auth-form__footer {
        padding-top: 18px;
    }
}
