* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Светлая тема по умолчанию: WebView (в т.ч. Max) не должен тянуть «тёмный» chrome и forced-dark */
html {
  color-scheme: light only;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #333333;
  color-scheme: light only;
}

@media (prefers-color-scheme: dark) {
  html,
  body {
    color-scheme: light only;
  }

  body,
  .page,
  .page-web-bot {
    background: #ffffff !important;
    color: #333333 !important;
  }

  .subtitle,
  .web-bot-subtitle {
    color: #666666 !important;
  }

  .field label {
    color: #7a7a7a !important;
  }

  .field input,
  .field textarea,
  .field select {
    background: #ffffff !important;
    color: #333333 !important;
    border-bottom-color: #c4c4c4 !important;
  }

  .form-back-link {
    background: #d4d8de !important;
    color: #000000 !important;
  }
}

.page {
  width: 100%;
  max-width: 420px;            
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Десктоп / ноутбуки */
@media (min-width: 1024px) {
  body {
    background: #ffffff;
  }

  .page {
    max-width: 1920px;           
    padding: 40px 40px 60px;

    /* ✨ Новое — адаптация по высоте экрана */
    min-height: 100vh;           /* страница не ниже высоты окна */
    display: flex;
    flex-direction: column;      /* если нужно, чтобы низ "прилипал" к низу */
  }
}

.logo-wrap-special {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 64px; /* уменьшено с 48px */
}

h1 {
  font-size: 26px;
  margin: 0 0 8px;
  font-weight: 700;
}

.subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
}

/* Назад (стрелка) рядом с описанием под заголовком формы */
.subtitle-with-back {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.subtitle-with-back .subtitle {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.form-back-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d4d8de;
  color: #000000;
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s ease, transform 0.05s ease;
}

.form-back-link:hover {
  background: #c5cbd3;
  color: #000000;
}

.form-back-link:active {
  background: #b5bcc5;
  transform: scale(0.96);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12px;
  color: #7a7a7a;
  margin-bottom: 4px;
}

.field input,
.field textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid #c4c4c4;
  padding: 6px 0;
  font-size: 14px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 60px;
}

.submit-wrap {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.submit-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: #942f05;
  color: #ffffff;
  font-size: 24px;
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.submit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.logo-img-special {
  width: auto;
  height: 48px;               /* фиксированная высота вместо max-width */
  object-fit: contain;
}

/* Текстовый логотип (если используется) */
.logo-special {
  font-weight: 800;
  font-size: 22px;            /* уменьшено с 40px */
  letter-spacing: 1px;
  margin-bottom: 16px;
  text-transform: uppercase;
  line-height: 1.1;
}

/* Мобильная версия */
@media (max-width: 480px) {
  .logo-wrap-special {
    margin-bottom: 24px;
  }

  .logo-img-special {
    height: 40px;             /* чуть меньше на мобильном */
  }

  .logo-special {
    font-size: 18px;
  }
}

/* Заголовки блоков */
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin: 0 0 12px;
}

.section-title-top {
  margin-top: 28px;
}

/* Ссылка "Добавить ещё" */
.add-phone-row {
  margin: -6px 0 12px;
}

.add-phone-link {
  font-size: 13px;
  color: #942f05;
  text-decoration: none;
}

.add-phone-link:hover {
  text-decoration: underline;
}

/* Селект, чекбокс, кнопка */
.field select {
  width: 100%;
  border: none;
  border-bottom: 1px solid #c4c4c4;
  padding: 6px 0;
  font-size: 14px;
  background: transparent;
  outline: none;
}

.checkbox-row {
    display: flex;
    align-items: center;
    margin-top: 24px;
    font-size: 14px;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Скрытый нативный чекбокс */
.checkbox-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

/* Видимая коробочка */
.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid #942f05;
    border-radius: 4px;
    flex: 0 0 22px;
    margin-right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.15s ease;
}

/* Галочка */
.checkbox-row input[type="checkbox"]:checked + .checkbox-custom::after {
    content: "✓";
    color: #942f05;
    font-size: 16px;
    font-weight: bold;
}

.submit-wrap {
  margin-top: 32px;
  display: flex;
  justify-content: center; /* центрируем */
}

