/* ui.css — единые кнопки, поля, окна и заголовки для всех страниц.
   Подключается ПОСЛЕДНИМ (через tl_head), поэтому выравнивает вид элементов,
   которые исторически описаны в нескольких css-файлах по-разному.
   Цвета — только токены из dark_root.css. */

/* ---------- Кнопки ---------- */
.submit_button, .signup_button, .back_button, .search_button,
.submit_button_link, .signup_button_link, .back_button_link, .search_button_link {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease, background-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Высота «К-60» → 52px, «К-45» → 44px */
.submit_button, .signup_button, .back_button, .search_button { height: 52px; }
.submit_button_link, .signup_button_link, .back_button_link, .search_button_link { height: 44px; }

/* Главное действие: Войти, Сохранить, Далее, Отправить */
.submit_button, .submit_button_link, .submit_button_link:visited {
    background: var(--tl-magenta);
    color: #fff;
}
/* Регистрация — фирменный градиент */
.signup_button, .signup_button_link, .signup_button_link:visited {
    background: var(--tl-grad);
    color: #fff;
}
/* Второстепенное: Назад, Отмена */
.back_button, .back_button_link, .back_button_link:visited {
    background: var(--tl-surface-2);
    color: var(--tl-ink);
}
/* Нейтральное тёмное: Поиск, переходы */
.search_button, .search_button_link, .search_button_link:visited {
    background: var(--tl-ink);
    color: var(--tl-surface);
}

.submit_button:hover, .signup_button:hover, .search_button:hover,
.submit_button_link:hover, .signup_button_link:hover, .search_button_link:hover { filter: brightness(1.07); opacity: 1; }
.back_button:hover, .back_button_link:hover { background: var(--tl-surface-3); opacity: 1; }

.submit_button:active, .signup_button:active, .back_button:active, .search_button:active,
.submit_button_link:active, .signup_button_link:active, .back_button_link:active, .search_button_link:active { transform: scale(.98); }

.submit_button:disabled, .signup_button:disabled, .back_button:disabled, .search_button:disabled {
    opacity: .5;
    cursor: default;
    filter: none;
    transform: none;
}

.btn {
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    background: var(--tl-magenta);
}
.btn:hover { opacity: 1; filter: brightness(1.07); }

.button_menu_text a,
.button_menu_text a:visited { color: var(--tl-blue); text-decoration: underline; text-decoration-color: currentColor; }

/* ---------- Поля ввода ---------- */
.text_input, .text_input_c, .text_input_date, .text_input_resize {
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px; /* 16px — iOS не увеличивает страницу при фокусе */
    color: var(--tl-ink);
    background-color: var(--tl-surface-2);
    border: 1px solid transparent;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.text_input, .text_input_c, .text_input_date { height: 48px !important; }
.text_input_c { background-color: var(--tl-blue-soft); }

.text_input::placeholder, .text_input_c::placeholder,
.text_input_date::placeholder, .text_input_resize::placeholder { color: var(--tl-ink-3); opacity: 1; }

.text_input:focus, .text_input_c:focus, .text_input_date:focus, .text_input_resize:focus {
    outline: none;
    border-color: var(--tl-blue);
    background-color: var(--tl-surface);
    box-shadow: 0 0 0 3px var(--tl-blue-soft);
}

select.text_input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23868ca6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* ---------- Окна-карточки ---------- */
.window_f, .window_s {
    border-radius: var(--tl-r-l);
    border: 1px solid var(--tl-line);
    background: var(--tl-surface);
    box-shadow: var(--tl-shadow-1);
}

/* ---------- Заголовки страниц ---------- */
/* Подпись над заголовком (раздел) — обычным регистром, без разрядки */
.canvas_title_inner::before {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--tl-ink-3);
    margin-bottom: 6px;
}

.page-title {
    font-family: var(--tl-font-display);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.12;
    color: var(--tl-ink);
}

.page-title-big {
    font-family: var(--tl-font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--tl-ink);
    text-shadow: none;
}

.info-title {
    font-family: var(--tl-font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--tl-ink);
}

.info-text { color: var(--tl-ink-2); }

/* Ссылки в тексте форм (соглашение, «не помню пароль») */
.button_menu_text, .button_menu_text a { text-underline-offset: 3px; }

/* Крупные заголовки на страницах входа, регистрации, восстановления */
.page-title-big {
    font-size: clamp(30px, 8.4vw, 42px);
    max-width: 420px;
}

/* Заголовок страницы помощи */
.help-head h1 {
    font-family: var(--tl-font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.08;
    font-size: clamp(30px, 8.4vw, 42px);
    color: var(--tl-ink);
}
.help-head h1 span { display: block; }

.page-title { font-size: clamp(24px, 6.6vw, 30px); }

/* Кнопка-ссылка рядом с обычной кнопкой (Далее / Отмена) — одной высоты */
.button_menu:has(.submit_button, .signup_button, .back_button, .search_button) > .submit_button_link,
.button_menu:has(.submit_button, .signup_button, .back_button, .search_button) > .signup_button_link,
.button_menu:has(.submit_button, .signup_button, .back_button, .search_button) > .back_button_link,
.button_menu:has(.submit_button, .signup_button, .back_button, .search_button) > .search_button_link { height: 52px; }

/* Кнопка выбора места на карте (форма публикации) */
.button_activate_map,
.button_reset_map {
    height: 56px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
}
.button_activate_map:hover,
.button_reset_map:hover { opacity: 1; filter: brightness(1.07); }

/* Карточка сразу под заголовком страницы — без лишнего отступа сверху */
.canvas_title_inner + .window_s,
.canvas_title_inner + .window_f { margin-top: 0; }
