/**
 * Модал авторизации / регистрации по телефону — Дом Рядом
 * Version 1.0.0
 */

/* ============================================================
   ОВЕРЛЕЙ
   ============================================================ */

.domrdm-auth-overlay {
    --glass-color: #bbbbbc;
    --glass-light: #fff;
    --glass-dark: #000;
    --glass-reflex-light: 1;
    --glass-reflex-dark: 1;

    position: fixed;
    inset: 0;
    z-index: 99998;
    background-color: color-mix(in srgb, var(--glass-color) 18%, transparent);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.domrdm-auth-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   МОДАЛ
   ============================================================ */

.domrdm-auth-modal {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: transform .35s cubic-bezier(.32, .72, 0, 1), opacity .2s ease;
    
    /* Liquid glass card */
    background-color: color-mix(in srgb, #fff 72%, transparent);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, #fff 14%, transparent),
        inset 1.8px 3px 0px -2px color-mix(in srgb, #fff 80%, transparent),
        inset -2px -2px 0px -2px color-mix(in srgb, #fff 70%, transparent),
        inset -3px -8px 1px -6px color-mix(in srgb, #fff 50%, transparent),
        inset -0.3px -1px 4px 0px color-mix(in srgb, #000 10%, transparent),
        inset -1.5px 2.5px 0px -2px color-mix(in srgb, #000 14%, transparent),
        inset 0px 3px 4px -2px color-mix(in srgb, #000 14%, transparent),
        0px 2px 8px 0px color-mix(in srgb, #000 8%, transparent),
        0px 12px 40px 0px color-mix(in srgb, #000 12%, transparent);
}

.domrdm-auth-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Мобиль: снизу вверх */
@media (max-width: 599px) {
    .domrdm-auth-modal {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        overflow-y: auto;
    }

    .domrdm-auth-modal.is-open {
        transform: translateY(0);
    }
}

/* Десктоп: по центру */
@media (min-width: 600px) {
    .domrdm-auth-modal {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -38%);
        width: 420px;
        border-radius: 20px;
        max-height: 92vh;
        overflow-y: auto;
    }

    .domrdm-auth-modal.is-open {
        transform: translate(-50%, -50%);
    }
}

/* ============================================================
   КНОПКА ЗАКРЫТИЯ
   ============================================================ */

.domrdm-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background .15s;
    flex-shrink: 0;
    z-index: 2;
}

.domrdm-auth-close:hover {
    background: #e8e8e8;
}

/* ============================================================
   ШАГ (общий контейнер)
   ============================================================ */

.domrdm-auth-step {
    padding: 32px 24px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Принудительно скрываем шаги с атрибутом hidden или inline display:none */
.domrdm-auth-step[hidden],
.domrdm-auth-step[style*="display: none"] {
    display: none !important;
}

/* Спиннер скрыт по умолчанию */
.domrdm-auth-loading[hidden],
.domrdm-auth-loading[style*="display: none"] {
    display: none !important;
}

@media (min-width: 600px) {
    .domrdm-auth-step {
        padding: 40px 32px 36px;
    }
}

/* ============================================================
   ЗАГОЛОВОК И ПОДЗАГОЛОВОК
   ============================================================ */

.domrdm-auth-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.25;
    margin: 0 0 6px;
}

.domrdm-auth-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.5;
}

.domrdm-auth-subtitle strong {
    color: #1a1a1a;
}

/* ============================================================
   КНОПКА НАЗАД
   ============================================================ */

.domrdm-auth-back {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background .15s;
}

.domrdm-auth-back:hover {
    background: #e8e8e8;
}

/* Когда есть кнопка «назад» — смещаем заголовок */
#domrdm-auth-step-2 .domrdm-auth-title,
#domrdm-auth-step-3-login .domrdm-auth-title,
#domrdm-auth-step-call .domrdm-auth-title {
    padding-left: 44px;
}

/* ============================================================
   ПОЛЕ ВВОДА ТЕЛЕФОНА
   ============================================================ */

.domrdm-auth-phone-wrap {
    margin: 20px 0 8px;
}

.domrdm-auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
}

.domrdm-auth-input:focus {
    border-color: #1F9356;
}

.domrdm-auth-input::placeholder {
    color: #bbb;
}

/* ============================================================
   OTP: 4 цифры
   ============================================================ */

.domrdm-auth-otp-wrap {
    margin: 20px 0 8px;
}

.domrdm-auth-otp-input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 12px;
    text-align: center;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
}

.domrdm-auth-otp-input:focus {
    border-color: #1F9356;
}

/* ============================================================
   СООБЩЕНИЕ ОБ ОШИБКЕ
   ============================================================ */

.domrdm-auth-error {
    font-size: 13px;
    color: #1F9356;
    min-height: 18px;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* ============================================================
   ОСНОВНАЯ КНОПКА
   ============================================================ */

.domrdm-auth-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 20px;
    margin-top: 12px;
    background: #1F9356;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
    -webkit-appearance: none;
}

.domrdm-auth-btn-primary:hover {
    background: #177a45;
}

.domrdm-auth-btn-primary:active {
    transform: scale(.98);
}

.domrdm-auth-btn-primary:disabled {
    background: #a8d5bc;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   КНОПКА «ОТПРАВИТЬ СНОВА»
   ============================================================ */

.domrdm-auth-resend {
    display: block;
    margin: 14px auto 0;
    background: none;
    border: none;
    font-size: 14px;
    color: #1F9356;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: opacity .2s;
}

.domrdm-auth-resend:disabled {
    color: #aaa;
    cursor: not-allowed;
}

/* ============================================================
   ЧЕКБОКСЫ
   ============================================================ */

.domrdm-auth-checkboxes {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.domrdm-auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.domrdm-auth-check input[type="checkbox"] {
    display: none;
}

.domrdm-auth-check-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
    margin-top: 1px;
}

.domrdm-auth-check input:checked + .domrdm-auth-check-icon {
    background: #1F9356;
    border-color: #1F9356;
}

.domrdm-auth-check input:checked + .domrdm-auth-check-icon::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* ============================================================
   ТЕКСТ УСЛОВИЙ
   ============================================================ */

.domrdm-auth-terms {
    margin-top: 16px;
    font-size: 12px;
    color: #aaa;
    line-height: 1.5;
}

.domrdm-auth-terms a {
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #ddd;
    transition: color .15s;
}

.domrdm-auth-terms a:hover {
    color: #1a1a1a;
}

/* ============================================================
   ССЫЛКА «ЗАБЫЛИ ПАРОЛЬ»
   ============================================================ */

.domrdm-auth-forgot {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: #888;
    text-decoration: none;
    transition: color .15s;
}

.domrdm-auth-forgot:hover {
    color: #1a1a1a;
}

/* ============================================================
   СПИННЕР ЗАГРУЗКИ
   ============================================================ */

.domrdm-auth-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

.domrdm-auth-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #1F9356;
    border-radius: 50%;
    animation: domrdm-spin .7s linear infinite;
}

@keyframes domrdm-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   БЛОКИРОВКА ПРОКРУТКИ СТРАНИЦЫ
   ============================================================ */

body.domrdm-auth-open {
    overflow: hidden;
}

/* ============================================================
   ВЫЗОВ (ЗВОНОК) — ШАГ 3
   ============================================================ */

.domrdm-auth-call-number {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-primary, #1F9356);
    text-align: center;
    margin: 14px 0;
}

.domrdm-auth-call-number a {
    color: inherit;
    text-decoration: none;
}

.domrdm-auth-call-hint {
    font-size: 13px;
    color: var(--color-text-secondary, #6b7280);
    text-align: center;
    margin: 0 0 18px;
    line-height: 1.5;
}

.domrdm-auth-call-status {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--color-primary, #1F9356);
}

.domrdm-auth-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    margin-top: 4px;
    background: transparent;
    color: var(--color-text-secondary, #6b7280);
    border: 1.5px solid var(--color-border, #e5e7eb);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    -webkit-appearance: none;
}

.domrdm-auth-btn-secondary:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

/* Вариант close-кнопки внутри контента (не absolute) */
.domrdm-auth-close--inline {
    position: relative;
    top: auto;
    right: auto;
    margin: 4px auto 0;
}

/* removed destructive button.btn-login override */

button.mobile-nav-item {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: inherit;
}
