/* ==========================================================================
   Чекбокс согласия на обработку ПДн — единый вид для форм сайта.

   ПРИНЦИП ЦВЕТА: текст согласия НЕ перекрашивается этим файлом. Он обёрнут в
   <span class="consent-text <ИСХОДНЫЙ_КЛАСС>"> (text-muted / politic-text), где
   <ИСХОДНЫЙ_КЛАСС> — класс старой надписи в этом же месте. Поэтому цвет, шрифт и
   цвет ссылки берутся из существующих правил сайта и в ТОЧНОСТИ совпадают с тем,
   что было до изменения (например на калькуляторе text-muted = белый).

   Этот файл задаёт только: раскладку (флекс), сам чекбокс (адаптивно к цвету
   текста через currentColor) и КРАСНЫЙ цвет сообщения об ошибке.
   ========================================================================== */

.consent-group {
  margin: 12px 0 16px;
}

/* Раскладка: чекбокс слева, текст справа. Цвет/шрифт НЕ задаём — наследуются. */
.consent-label {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  margin: 0 !important;        /* гасим #calc-new .calc #gruz label{margin-left:1rem} */
  font-weight: inherit;
  cursor: pointer;
}

/* Сам чекбокс. Граница и галочка — currentColor, т.е. цвет окружающего текста:
   на светлых формах тёмный, на тёмном калькуляторе белый — всегда виден.
   !important нужен, т.к. на калькуляторе нативные чекбоксы прячут правилом
   #calc-new .calc #gruz … input[type=checkbox]{position:absolute;left:-9999px}. */
.consent-label input[type="checkbox"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  flex: 0 0 auto !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 1px 0 0 !important;
  padding: 0 !important;
  border: 1px solid currentColor !important;
  border-radius: 3px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
}

/* Отмеченное состояние — галочка цветом текста (currentColor), без заливки:
   читается на любом фоне. */
.consent-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-label .consent-text {
  flex: 1 1 auto;
  /* На калькуляторе общее правило "…form-group label span{opacity:.7}" дублирует
     текст согласия → белый выглядел серым. Возвращаем полную непрозрачность. */
  opacity: 1 !important;
}

/* На калькуляторе (#calc-new) то же правило "label span" задаёт 14px вместо
   мелкого 12px, как у дисклеймера рядом. Приводим текст согласия к 12px/300. */
#calc-new .consent-label .consent-text {
  font-size: 12px !important;
  font-weight: 300 !important;
  line-height: 1.4 !important;
}

/* Тёмный фон (калькуляторы #015B2C/#235C33, «Обратная связь» на фото): сам
   ЧЕКБОКС делаем белым (currentColor берёт цвет <label>, а он тут тёмный —
   рамка сливалась бы с фоном). Цвет ТЕКСТА при этом не трогаем. */
.calc .consent-label input[type="checkbox"],
.blanket-order .consent-label input[type="checkbox"] {
  border-color: #fff !important;
}
.calc .consent-label input[type="checkbox"]:checked::after,
.blanket-order .consent-label input[type="checkbox"]:checked::after {
  border-color: #fff;
}

/* Сообщение об ошибке — всегда КРАСНОЕ (в т.ч. на тёмном калькуляторе, где
   .help-block-error по умолчанию розоватый). */
.consent-group .help-block,
.consent-group .help-block-error {
  margin: 4px 0 0 !important;
  color: #ff3b30 !important;
  font-size: 12px;
}
