/**
 * [КОМПОНЕНТ]: Стили пошагового PWA-конвейера (Авито-Style)
 * Путь: pwa-form-styles.css
 * [ИСПРАВЛЕНО]: Полная изоляция окон, добавлены фиксы формы и структуры flexbox
 */

/* ========================================================================= */
/* 🛠️ 1. ГЛАВНЫЙ КОНТЕЙНЕР И СВЕРХТОЧНАЯ ГЕОМЕТРИЯ СЛАЙДЕРА                  */
/* ========================================================================= */

.pwa-add-listing-body.theme-dark {
    background-color: #121212;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden !important; /* Блокируем ложные боковые сдвиги сайта */
    overflow-y: auto;
    position: relative !important; /* Якорь для позиционирования внутренних окон */
    width: 100vw !important;
}

/* Нативная форма-рамка, удерживающая скользящий поезд шагов по центру */
form#lz-pwa-add-form {
    display: block !important;
    position: relative !important;
    width: 100vw !important;
    overflow: hidden !important; /* Скрывает уехавшие шаги за левой/правой границей экрана */
    min-height: 100vh;
}

/* Главный рельсовый трек-слайдер */
.pwa-wizard-slider {
    display: flex !important;
    width: 600vw !important; /* 6 полноценных окон Авито по 100vw каждый */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Физика шторки */
    will-change: transform;
    position: relative !important;
}

/* Каждый отдельный экран шага */
.pwa-step-screen {
    width: 100vw !important; /* Ровно один полный экран мобильного устройства */
    flex-shrink: 0 !important; /* Запрещаем браузеру сдавливать шаги по ширине */
    box-sizing: border-box;
    padding: 16px;
    min-height: 100vh;
    display: block !important; /* Гарантирует правильное горизонтальное выстраивание */
}

/* ========================================================================= */
/* 🛠️ 2. ШАПКИ ЭКРАНОВ И НАВИГАЦИЯ                                           */
/* ========================================================================= */

.avito-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #2c2c2c;
    margin-bottom: 20px;
}

.pwa-step-title, .pwa-step-title-header {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    flex-grow: 1;
}

.avito-header-back-arrow {
    background: none;
    border: none;
    color: #007aff;
    font-size: 24px;
    cursor: pointer;
    padding: 0 12px 0 0;
}

.avito-header-close-cross {
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 28px;
    cursor: pointer;
    padding: 0 0 0 12px;
}

/* ========================================================================= */
/* 🛠️ 3. СЕТКА ГЛОБАЛЬНЫХ ВЕРТИКАЛЕЙ (ШАГ 1)                                 */
/* ========================================================================= */

