.checkout-auth {
    --checkout-auth-accent: #ee1d23;
    --checkout-auth-accent-hover: #d41920;
    --checkout-auth-ink: #101828;
    --checkout-auth-muted: #667085;
    --checkout-auth-line: #e8ebf0;
    --checkout-auth-surface: #f7f8fa;
    width: 100%;
    margin-top: 24px;
    color: #1d2939;
    font-family: "Noto Sans", "PT Sans", sans-serif;
}

.checkout-auth [hidden] {
    display: none !important;
}

.checkout-auth__toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.checkout-auth__login-under-fio {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    overflow: hidden;
}

.checkout-auth__login-under-fio .checkout-auth__open-login,
.checkout-auth__open-login {
    display: inline-block !important;
    width: auto !important;
    max-width: 100%;
    margin: 10px auto 0 3px !important;
    padding: 0 0 2px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--red-color, #0b9f6d) !important;
    border-radius: 0;
    background: transparent;
    color: #1d2939;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.checkout-auth__login-under-fio .checkout-auth__open-login[hidden] {
    display: none !important;
}

.checkout-auth__open-login:hover {
    color: var(--red-color, #0b9f6d) !important;
    border-bottom-color: var(--red-color, #0b9f6d) !important;
    background: transparent;
    box-shadow: none;
}

.checkout-auth__toolbar > .checkout-auth__open-login {
    margin-bottom: 4px !important;
}

.checkout-auth__overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #e8edee;
    pointer-events: auto;
    overscroll-behavior: contain;
    touch-action: none;
}

.checkout-auth__dialog {
    position: relative;
    width: min(480px, 100%);
    max-height: min(92vh, 760px);
    height: auto;
    overflow: auto;
    padding: 22px 24px 20px;
    border: 1px solid #d7dee0;
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 16px 40px rgba(16, 36, 40, 0.12),
        0 4px 12px rgba(16, 36, 40, 0.06);
    animation: checkoutAuthDialogIn 0.28s ease;
    overscroll-behavior: contain;
    touch-action: auto;
}

.checkout-auth__dialog,
.checkout-auth__dialog *,
.checkout-auth__toolbar,
.checkout-auth__toolbar * {
    box-sizing: border-box;
}

@keyframes checkoutAuthDialogIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.checkout-auth__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px;
    min-height: 36px;
    margin: 0 !important;
    padding: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--brand-accent, #cf454c);
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.22s ease;
}

.checkout-auth__close svg {
    width: 22px;
    height: 22px;
}

