/* ===========================================================================
   Взгляд Тверь — общие стили
   Сброс, контейнер, заголовок секции, кнопки. Общие для всех шаблонов.
   =========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  font: var(--font-body);
  color: var(--color-text);
  background: var(--color-light);
}

h1, h2, h3, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
}

button {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

address {
  font-style: normal;
}

.container {
  width: var(--container-fluid);
  margin-inline: auto;
}

/* Заголовок секции: телефон 22 (Мобильный/H2), планшет и ПК 30 */
.section-title {
  font: var(--font-h2-m);
}

@media (min-width: 46.5em) {
  .section-title {
    font: var(--font-h2);
  }
}

.section-title--brand {
  color: var(--color-brand);
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-light);
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--gradient);
  border-radius: var(--radius-small);
}

.btn--small {
  padding: 0.5rem 1.5rem;
  font: var(--font-button-small);
}

.btn--large {
  width: 18.75rem;
  max-width: 100%;
  height: 3rem;
  padding: 1rem 2.5rem;
  font: var(--font-button);
}

/* Обводка в Figma внутренняя — в CSS вычитаю 1px из отступа */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid;
  border-radius: var(--radius-small);
}

.btn-outline--light {
  padding: 0.5625rem 2.3125rem;
  font: var(--font-button);
  color: var(--color-light);
  text-transform: uppercase;
  border-color: var(--color-light);
}

.btn-outline--dark {
  padding: 0.4375rem 1.9375rem;
  font: var(--font-button-small);
  color: var(--color-text);
  text-transform: uppercase;
  border-color: var(--color-text);
  opacity: 0.75;
}

.btn-outline--doctor {
  width: 8.625rem;
  padding-block: 0.4375rem;
  font: var(--font-small);
  color: var(--color-text);
  border-color: var(--color-text);
  opacity: 0.8;
}

/* Состояния кнопок — UI-Kit: Hover / Active / Disabled */
.btn--small:active {
  font: var(--font-button-small-hover);
  background: var(--gradient-reverse);
}

@media (any-hover: hover) {
  .btn--small:hover {
    font: var(--font-button-small-hover);
    background: var(--gradient-reverse);
  }
}

@media (any-hover: hover) {
  .btn--small:hover {
    filter: var(--shadow-button);
  }
}

.btn--large:active {
  font: var(--font-button-hover);
  background: var(--gradient-reverse);
}

@media (any-hover: hover) {
  .btn--large:hover {
    font: var(--font-button-hover);
    background: var(--gradient-reverse);
  }
}

.btn:disabled,
.btn--disabled {
  font-weight: 500;
  background: var(--color-inactive);
  filter: none;
  cursor: default;
}

.btn-outline--light:active {
  color: var(--color-text);
  background: var(--color-light);
}

@media (any-hover: hover) {
  .btn-outline--light:hover {
    color: var(--color-text);
    background: var(--color-light);
  }
}

.btn-outline--dark:active {
  font: var(--font-button-small-hover);
  color: var(--color-light);
  background: var(--gradient);
  border-color: transparent;
  opacity: 1;
}

@media (any-hover: hover) {
  .btn-outline--dark:hover {
    font: var(--font-button-small-hover);
    color: var(--color-light);
    background: var(--gradient);
    border-color: transparent;
    opacity: 1;
  }
}

.btn-outline--dark:active {
  background: var(--gradient-reverse);
}

.btn-outline--doctor:active {
  color: var(--color-light);
  background: var(--gradient);
  border-color: transparent;
}

@media (any-hover: hover) {
  .btn-outline--doctor:hover {
    color: var(--color-light);
    background: var(--gradient);
    border-color: transparent;
  }
}

/* ---------- Плавные переходы при наведении и нажатии ----------
   В макете длительности нет; 0,2 с — обычное значение. Кто отключил анимацию в системе, видит смену сразу. */