.verticals-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.vertical-tile-btn {
    background-color: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 12px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.vertical-tile-btn:active, .vertical-tile-btn.active {
    background-color: #2c2c2e;
    transform: scale(0.98);
    border-color: #007aff;
}

.vertical-tile-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.vertical-tile-text {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
}
/* ========================================================================= */
/* 🛠️ 4. ВЕРТИКАЛЬНЫЕ СПИСКИ АВИТО-STYLE И ИНПУТЫ ХАРАКТЕРИСТИК               */
/* ========================================================================= */

.pwa-fields-column-stack, .pwa-fields-column-stack-tail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwa-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pwa-input-label {
    font-size: 14px;
    color: #8e8e93;
    font-weight: 500;
}

/* Стандартные поля ввода для финального шага */
.pwa-text-input, .pwa-select-input, textarea.pwa-text-input {
    background-color: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 8px;
    color: #ffffff;
    padding: 12px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}

.pwa-text-input:focus, .pwa-select-input:focus {
    border-color: #007aff;
    background-color: #2c2c2e;
}

/* Нативные вертикальные контейнеры групп Авито-списков */
.pwa-list-group-wrapper {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.lz-avito-vertical-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Индивидуальные строки категорий (Квартира, Дом под ключ...) */
.lz-avito-list-item-row {
    -webkit-user-select: none;
    user-select: none;
    outline: none;
}

.lz-avito-list-item-row:last-child {
    border-bottom: none !important; /* Убираем нижнюю черту у последней плашки в блоке */
}

/* ========================================================================= */
/* 🛠️ 5. КНОПКИ ВЕРИФИКАЦИИ И ПУБЛИКАЦИИ                                     */
/* ========================================================================= */

.avito-btn-block-confirm, .lz-publish-action-btn, .lz-channel-btn-primary {
    background-color: #007aff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s;
}

.lz-publish-action-btn {
    background-color: #34c759; /* Тот самый зеленый цвет Авито */
}

.avito-btn-block-confirm:active, .lz-publish-action-btn:active, .lz-channel-btn-primary:active {
    opacity: 0.8;
}

/* ========================================================================= */
/* 🛠️ 6. БЛОК АВТО-ПАРОЛЯ, DROPZONE-ЗАГРУЗЧИК И МЕДИА-СЕТКА                 */
/* ========================================================================= */

.pwa-screen-code-alert {
    background-color: #1c1c1e;
    border: 1px dashed #34c759;
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    text-align: center;
}

.pwa-screen-code-value {
    font-size: 36px;
    font-weight: 700;
    color: #34c759;
    letter-spacing: 4px;
    margin: 10px 0;
}

.pwa-dropzone-uploader {
    border: 2px dashed #2c2c2e;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background-color: #1c1c1e;
}

.pwa-dropzone-big-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.pwa-dropzone-main-text { color: #8e8e93; font-size: 14px; }

/* Сетка фотографий лота с тач-сортировкой */
.crm-thumbnails-preview-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.crm-thumb-preview-item {
    position: relative;
    aspect-ratio: 1;
    background-color: #1c1c1e;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2c2c2e;
}

.crm-thumb-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crm-thumb-delete-cross {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #ffffff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 14px;
    cursor: pointer;
}

/* Индикатор главной (обложечной) фотографии объявления */
.crm-thumb-preview-item .main-badge {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(52, 199, 89, 0.9);
    color: #ffffff;
    font-size: 10px;
    text-align: center;
    padding: 2px 0;
}

.crm-thumb-preview-item.is-main .main-badge {
    display: block;
}

/* Высоконагруженный асинхронный лоадер картинок */
.loading-skeleton-photo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-photo-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #2c2c2e;
    border-top-color: #007aff;
    border-radius: 50%;
    animation: pwa-spin 0.8s linear infinite;
}

@keyframes pwa-spin { to { transform: rotate(360deg); } }

/* Интерактивная Яндекс.Карта Лазаревского/Сочи */
.avito-map-canvas {
    width: 100%;
    height: 240px;
    border-radius: 12px;
    margin-top: 8px;
    border: 1px solid #2c2c2e;
}
/* ========================================================================= */
/* ✨ ПРЕМИАЛЬНЫЙ ТЕМНЫЙ СТИЛЬ ШЛЮЗА АВТОР ИЗАЦИИ ЛАЗАДРОМ (АВИТО-STYLE)     */
/* ========================================================================= */

/* Контейнер-обертка шлюза */
.lz-dark-traveler-auth-form {
    background: #1c1c1e !important;
    border: 1px solid #2c2c2e !important;
    border-radius: 20px !important;
    padding: 24px 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    margin: 10px 4px !important;
}

/* Скрываем стандартные убогие лейблы Traveler */
.lz-dark-traveler-auth-form label {
    color: #8e8e93 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
    display: block !important;
}

/* Форматирование группы полей ввода */
.lz-dark-traveler-auth-form .form-group {
    margin-bottom: 20px !important;
    position: relative !important;
}

/* Ультра-модные темные инпуты с неоновым фокусом */
.lz-dark-traveler-auth-form input.form-control {
    width: 100% !important;
    background: #2c2c2e !important;
    border: 1px solid #3a3a3c !important;
    border-radius: 14px !important;
    padding: 16px 16px 16px 46px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    height: auto !important; /* Гасим жесткую высоту Traveler */
}

/* Эффект выделения инпута при тапе/вводе */
.lz-dark-traveler-auth-form input.form-control:focus {
    border-color: #007aff !important;
    background: #323236 !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15) !important;
}

/* Центрирование и раскраска неоновых иконок */
.lz-dark-traveler-auth-form .input-icon {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #8e8e93 !important;
    font-size: 18px !important;
    z-index: 5 !important;
    transition: color 0.25s ease !important;
    height: auto !important;
    width: auto !important;
    line-height: 1 !important;
}

/* Подсветка иконки при фокусе на инпуте */
.lz-dark-traveler-auth-form input.form-control:focus + .input-icon,
.lz-dark-traveler-auth-form .form-group-icon-left:focus-within .input-icon {
    color: #007aff !important;
}

/* Фирменная сочная кнопка входа Лазадром */
#lz-pwa-native-login-submit-btn {
    width: 100% !important;
    background: #007aff !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 18px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
    cursor: pointer !important;
    margin-top: 12px !important;
    display: block !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25) !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Эффект зажатия кнопки пальцем на смартфоне (Тактильный отклик) */
#lz-pwa-native-login-submit-btn:active {
    transform: scale(0.98) !important;
    background: #0063d1 !important;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2) !important;
}

