/* Поля форм в окнах: поле с подписью и счётчиком, пароль с «глазом», переключатель.
   Переменные --ui-* объявлены в ui-modal.css. */
.ui-field { margin-bottom: 18px; }
.ui-field-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.ui-field-top label { margin: 0; font-size: 13.5px; font-weight: 600; }
.ui-opt, .ui-count { font-size: 12.5px; color: var(--ui-muted); font-weight: 400; }

.ui-input {
    display: block; width: 100%; padding: 11px 14px; font: inherit; font-size: 15px; color: var(--ui-text);
    background: var(--ui-field-bg); border: 1.5px solid var(--ui-field-border); border-radius: 12px;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.ui-input::placeholder { color: #a9a5a2; }
.ui-input:hover { border-color: #d3d3d3; }
.ui-input:focus { outline: none; background: #fff; border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(232, 65, 47, .12); }
textarea.ui-input { resize: none; min-height: 80px; line-height: 1.45; }
.ui-field.invalid .ui-input { border-color: var(--ui-danger); box-shadow: 0 0 0 4px rgba(217, 47, 34, .1); }
.ui-error { display: none; margin-top: 6px; font-size: 12.5px; color: var(--ui-danger); }
.ui-field.invalid .ui-error { display: block; }

/* пароль */
.ui-pw { position: relative; }
.ui-pw .ui-input { padding-right: 46px; }
.ui-eye {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none;
    color: var(--ui-muted); display: grid; place-items: center; cursor: pointer;
}
.ui-eye:hover { background: var(--ui-btn-bg); color: var(--ui-text); }
.ui-eye:focus-visible { outline: 2px solid var(--ui-accent); }
.ui-eye .off { display: none; }
.ui-eye.shown .on { display: none; }
.ui-eye.shown .off { display: block; }

/* переключатель «Скрыть альбом» */
.ui-switch-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 16px; margin: 0 0 14px;
    border: 1.5px solid var(--ui-field-border); border-radius: 12px; cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.ui-switch-row:hover { border-color: #d3d3d3; }
.ui-switch-row:has(input:checked) { border-color: #f1b3aa; background: var(--ui-accent-soft); }
.ui-switch-row:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(232, 65, 47, .12); }
.ui-switch-text strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.ui-switch-text span { font-size: 12.5px; color: var(--ui-muted); line-height: 1.4; font-weight: 400; }
.ui-switch { position: relative; flex: none; width: 44px; height: 26px; }
.ui-switch input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.ui-switch i {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 999px; background: #d2d0ce;
    transition: background-color .2s; pointer-events: none;
}
.ui-switch i::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.ui-switch input:checked + i { background: var(--ui-accent); }
.ui-switch input:checked + i::after { transform: translateX(18px); }

@media (prefers-reduced-motion: reduce) {
    .ui-switch i, .ui-switch i::after { transition: none; }
}

/* Поле значения с кнопкой «Копировать» (окно «Код для публикации»): input или textarea только для чтения */
.ui-copy { position: relative; }
.ui-copy .ui-input { padding-right: 52px; cursor: text; }
.ui-mono { font-family: var(--font-mono); font-size: 13px; color: #545454; }
textarea.ui-mono { min-height: 96px; line-height: 1.5; white-space: pre; overflow: auto; }
.ui-copy-btn {
    position: absolute; top: 5px; right: 6px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px;
    background: none; color: var(--ui-muted); display: grid; place-items: center; cursor: pointer;
    transition: background-color .15s, color .15s;
}
.ui-copy-btn:hover { background: var(--ui-btn-bg); color: var(--ui-text); }
.ui-copy-btn .ui-copy-off { display: none; }
.ui-copy-btn.copied { color: var(--ui-ok); }
.ui-copy-btn.copied .ui-copy-on { display: none; }
.ui-copy-btn.copied .ui-copy-off { display: block; }

/* Список кодов: подпись над полем, превью изображения */
.ui-code-item { margin-bottom: 16px; }
.ui-code-label { margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.ui-code-label.hot { color: var(--ui-danger); }
.ui-code-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 13.5px; color: var(--ui-muted); }
.ui-code-preview img { display: block; max-width: 120px; max-height: 90px; border-radius: 10px; border: 1px solid var(--ui-line); object-fit: cover; }
.ui-code-preview a { color: var(--ui-accent) !important; }

/* Блок кодов вне окна (страницы загрузки и просмотра): по центру, подписи слева; несколько изображений подряд разделены линией */
.ui-code { max-width: 720px; margin: 0 auto; text-align: left; }
.ui-code + .ui-code { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--ui-line); }
.ui-code-title { margin: 14px 0 16px; font-size: 15px; font-weight: 600; }

/* Компактное поле с копированием (ссылка в карточке альбома или подборки) */
.ui-copy-sm .ui-input { padding: 7px 38px 7px 10px; font-size: 12px; border-radius: 10px; }
.ui-copy-sm .ui-copy-btn { top: 3px; right: 4px; width: 30px; height: 30px; border-radius: 8px; }

/* Bootstrap 4.1 рисует тёмный контур у любой кнопки в фокусе (button:focus), он остаётся после клика мышью.
   Вне окон (страницы загрузки, просмотра, карточки) правило окон не действует, поэтому снимаем контур у самой кнопки;
   для клавиатуры (Tab) оставляем акцентный контур */
.ui-copy-btn:focus { outline: none; box-shadow: none; }
.ui-copy-btn:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 0; }
