/**
 * Модальные окна авторизации магазина — по макету
 */

.shopAuthModal {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.shopAuthModal[hidden] {
    display: none !important;
}

body.shopAuthModalOpen {
    overflow: hidden;
}

.shopAuthModal__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.62);
}

.shopAuthModal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 532px;
    max-height: calc(100vh - 48px);
    overflow: auto;
    margin: 0;
    padding: 44px 52px 36px;
    box-sizing: border-box;
    background: #efeeee;
    border: 0;
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    color: #0d4454;
}

.shopAuthModal__logo {
    display: flex;
    justify-content: center;
    margin: 0 0 40px;
}

.shopAuthModal__logo img {
    display: block;
    width: auto;
    max-width: 168px;
    height: auto;
}

.shopAuthModal__lead {
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 16px;
    color: #41525d;
}

.visuallyHidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.shopAuthForm__field {
    display: block;
    margin: 0 0 16px;
}

.shopAuthForm__input {
    display: block;
    width: 100%;
    margin: 0;
    padding: 15px 16px;
    box-sizing: border-box;
    min-height: 48px;
    border: 1px solid #c5d9de;
    border-radius: 0;
    background: #fff;
    color: #0d4454;
    font: inherit;
    font-size: 12px;
    line-height: 20px;
    outline: none;
    appearance: none;
}

.shopAuthForm__input::placeholder {
    color: #7694a4;
    opacity: 1;
}

.shopAuthForm__input:focus {
    border-color: #7694a4;
}

.shopAuthForm__input--error {
    border-color: #dc3545;
    box-shadow: none;
}

.shopAuthForm__passwordWrap {
    position: relative;
    display: block;
}

.shopAuthForm__passwordWrap .shopAuthForm__input {
    padding-right: 44px;
}

.shopAuthForm__togglePass {
    position: absolute;
    top: 50%;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #7694a4;
    transform: translateY(-50%);
    cursor: pointer;
    appearance: none;
}

.shopAuthForm__togglePass svg {
    width: 20px;
    height: 20px;
}

.shopAuthForm__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 20px;
    cursor: pointer;
}

body.shopPage .shopAuthModal .shopAuthForm__consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 1px 0 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    color: var(--orange, #f39b00);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

body.shopPage .shopAuthModal .shopAuthForm__consent input[type="checkbox"]::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
}

body.shopPage .shopAuthModal .shopAuthForm__consent input[type="checkbox"]:checked::before {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    margin: 4px 0 0 3px;
    border-left: 2px solid var(--orange, #f39b00);
    border-bottom: 2px solid var(--orange, #f39b00);
    transform: rotate(-45deg);
    box-sizing: border-box;
}

.shopAuthForm__consentText {
    flex: 1 1 auto;
    font-size: 12px;
    line-height: 16px;
    color: #41525d;
}

.shopAuthForm__message {
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 16px;
}

.shopAuthForm__message--error {
    color: #dc3545;
}

.shopAuthForm__message--success {
    color: #0d4454;
}

body.shopPage .shopAuthModal .shopAuthForm__submit {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0;
    padding: 16px 28px;
    border: 0;
    border-radius: 0;
    background: var(--orange, #f39b00) !important;
    color: #fff !important;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    appearance: none;
}

body.shopPage .shopAuthModal .shopAuthForm__submit:hover {
    filter: brightness(0.97);
}

body.shopPage .shopAuthModal .shopAuthForm__submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.shopAuthModal__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.shopAuthModal__footer--center {
    justify-content: center;
}

body.shopPage .shopAuthModal .shopAuthModal__link {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent !important;
    color: #0d4454 !important;
    font: inherit;
    font-size: 12px;
    line-height: 16px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

body.shopPage .shopAuthModal .shopAuthModal__link:hover {
    text-decoration: underline;
}

/* Гость: только поиск и профиль */
.shopTopBlock--guest .shopTopBlock__cell--points,
.shopTopBlock--guest .shopTopBlock__cell--cart {
    display: none !important;
}

.shopTopBlock__cell--profileBtn {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    appearance: none;
    font: inherit;
    color: inherit;
    text-decoration: none;
}

.shopInlineAuthLink {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--orange, #f39b00);
    font: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
    appearance: none;
}

.shopProfilePage__title {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.2;
    color: #0d4454;
}

.shopProfilePage__greeting,
.shopProfilePage__points,
.shopProfilePage__hint {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.45;
    color: #41525d;
}

.shopProfilePage__logout {
    margin-top: 24px;
}

.shopProfilePage__logoutBtn {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 12px 20px;
    border: 1px solid #c5d9de;
    border-radius: 0;
    background: #fff;
    color: #0d4454;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    appearance: none;
}

.shopProfilePage__logoutBtn:hover {
    border-color: #0d4454;
}

@media (max-width: 560px) {
    .shopAuthModal__dialog {
        max-width: 100%;
        padding: 36px 28px 28px;
    }

    .shopAuthModal__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .shopAuthModal__footer--center {
        align-items: center;
    }
}