.checkout-auth__close svg path {
    fill: var(--brand-accent, #cf454c);
}

.checkout-auth__close:hover {
    background: transparent !important;
    border: 0 !important;
    color: var(--brand-accent, #cf454c);
    opacity: 0.75;
    box-shadow: none !important;
}

.checkout-auth__title {
    margin: 0 44px 8px 0;
    color: var(--checkout-auth-ink);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.checkout-auth__description {
    margin: 0 0 16px;
    color: var(--checkout-auth-muted);
    font-size: 14px;
    line-height: 1.5;
}

.checkout-auth__identity-card {
    margin: 0 0 22px;
    padding: 0;
    border: 0;
    background: transparent;
}

.checkout-auth__identity-label {
    display: block;
    margin-bottom: 6px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.checkout-auth__identity,
.checkout-auth__reset-email {
    display: block;
    width: 100% !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 12px !important;
    background: #fff;
    color: var(--checkout-auth-ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.checkout-auth__identity:hover,
.checkout-auth__reset-email:hover {
    border-color: #b8bec9 !important;
}

.checkout-auth__identity:focus,
.checkout-auth__reset-email:focus {
    border-color: #98a2b3 !important;
    box-shadow: 0 0 0 4px rgba(16, 24, 40, 0.06);
}

.checkout-auth__label {
    display: block;
    margin-bottom: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.checkout-auth__password-row {
    position: relative;
}

.checkout-auth__password {
    width: 100% !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 48px 0 16px !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 12px !important;
    background: #fff;
    color: var(--checkout-auth-ink);
    font-size: 15px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.checkout-auth__password:hover {
    border-color: #b8bec9 !important;
}

.checkout-auth__password:focus {
    border-color: #98a2b3 !important;
    box-shadow: 0 0 0 4px rgba(16, 24, 40, 0.06);
}

.checkout-auth__toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px;
    min-height: 36px;
    margin: 0 !important;
    padding: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none !important;
    color: #667085;
    transform: translateY(-50%);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.checkout-auth__toggle-password svg {
    width: 22px;
    height: 22px;
    display: block;
}

.checkout-auth__toggle-password .checkout-auth__eye-slash {
    display: none;
}

.checkout-auth__toggle-password.is-visible .checkout-auth__eye {
    display: none;
}

.checkout-auth__toggle-password.is-visible .checkout-auth__eye-slash {
    display: block;
}

.checkout-auth__toggle-password:hover {
    color: var(--checkout-auth-ink);
    background: rgba(16, 24, 40, 0.05);
    border: 0 !important;
    box-shadow: none !important;
}

.checkout-auth__message,
.checkout-auth__login-message,
.checkout-auth__reset-message {
    min-height: 0;
    margin: 8px 0 12px;
    color: #b42318;
    font-size: 13px;
    line-height: 1.45;
}

.checkout-auth__message:empty,
.checkout-auth__login-message:empty,
.checkout-auth__reset-message:empty {
    display: none;
    margin: 0;
}

.checkout-auth__login-message,
.checkout-auth__login-message.is-hint {
    color: var(--red-color, #0b9f6d);
}

.checkout-auth__login-message:not(:empty) {
    margin-bottom: 20px;
}

.checkout-auth__login-message.is-error {
    color: #b42318;
}

.checkout-auth__login-message.is-pending {
    color: #667085;
}

.checkout-auth__reset-message {
    color: #344054;
}

.checkout-auth__primary,
.checkout-auth__secondary {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 52px;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 14px 18px !important;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.checkout-auth__primary {
    margin-top: 8px !important;
    background: var(--checkout-auth-accent);
    color: #fff;
    box-shadow: 0 8px 20px rgba(238, 29, 35, 0.22);
    transition:
        background 0.22s ease,
        box-shadow 0.22s ease;
}

.checkout-auth__primary:hover:not(:disabled) {
    background: var(--checkout-auth-accent-hover);
    box-shadow: 0 10px 24px rgba(238, 29, 35, 0.3);
}

.checkout-auth__primary:active:not(:disabled) {
    box-shadow: 0 4px 12px rgba(238, 29, 35, 0.22);
}

/* Brand green CTA for booking (toolbar + register + login) */
.checkout-auth__open-register,
.checkout-auth__register > .checkout-auth__primary,
.checkout-auth__success > .checkout-auth__primary,
.checkout-auth__login-button,
.checkout-auth__reset-button {
    border: 1px solid var(--red-color, #0b9f6d) !important;
    background: var(--red-color, #0b9f6d) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(var(--red-color-rgb, 11, 159, 109), 0.28);
}

.checkout-auth__open-register,
.checkout-auth__register > .checkout-auth__primary,
.checkout-auth__success > .checkout-auth__primary {
    margin-top: 0 !important;
}

.checkout-auth__login-button,
.checkout-auth__reset-button {
    margin-top: 16px !important;
}

.checkout-auth__toolbar > .checkout-auth__open-register {
    width: 200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.checkout-auth__open-register:hover:not(:disabled),
.checkout-auth__register > .checkout-auth__primary:hover:not(:disabled),
.checkout-auth__success > .checkout-auth__primary:hover:not(:disabled),
.checkout-auth__login-button:hover:not(:disabled),
.checkout-auth__reset-button:hover:not(:disabled) {
    border-color: var(--red-color, #0b9f6d) !important;
    background: #098a5f !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(var(--red-color-rgb, 11, 159, 109), 0.34);
}

.checkout-auth__open-register:active:not(:disabled),
.checkout-auth__register > .checkout-auth__primary:active:not(:disabled),
.checkout-auth__success > .checkout-auth__primary:active:not(:disabled),
.checkout-auth__login-button:active:not(:disabled),
.checkout-auth__reset-button:active:not(:disabled) {
    box-shadow: 0 4px 12px rgba(var(--red-color-rgb, 11, 159, 109), 0.24);
}

.checkout-auth__secondary {
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #344054;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.checkout-auth__secondary:hover:not(:disabled) {
    border-color: #b8bec9;
    background: var(--checkout-auth-surface);
}

.checkout-auth__primary:disabled,
.checkout-auth__secondary:disabled {
    cursor: wait;
    opacity: .65;
}

.checkout-auth__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-top: 18px;
    padding-top: 4px;
}

.checkout-auth__link {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 0 2px !important;
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    border-bottom: 1px solid var(--red-color, #0b9f6d) !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #1d2939 !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.checkout-auth__link:hover {
    color: var(--red-color, #0b9f6d) !important;
    border-bottom-color: var(--red-color, #0b9f6d) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.checkout-auth__register .checkout-auth__link {
    display: inline-flex !important;
    margin: 18px 0 0 !important;
    text-align: left;
}

.checkout-auth__reset {
    margin: 0;
}

.checkout-auth__reset .turnstile-field {
    margin: 8px 0;
    min-height: 0;
}

.checkout-auth__reset .cf-turnstile {
    margin: 0;
}

.checkout-auth__reset .checkout-auth__reset-button {
    margin-top: 16px !important;
    border: 1px solid var(--red-color, #0b9f6d) !important;
    background: var(--red-color, #0b9f6d) !important;
    color: #fff !important;
}

.checkout-auth__reset .checkout-auth__back-to-login {
    display: flex !important;
    margin: 20px auto 0 !important;
}

.checkout-auth__success .checkout-auth__title {
    margin-right: 0;
}

.checkout-auth--embedded {
    margin-top: 20px;
}

.checkout-auth--embedded,
.checkout-auth--embedded * {
    box-sizing: border-box;
}

.checkout-auth__embedded-card {
    overflow: hidden;
    padding: 22px;
    border: 1px solid #dde5e2;
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(var(--red-color-rgb, 11, 159, 109), 0.1), transparent 38%),
        linear-gradient(145deg, #f8fbfa 0%, #fff 58%);
}

.checkout-auth__embedded-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.checkout-auth__shield {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(var(--red-color-rgb, 11, 159, 109), 0.11);
    color: var(--red-color, #0b9f6d);
}

.checkout-auth__shield svg {
    width: 22px;
    height: 22px;
}

.checkout-auth--embedded .checkout-auth__open-login {
    margin: 0 0 0 auto !important;
    color: var(--red-color, #0b9f6d);
    font-size: 13px;
}

.checkout-auth--embedded .checkout-auth__embedded-head:not(:has(.checkout-auth__open-login)) {
    display: none;
}

.checkout-auth--embedded .checkout-auth__title {
    margin: 0 0 8px;
    font-size: 20px;
}

.checkout-auth--embedded .checkout-auth__description {
    max-width: 760px;
    margin-bottom: 18px;
}

/* Капча стоит прямо над кнопкой заказа: решил проверку — сразу оформляешь,
   без промежуточного окна и лишнего клика. */
.checkout-auth__verify {
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
}

.checkout-auth__verify .turnstile-field {
    margin: 0 0 8px;
    min-height: 0;
}

.checkout-auth__verify .cf-turnstile,
.checkout-auth__verify .cf-turnstile iframe {
    display: block;
    line-height: 0;
}

.checkout-auth__eyebrow {
    display: block;
    margin-bottom: 9px;
    color: #58656f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checkout-auth--embedded .cf-turnstile {
    min-height: 65px;
}

.checkout-auth--embedded .checkout-auth__message {
    min-height: 0;
    margin: 0;
}

.checkout-auth--embedded .checkout-auth__message:empty {
    display: none;
}

.checkout-auth--embedded .checkout-auth__message:not(:empty) {
    margin: 6px 0 8px;
}

.checkout-auth--embedded .checkout-auth__embedded-submit {
    min-height: 52px;
    margin: 8px 0 0 !important;
    border: 1px solid var(--red-color, #0b9f6d) !important;
    background: var(--red-color, #0b9f6d) !important;
    color: #fff !important;
    box-shadow: 0 9px 22px rgba(var(--red-color-rgb, 11, 159, 109), 0.25);
}

.checkout-auth--embedded .checkout-auth__embedded-submit:hover:not(:disabled) {
    background: #098a5f !important;
    box-shadow: 0 11px 26px rgba(var(--red-color-rgb, 11, 159, 109), 0.32);
}

.checkout-auth__submit-note {
    margin: 8px 0 0;
    color: #667085;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.checkout-auth--embedded.is-authenticated .checkout-auth__embedded-card {
    border-color: rgba(var(--red-color-rgb, 11, 159, 109), 0.28);
    background: rgba(var(--red-color-rgb, 11, 159, 109), 0.055);
}

/* Строка сообщений красная — это канал ошибок; подтверждение входа в ней
   должно читаться как успех, а не как очередная проблема. */
.checkout-auth--embedded.is-authenticated .checkout-auth__message {
    color: #0b7f57;
    font-weight: 600;
}

/* Вошёл без перезагрузки — капча больше не нужна, остаётся кнопка заказа. */
.checkout-auth--embedded.is-authenticated .checkout-auth__verify .turnstile-field,
.checkout-auth--embedded.is-authenticated .checkout-auth__verify .checkout-auth__eyebrow,
.checkout-auth--embedded.is-authenticated .checkout-auth__submit-note {
    display: none;
}

html.checkout-auth-modal-open,
body.checkout-auth-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.checkout-auth-modal-open {
    position: fixed !important;
    top: calc(-1 * var(--checkout-auth-scroll-y, 0px)) !important;
    right: 0;
    left: 0;
    width: 100%;
}

@media (max-width: 575px) {
    .checkout-auth__dialog {
        padding: 20px 16px 16px;
        border-radius: 16px;
    }

    .checkout-auth__title {
        font-size: 20px;
        margin-right: 48px;
    }

    .checkout-auth__close {
        top: 10px;
        right: 10px;
        width: 36px !important;
        height: 36px;
        min-height: 36px;
    }

    .checkout-auth__links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .checkout-auth__embedded-card {
        padding: 18px 15px;
        border-radius: 15px;
    }

    .checkout-auth__embedded-head {
        align-items: flex-start;
    }

    .checkout-auth--embedded .checkout-auth__open-login {
        max-width: 100%;
        text-align: right;
    }

    .checkout-auth--embedded .cf-turnstile {
        max-width: 100%;
        overflow: hidden;
    }
}