/* Ссылка "Забыли пароль?" */
.lz-dark-traveler-auth-form a {
    color: #007aff !important;
    font-size: 14px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
    display: inline-block !important;
    margin-top: 8px !important;
}

.lz-dark-traveler-auth-form a:hover {
    color: #52a9ff !important;
}

/* Убираем ненужный мусор вроде чекбоксов политик под кнопкой, если они пробиваются */
.lz-dark-traveler-auth-form .st_check_term_conditions,
.lz-dark-traveler-auth-form .checkbox {
    display: none !important;
}
/* =========================================================================
   lz-pwa-re-wizard: Стили пошагового конструктора Недвижимости (Авито-стиль)
   ========================================================================= */

/* Анимация плавного появления шагов */
.pwa-step-screen {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.avito-animated-slide-in {
    animation: lzSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes lzSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Стилизация иерархических строк-триггеров */
.lz-avito-vertical-list {
    background: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lz-avito-list-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #2c2c2e;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.lz-avito-list-item-row:last-child {
    border-bottom: none;
}

.lz-avito-list-item-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.lz-avito-list-item-row.active {
    background: rgba(0, 122, 255, 0.15);
}

.lz-avito-list-item-row.active span {
    color: #007aff !important;
}
/* =========================================================================
   PWA АВИТО-СТИЛЬ: ОФОРМЛЕНИЕ ГОРИЗОНТАЛЬНЫХ ПЛИТОК В WIZARD-КОНВЕЙЕРЕ
   ========================================================================= */

/* Родовая линия: выстраиваем блоки в один сплошной горизонтальный трек */
.pwa-horizontal-scroll-tiles-line {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* Строгий запрет на перенос цифр вниз */
    gap: 8px !important;
    overflow-x: auto !important; /* Включаем скролл пальцем влево-вправо */
    overflow-y: hidden !important;
    padding: 8px 0 16px 0 !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch !important; /* Инерционная прокрутка iOS */
}

/* Скрываем уродливую полосу прокрутки браузера на смартфонах */
.pwa-horizontal-scroll-tiles-line::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Элемент плитки: превращаем его в аккуратный тактильный квадрат */
.pwa-digit-tile-select-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important; /* Абсолютный запрет на сжатие ширины */
    width: 46px !important;    /* Фиксированная ширина */
    height: 46px !important;   /* Фиксированная высота */
    background-color: #1e1e24 !important; /* Темный графитовый фон под стиль формы */
    border: 1px solid #2c2c2e !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: background-color 0.15s, border-color 0.15s !important;
}

/* Активное (нажатое) состояние плитки */
.pwa-digit-tile-select-item.active {
    background-color: #00aa63 !important; /* Фирменный зеленый цвет Авито */
    border-color: #00aa63 !important;
    color: #ffffff !important;
}
/* Закрепляем шапку пятого шага намертво сверху */
.pwa-canvas-sticky-header-top {
    position: sticky !important;
    position: -webkit-sticky !important; /* Поддержка Safari на iPhone */
    top: 0 !important;
    background-color: #121212 !important; /* В цвет фона экрана создания */
    z-index: 2100 !important; /* Выше, чем прокручиваемые плитки */
    padding: 12px 0 !important;
    margin-top: -16px !important; /* Компенсируем внутренний паддинг экрана */
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    border-bottom: 1px solid #2c2c2c !important;
}

/* Создаем защитную воздушную подушку для полей под липкой шапкой */
.pwa-fields-column-stack {
    padding-top: 8px !important;
}
/* =========================================================================
   🗺️ PWA АВИТО-СТИЛЬ: ПОЛНОЭКРАННЫЙ ОВЕРЛЕЙ ЯНДЕКС.КАРТ БОЛЬШОГО СОЧИ
   ========================================================================= */

/* Главный полноэкранный контейнер шторки */
#lz-yandex-map-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #121214 !important;
    z-index: 999999 !important;
    display: none;
    flex-direction: column !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Верхний фиксированный бар поиска */
.lz-map-header-bar {
    display: flex !important;
    align-items: center !important;
    height: 56px !important;
    padding: 0 16px !important;
    background-color: #16161a !important;
    border-bottom: 1px solid #2c2c2c !important;
    gap: 12px !important;
}

/* Кнопка «Назад» в шапке карт */
#lz-map-close-btn {
    background: none !important;
    border: none !important;
    color: #3b82f6 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

/* Контейнер строки ввода */
.lz-map-search-container {
    flex-grow: 1 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Инпут автоподбора адресов Яндекса */
#lz-map-search-suggest {
    flex-grow: 1 !important;
    height: 38px !important;
    background-color: #222226 !important;
    border: 1px solid #3a3a3c !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 0 12px !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
    outline: none !important;
}

/* Кнопка быстрой геолокации 📍 */
#lz-map-geolocate-btn {
    width: 38px !important;
    height: 38px !important;
    background-color: #222226 !important;
    border: 1px solid #3a3a3c !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 18px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Окно (холст) самой интерактивной карты */
#lz-yandex-canvas {
    width: 100% !important;
    flex-grow: 1 !important;
    background-color: #1e1e24 !important;
}