/* Сама кнопка */
.submit-btn {
  width: 100%;
  max-width: 260px;           /* оптимальная ширина */
  background: #942f05;
  color: #fff;
  border: none;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;         /* небольшой радиус */
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: 0.15s ease;
}

.submit-btn:hover {
  opacity: 0.92;
}

.submit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.dual-columns {
  display: flex;
  gap: 48px;
  width: 100%;
  margin-top: 24px;
}

.dual-columns .column {
  width: 50%;
}

/* Поля внутри колонок — чуть крупнее */
.dual-columns .field input,
.dual-columns .field textarea,
.dual-columns .field select {
  font-size: 15px;
  padding: 8px 0;
}

/* На мобильных — обратно в одну колонку */
@media (max-width: 1023px) {
  .dual-columns {
    flex-direction: column;
    gap: 16px;
  }

  .dual-columns .column {
    width: 100%;
  }
}

.form-validated .field.invalid input,
.form-validated .field.invalid textarea,
.form-validated .field.invalid select {
    border-bottom: 2px solid #942f05 !important;
}

/* Текст ошибки */
.error-message {
    color: #942f05;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

/* Показываем сообщение */
.field.invalid .error-message {
    display: block;
}

.inline-link {
  color: #942f05;
  text-decoration: underline;
  cursor: pointer;
}

.inline-link:hover {
  text-decoration: none;
}

/* Фон модального окна */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

/* Активное состояние модалки */
.modal-backdrop.active {
  display: flex;
}

/* Сама модалка */
.modal {
  background: #ffffff;
  border-radius: 8px;
  max-width: 520px;
  width: calc(100% - 32px);
  padding: 24px 20px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Заголовок в модалке */
.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Текст в модалке */
.modal-text {
  font-size: 13px;
  line-height: 1.5;
  color: #444;
  max-height: 60vh;
  overflow-y: auto;
}

/* Кнопка закрытия */
.modal-close {
  margin-top: 18px;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  border: none;
  background: #942f05;
  color: #ffffff;
  cursor: pointer;
  float: right;
}

.modal-close:active {
  transform: translateY(1px);
}

.modal-link {
    color: #942f05;
    text-decoration: underline;
}

.modal-link:hover {
    text-decoration: none;
}

.custom-select {
  position: relative;
  width: 100%;
  border-bottom: 1px solid #c4c4c4;
  padding: 4px 0;
}

/* Нативный select — остаётся для формы, но визуально скрыт */
.custom-select select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* Отображаемое значение */
.custom-select__display {
  font-size: 14px;
  padding: 4px 24px 4px 0;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Когда выбран реальный вариант */
.custom-select.has-value .custom-select__display {
  color: #333;
}

/* Стрелочка */
.custom-select::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-35%);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: #942f05 transparent transparent transparent;
  pointer-events: none;
}

/* Выпадающий список */
.custom-select__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.16);
  padding: 4px 0;
  z-index: 50;
  display: none;
  max-height: none;
  overflow: visible;
}

/* Открытое состояние */
.custom-select.open .custom-select__dropdown {
  display: block;
}

/* Пункты списка */
.custom-select__option {
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.custom-select__option:hover {
  background: rgba(0,0,0,0.03);
}

/* Выбранный пункт */
.custom-select__option.selected {
  background: rgba(148, 47, 5, 0.1);
}

/* Чуть крупнее на десктопе */
@media (min-width: 1024px) {
  .custom-select__display {
    font-size: 15px;
    padding: 6px 28px 6px 0;
  }
}

/* Ошибка для селекта — как у остальных полей */
.form-validated .field.invalid .custom-select {
  border-bottom: 2px solid #942f05 !important;
}

.checkbox-row.invalid-consent .checkbox-custom {
  border-color: #942f05;
}

.checkbox-row.invalid-consent span {
  color: #942f05;
}

/* ===========================
   ВЕБ-ВЕРСИЯ БОТА (стиль inline-кнопок Telegram, светлая тема)
   =========================== */

.page-web-bot {
  max-width: 1120px;
  /* фиксированная панель внизу (1–3 кнопки; на узком экране может переноситься) */
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0));
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .page-web-bot {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0));
  }
}