@media (prefers-reduced-motion: no-preference) {
  a,
  button,
  input,
  textarea,
  [class*="card"],
  [class*="btn"] {
    transition: color 0.2s, background-color 0.2s, border-color 0.2s, opacity 0.2s, box-shadow 0.2s, filter 0.2s;
  }

  html {
    scroll-behavior: smooth;
  }
}

/* ---------- Фокус с клавиатуры ----------
   Видимая рамка у всего, на что можно перейти клавишей Tab; при нажатии мышью рамки нет (:focus-visible). */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* якорь (#reviews, #faq) не прячется под закреплённой шапкой */
[id] {
  scroll-margin-top: 6rem;
}

/* номер телефона не разрывается на две строки */
a[href^="tel:"] {
  white-space: nowrap;
}

/* ---------- Служебное ---------- */

/* iOS в альбомной ориентации не увеличивает текст сам; полоса прокрутки (Windows) зарезервирована —
   страница не сдвигается вбок, когда окно или меню запрещает прокрутку */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

/* Широкие экраны (правки дизайнера 18.10.26, п. 1): шире 1440 вся страница растёт пропорционально, как макет ПК —
   1rem = 1/90 ширины окна, до 1920 (1rem = 21.33px); дальше поля по бокам. Вёрстка вся в rem, поэтому растёт целиком.
   Нижняя граница — 100%: увеличенный шрифт в настройках браузера не уменьшается. */
@media (min-width: 90.0625em) {
  html {
    font-size: clamp(100%, 1.1111vw, 133.333%);
  }
}

/* скрыто с экрана, но читается экранным диктором (подписи полей, пояснения) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* «Перейти к содержимому» — первая ссылка страницы, видна только при переходе клавишей Tab */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 300;
  padding: 0.75rem 1rem;
  font: var(--font-menu);
  color: var(--color-light);
  background: var(--color-text);
  border-radius: var(--radius-small);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* кнопки: двойное нажатие не выделяет текст; выключенная кнопка не ловит нажатия */
.btn,
.btn-outline,
.btn-more {
  -webkit-user-select: none;
  user-select: none;
}

.btn:disabled {
  pointer-events: none;
}

/* цифры цен одной ширины — столбец ровный */
.price-table td:last-child {
  font-variant-numeric: tabular-nums;
}

/* ---------- Текст из редактора MODX (статьи, «Согласие», «Политика», описание услуги) ----------
   Оборачивать содержимое поля в .text-content: списки с маркерами, отступы между абзацами, картинки не шире колонки. */
.text-content > * + * {
  margin-top: 1rem;
}

.text-content h2 {
  margin-top: 2.5rem;
  font: var(--font-h2-m);
}

.text-content h3 {
  margin-top: 2rem;
  font: var(--font-h3-m);
}

.text-content ul,
.text-content ol {
  padding-left: 1.5rem;
}

.text-content ul {
  list-style: disc;
}

.text-content ol {
  list-style: decimal;
}

.text-content li + li {
  margin-top: 0.5rem;
}

.text-content a {
  color: var(--color-brand-text);
  text-decoration: underline;
  text-underline-position: from-font;
}

.text-content blockquote {
  padding-left: 1.5rem;
  font: var(--font-accent);
  font-style: italic;
  border-left: 4px solid var(--color-brand);
}

.text-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.text-content table {
  width: 100%;
  border-collapse: collapse;
}

.text-content th,
.text-content td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-line);
}

@media (min-width: 80em) {
  .text-content h2 {
    font: var(--font-h2);
  }

  .text-content h3 {
    font: var(--font-h3);
  }
}

/* кнопка на время отправки формы: текст скрыт, крутится кольцо, повторное нажатие не срабатывает */
.btn--loading {
  position: relative;
  color: transparent !important;
}

.btn--loading::after {
  content: '';
  position: absolute;
  top: calc(50% - 0.625rem);
  left: calc(50% - 0.625rem);
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-light);
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}

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

.btn--loading:disabled {
  background: var(--gradient);
}