/* Нижний фиксированный подвал кнопки подтверждения */
.lz-map-footer-bar {
    padding: 16px !important;
    background-color: #16161a !important;
    border-top: 1px solid #2c2c2c !important;
}

/* Большая зеленая Авито-кнопка фиксации адреса */
#lz-map-confirm-btn {
    width: 100% !important;
    height: 48px !important;
    background-color: #00aa63 !important;
    border: none !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
}

#lz-map-confirm-btn:active {
    background-color: #008f52 !important;
}
/* =========================================================================
   📱 АВИТО-ДИЗАЙН КЛАССИФАЙДА (ТЕМНАЯ ТЕМА С НАШИМ ЗЕЛЕНЫМ АКЦЕНТОМ)
   ========================================================================= */

/* Контейнер полей */
.lz-dynamic-field-row {
    margin-bottom: 24px !important;
    background: transparent !important;
}

/* Мягкие, приглушенные заголовки полей Авито */
.pwa-input-label {
    display: block !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin-bottom: 10px !important;
    letter-spacing: -0.2px !important;
}

/* Нативные темные инпуты, селекторы и текстовые поля */
.pwa-text-input, 
select.pwa-text-input, 
textarea.pwa-text-input {
    width: 100% !important;
    height: 48px !important;
    background-color: #1c1c1e !important;
    border: 1px solid #2c2c2e !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    padding: 0 16px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* Фокус на инпутах подсвечиваем нашим фирменным зеленым */
.pwa-text-input:focus {
    border-color: #00aa63 !important;
    box-shadow: 0 0 0 3px rgba(0, 170, 99, 0.2) !important;
    outline: none !important;
}

/* Высота для поля Описания */
textarea.pwa-text-input {
    height: auto !important;
    padding: 14px 16px !important;
}

/* Подсказки под полями (как "Точный адрес поможет привлечь...") */
.pwa-field-description {
    font-size: 13px !important;
    color: #8e8e93 !important;
    margin-top: 6px !important;
    line-height: 1.4 !important;
}

/* Большая кнопка конвейера «Продолжить / Опубликовать» в стиле Авито */
#lz-publish-final-btn, 
.pwa-wizard-next-btn {
    width: 100% !important;
    height: 50px !important;
    background-color: #00aa63 !important; /* Наш фирменный зеленый */
    border: none !important;
    border-radius: 24px !important; /* Округлые края по дизайну */
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease, transform 0.1s active !important;
}

#lz-publish-final-btn:hover, 
.pwa-wizard-next-btn:hover {
    background-color: #008f52 !important;
}

#lz-publish-final-btn:active, 
.pwa-wizard-next-btn:active {
    transform: scale(0.98) !important;
}