.web-bot-title {
  text-align: center;
  margin-bottom: 4px;
  font-size: 20px;
}

.web-bot-subtitle {
  text-align: center;
  margin-bottom: 16px;
  color: #707579;
  font-size: 14px;
  line-height: 1.35;
}

.web-bot-content {
  margin-top: 8px;
}

/* Клавиатура: одна колонка, ширина как у блока кнопок в чате */
.web-bot-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

/* Опционально: несколько кнопок в ряд (как в Telegram) */
.web-bot-grid--row {
  flex-direction: row;
  flex-wrap: wrap;
}

.web-bot-grid--row .web-bot-card {
  flex: 1 1 calc(50% - 3px);
  min-width: 0;
}

/* Карточка меню ≈ inline-кнопка Telegram */
.web-bot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px 11px;
  background: #d4d8de;
  border-radius: 10px;
  border: none;
  box-shadow: none;
  text-decoration: none;
  color: #000000;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.1s ease, transform 0.05s ease;
}

.web-bot-card h2 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 4px;
  color: #000000;
}

.web-bot-card p {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  color: #707579;
  margin: 0;
  max-width: 100%;
}

.web-bot-card:hover {
  background: #c5cbd3;
}

.web-bot-card:active {
  background: #b5bcc5;
  transform: scale(0.98);
}

/* «Позвонить» — акцент в духе ссылок Telegram */
.web-bot-card-phone {
  background: #cdd9e8;
}

.web-bot-card-phone:hover {
  background: #bacfe0;
}

.web-bot-card-phone:active {
  background: #a8c3d8;
}

.web-bot-card-phone h2,
.web-bot-card-phone p {
  color: #2481cc;
}

/* Недоступный пункт меню (нет файла / ссылки) */
.web-bot-card-disabled {
  cursor: default;
  opacity: 0.72;
  pointer-events: none;
}

.web-bot-card-disabled:hover,
.web-bot-card-disabled:active {
  background: #d4d8de;
  transform: none;
}

@media (max-width: 480px) {
  .web-bot-grid {
    max-width: 100%;
    padding: 0 4px;
  }

  .web-bot-card {
    min-height: 42px;
    padding: 9px 12px 10px;
    border-radius: 9px;
  }

  .web-bot-card h2 {
    font-size: 14px;
    margin-bottom: 0;
  }

  /* На мобильных только заголовок кнопки, без описания (как в Telegram) */
  .web-bot-card p {
    display: none;
  }
}

.web-bot-back {
  margin-bottom: 12px;
}

.web-bot-back a {
  font-size: 13px;
}

.web-bot-filters {
  margin-bottom: 20px;
}

.web-bot-filters-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .web-bot-filters-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.web-bot-filters .field select {
  width: 100%;
}

.web-bot-filters-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* Кнопка действия в блоке фильтров — как основная кнопка в Telegram */
.page-web-bot .web-bot-filters .submit-btn {
  max-width: 420px;
  width: 100%;
  background: #2a7ad4;
  color: #ffffff;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  padding: 12px 16px;
  box-shadow: none;
  border: none;
}

.page-web-bot .web-bot-filters .submit-btn:hover {
  background: #256fc2;
  opacity: 1;
}

.page-web-bot .web-bot-filters .submit-btn:active {
  background: #2063b0;
  transform: scale(0.99);
}

.web-bot-premises-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.web-bot-premise-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.web-bot-premise-card--clickable {
  cursor: pointer;
}

.web-bot-premise-card--clickable:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Клик по карточке ведёт на заявку; кнопка сайта — отдельный блок под ссылкой */
.web-bot-premise-card-body {
  display: block;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.web-bot-premise-card-body:hover .web-bot-premise-park {
  color: #2481cc;
}

.web-bot-premise-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.web-bot-premise-park {
  font-weight: 600;
}

.web-bot-premise-meta {
  font-size: 13px;
  color: #666666;
  display: flex;
  gap: 12px;
}

.web-bot-premise-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.web-bot-premise-label {
  font-size: 12px;
  color: #888888;
  margin-bottom: 2px;
}

.web-bot-premise-value {
  font-size: 14px;
}

.web-bot-premise-scheme {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.web-bot-premise-scheme--in-body .web-bot-premise-scheme-img {
  margin-bottom: 0;
}

.web-bot-premise-card-footer {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.web-bot-premise-site-btn {
  display: block;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  text-align: center;
  padding: 11px 14px;
  border-radius: 10px;
  background: #d4d8de;
  color: #000000;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s ease, transform 0.05s ease;
}

.web-bot-premise-site-btn:hover {
  background: #c5cbd3;
}

.web-bot-premise-site-btn:active {
  background: #b5bcc5;
  transform: scale(0.99);
}

.web-bot-premise-scheme-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  object-position: center top;
  background: #f4f5f7;
  border-radius: 8px;
  margin-bottom: 6px;
}

.web-bot-premise-scheme-img--lead {
  max-height: 320px;
}

.web-bot-premise-summary-scheme {
  margin: 10px 0 14px;
}

/* Заявка на просмотр: ссылка на icpark.ru в новом окне/браузере */
.web-bot-premise-lead-site-btn {
  display: block;
  max-width: 420px;
  width: 100%;
  margin: 0 auto 16px;
  box-sizing: border-box;
  text-align: center;
  padding: 11px 14px;
  border-radius: 10px;
  background: #d4d8de;
  color: #000000;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s ease, transform 0.05s ease;
}

.web-bot-premise-lead-site-btn:hover {
  background: #c5cbd3;
}

.web-bot-premise-lead-site-btn:active {
  background: #b5bcc5;
}

.web-bot-pagination {
  margin-top: 16px;
  margin-bottom: 12px;
  padding-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 16px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .web-bot-pagination {
    margin-bottom: 20px;
    padding-bottom: 28px;
  }
}

.web-bot-page-indicator {
  color: #666666;
}

.web-bot-empty {
  margin-top: 16px;
  font-size: 14px;
  color: #666666;
}

.web-bot-premise-summary {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 14px;
  line-height: 1.45;
}

.web-bot-premise-summary-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.web-bot-premise-summary p {
  margin: 0.35em 0;
}

.page-web-bot .web-bot-premise-lead-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  font: inherit;
  resize: vertical;
}

.web-bot-back-fixed {
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(to top, rgba(255, 255, 255, 0.98), rgba(247, 248, 250, 0.96));
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* «Назад» как серая inline-кнопка Telegram на всю ширину полосы */
.web-bot-back-btn {
  display: block;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 11px 14px;
  border-radius: 10px;
  background: #d4d8de;
  color: #000000;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s ease, transform 0.05s ease;
}

.web-bot-back-btn:hover {
  background: #c5cbd3;
  color: #000000;
}

.web-bot-back-btn:active {
  background: #b5bcc5;
  transform: scale(0.99);
}

/* Две кнопки: «Назад» (на уровень выше) + «В главное меню» — для разделов 3+ уровня */
.web-bot-back-bar {
  display: flex;
  gap: 8px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  align-items: stretch;
}

.web-bot-back-bar .web-bot-back-btn {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 11px 10px;
  font-size: 14px;
}

@media (max-width: 360px) {
  .web-bot-back-bar .web-bot-back-btn {
    font-size: 13px;
    padding: 11px 8px;
  }
}

.web-bot-filters-count {
  font-size: 13px;
  color: #666666;
}

.web-bot-select-wrap {
  position: relative;
}

.web-bot-select-wrap select {
  width: 100%;
  border: none;
  border-bottom: 2px solid #d9d9d9;
  padding: 6px 28px 6px 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
}

.web-bot-select-wrap::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  margin-top: -3px;
  border-width: 6px 4px 0 4px;
  border-style: solid;
  border-color: #942f05 transparent transparent transparent;
  pointer-events: none;
}

/* Страница «О компании» web-indu */
.indu-about-text p {
  margin: 0.5em 0;
  font-size: 14px;
  line-height: 1.45;
}

.indu-about-text p:first-child {
  margin-top: 0;
}

.indu-about-text p:last-child {
  margin-bottom: 0;
}

a.indu-about-tel {
  text-decoration: none;
}

a.indu-about-tel:hover {
  text-decoration: underline;
}
