/* ================== ЧИСТО: ГАЛЕРЕЯ + ЛАЙТБОКС ================== */

/* Сетка: 3 колонки, аккуратные промежутки */
.uc-cert-gallery {
  width: 100%;
}
.uc-cert-gallery .uc-cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;       /* можно 1400/1600, если хочешь крупнее */
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0 16px;         /* небольшой внутренний отступ по краям */
}

/* Карточка: держит миниатюру и подпись вместе */
.uc-cert-gallery .uc-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Миниатюра: контейнер фиксированной «разумной» высоты, картинка вписана целиком */
.uc-cert-gallery .uc-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  height: 300px;           /* НЕ огромная; подними до 340–380 при желании */
  overflow: hidden;
  text-decoration: none;
}
.uc-cert-gallery .uc-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;     /* показываем картинку целиком, без обрезки */
  display: block;
}

/* Подпись: всегда под миниатюрой, никогда не «справа» */
.uc-cert-gallery .uc-caption {
  margin-top: 8px;
  text-align: center;
  font-family: "TildaSans", sans-serif;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.2;
  color: #333;
}

/* ---------- Лайтбокс (на :target) ---------- */
.uc-cert-gallery .uc-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 2vw;
}
.uc-cert-gallery .uc-lightbox:target { display: flex; }

.uc-cert-gallery .uc-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  position: relative;
  z-index: 2;
}

/* Фон — клик для закрытия */
.uc-cert-gallery .uc-dismiss {
  position: fixed;
  inset: 0;
  display: block;
  content: "";
  z-index: 1;
}

/* Стрелки: кликаются только круглые кнопки */
.uc-cert-gallery .uc-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
}
.uc-cert-gallery .uc-prev { left: 16px; }
.uc-cert-gallery .uc-next { right: 16px; }
.uc-cert-gallery .uc-nav::after {
  content: "›";
  font-size: 42px;
  line-height: 1;
  color: #fff;
  background: rgba(0,0,0,.35);
  width: 48px; height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  user-select: none;
}
.uc-cert-gallery .uc-prev::after { content: "‹"; }

/* Якорь закрытия — чтобы не прыгало к началу страницы */
#uc-close {
  display: block;
  height: 1px;
  margin-top: -1px;
  visibility: hidden;
}
/* Если есть фиксированный хедер — подстрой отступ */
:target { scroll-margin-top: 80px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1200px) {
  .uc-cert-gallery .uc-cert-grid { max-width: 100%; }
}
@media (max-width: 1024px) {
  .uc-cert-gallery .uc-cert-grid { grid-template-columns: repeat(2, 1fr); }
  .uc-cert-gallery .uc-thumb { height: 280px; }
}
@media (max-width: 640px) {
  .uc-cert-gallery .uc-cert-grid { grid-template-columns: 1fr; padding: 0 12px; }
  .uc-cert-gallery .uc-thumb { height: 320px; }
  .uc-cert-gallery .uc-nav::after { width: 56px; height: 56px; font-size: 48px; }
  .uc-cert-gallery .uc-prev { left: 12px; } .uc-cert-gallery .uc-next { right: 12px; }
}

/* ==== Карточки для вертикальных сертификатов ==== */
.uc-cert-gallery .uc-card-portrait .uc-thumb {
  height: 480px;               /* выше рамка для «книжной» ориентации */
}

.uc-cert-gallery .uc-card-portrait .uc-thumb img {
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ==== ТОЧЕЧНО: форма #rec1318069381 — компактные интервалы ==== */

/* Меньше зазоры между всеми полями формы */
#rec1318069381 .t-form .t-form__inputsbox{
  row-gap: 6px !important;
  column-gap: 12px !important;
}
#rec1318069381 .t-form .t-input-group{
  margin: 4px 0 !important;
  padding: 0 !important;
}
#rec1318069381 .t-form .t-input-title{
  margin: 0 0 4px !important;
}

/* Компактные поля ввода */
#rec1318069381 .t-form input[type="text"],
#rec1318069381 .t-form input[type="email"],
#rec1318069381 .t-form input[type="tel"],
#rec1318069381 .t-form select,
#rec1318069381 .t-form .t-input,
#rec1318069381 .t-form .t-select{
  height: 40px !important;
  padding: 8px 12px !important;
}

/* ===== САМОЕ ГЛАВНОЕ: три чекбокса внизу — сжать интервалы ===== */
#rec1318069381 .t-form .t-input-group_cb{
  margin: 4px 0 !important;       /* было большим — делаем компактно */
  padding: 0 !important;
  line-height: 1.3 !important;
}

/* текст у чекбоксов: размер 14px, без внутренних отступов и абзацных маргинов */
#rec1318069381 .t-form .t-input-group_cb label,
#rec1318069381 .t-form .t-input-group_cb .t-checkbox,
#rec1318069381 .t-form .t-input-group_cb .t-checkbox__label,
#rec1318069381 .t-form .t-input-group_cb .t-checkbox__labeltext,
#rec1318069381 .t-form .t-input-group_cb span,
#rec1318069381 .t-form .t-input-group_cb p,
#rec1318069381 .t-form .t-input-group_cb a{
  font-size: 14px !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* выстраиваем галочку и текст в одну строку, минимальный зазор */
#rec1318069381 .t-form .t-input-group_cb .t-checkbox,
#rec1318069381 .t-form .t-input-group_cb label{
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;            /* расстояние между галкой и текстом */
}
#rec1318069381 .t-form .t-input-group_cb input[type="checkbox"]{
  margin: 2px 0 0 0 !important;   /* выравниваем по первой строке текста */
}

/* убираем «пустые» отступы между самими строками согласий */
#rec1318069381 .t-form .t-input-group_cb + .t-input-group_cb{
  margin-top: 4px !important;
}

/* кнопку поджимаем к чекбоксам */
#rec1318069381 .t-form .t-form__submitbox{
  margin-top: 8px !important;
}
/* === ЧЕКБОКС С ТЕКСТОМ В ОДНОЙ СТРОКЕ — ТОЛЬКО ДЛЯ #rec1318069381 === */

/* Делаем контейнер чекбокса строчным флексом: галочка слева, текст справа */
#rec1318069381 .t-form .t-input-group_cb label,
#rec1318069381 .t-form .t-input-group_cb .t-checkbox{
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 8px !important;              /* расстояние между галочкой и текстом */
  width: 100% !important;
}

/* Сама галочка — фиксированная, без растяжения, не переносится на новую строку */
#rec1318069381 .t-form .t-input-group_cb input[type="checkbox"]{
  flex: 0 0 auto !important;
  width: 16px !important;
  height: 16px !important;
  margin: 2px 0 0 0 !important;     /* выравнивание по первой строке текста */
}

/* Любые текстовые обёртки у чекбокса — только inline, без лишних отступов */
#rec1318069381 .t-form .t-input-group_cb .t-checkbox__label,
#rec1318069381 .t-form .t-input-group_cb .t-checkbox__labeltext,
#rec1318069381 .t-form .t-input-group_cb span,
#rec1318069381 .t-form .t-input-group_cb p,
#rec1318069381 .t-form .t-input-group_cb a{
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;      /* плотная межстрочка */
  font-size: 14px !important;       /* как просила */
}

/* Если Tilda вставила , убираем переносы строки */
#rec1318069381 .t-form .t-input-group_cb br{
  display: none !important;
}

/* Сжимаем вертикальные зазоры между самими строками согласий */
#rec1318069381 .t-form .t-input-group_cb{
  margin: 4px 0 !important;         /* общий отступ чекблока сверху/снизу */
  padding: 0 !important;
}
#rec1318069381 .t-form .t-input-group_cb + .t-input-group_cb{
  margin-top: 4px !important;       /* между соседними — минимально */
}
/* === #rec1318069381 — чекбоксы: галка слева, текст в той же строке, плотные интервалы === */

/* 1) Делаем контейнер чекбокса строчным флексом (покрываем все варианты разметки Тильды) */
#rec1318069381 .t-input-group_cb .t-checkbox,
#rec1318069381 .t-input-group_cb label,
#rec1318069381 .t-input-group_cb .t-checkbox__label,
#rec1318069381 .t-input-group_cb .t-checkbox__wrapper,
#rec1318069381 .t-input-group_cb .t-checkbox__control{
  display:flex !important;
  flex-direction:row !important;
  align-items:flex-start !important;
  gap:8px !important;            /* расстояние между галкой и текстом */
  flex-wrap:nowrap !important;
  width:100% !important;
}

/* 2) Сама галочка — фикс. размер, не «прыгает» на отдельную строку */
#rec1318069381 .t-input-group_cb input[type="checkbox"],
#rec1318069381 .t-input-group_cb .t-checkbox__input{
  flex:0 0 auto !important;
  width:16px !important;
  height:16px !important;
  margin:2px 0 0 0 !important;   /* выравниваем по первой строке текста */
  position:static !important;
}

/* Если используется индикатор галочки — фиксируем и его */
#rec1318069381 .t-input-group_cb .t-checkbox__indicator{
  flex:0 0 16px !important;
  width:16px !important;
  height:16px !important;
  margin:2px 0 0 0 !important;
}

/* 3) Текст рядом с галкой — инлайн, без абзацных отступов, компактная межстрочка */
#rec1318069381 .t-input-group_cb .t-checkbox__labeltext,
#rec1318069381 .t-input-group_cb .t-checkbox__text,
#rec1318069381 .t-input-group_cb span,
#rec1318069381 .t-input-group_cb p,
#rec1318069381 .t-input-group_cb a{
  display:inline !important;
  font-size:14px !important;
  line-height:1.25 !important;
  margin:0 !important;
  padding:0 !important;
}

/* 4) Убираем случайные переносы */
#rec1318069381 .t-input-group_cb br{ display:none !important; }

/* 5) Плотные вертикальные интервалы между тремя строками согласий */
#rec1318069381 .t-input-group_cb{ margin:4px 0 !important; padding:0 !important; }
#rec1318069381 .t-input-group_cb + .t-input-group_cb{ margin-top:4px !important; }

/* 6) Если зазор «живёт» в гриде формы — поджимаем и его */
#rec1318069381 .t-form__inputsbox{ row-gap:4px !important; }

/* 7) Кнопку ближе к согласиям */
#rec1318069381 .t-form__submitbox{ margin-top:8px !important; }

 row-gap */
#rec1318069381 .t-form__inputsbox{ row-gap: 4px !important; }

/* === BF204N: чекбокс слева, текст справа в одной строке — только в блоке с классом .consents-inline === */

/* Любой элемент карточки, внутри которого есть чекбокс — превращаем в строку */
.consents-inline [class*="t-card"] *:has(input[type="checkbox"]) {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 8px !important;                  /* расстояние между галочкой и текстом */
  flex-wrap: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Сам чекбокс — фиксированного размера, не переносится на новую строку */
.consents-inline [class*="t-card"] input[type="checkbox"]{
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  margin: 2px 0 0 0 !important;         /* выравниваем по первой строке текста */
  position: static !important;
}

/* Текст рядом с чекбоксом — инлайн, без лишних отступов и переносов */
.consents-inline [class*="t-card"] *:has(input[type="checkbox"]) br{ display:none !important; }
.consents-inline [class*="t-card"] *:has(input[type="checkbox"]) :is(p, span, a, .t-descr, .t-text, .t-name, .t-uptitle){
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
  font-size: 14px !important;           /* можно поменять при желании */
}

/* Чуть поджать вертикальные отступы у самих карточек-согласий (если нужно) */
.consents-inline [class*="t-card"]:has(input[type="checkbox"]){
  margin-top: 6px !important;
  margin-bottom: 6px !important;
}
/* Строка согласия: чекбокс слева, текст справа, плотно */
.consents-inline .consent-row{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:4px 0;           /* маленький вертикальный зазор между строками */
}
.consents-inline .consent-row input[type="checkbox"]{
  flex:0 0 16px;
  width:16px; height:16px;
  margin:2px 0 0 0;       /* выравниваем по 1-й строке текста */
}
.consents-inline .consent-row p,
.consents-inline .consent-row span,
.consents-inline .consent-row a,
.consents-inline .consent-row .t-descr,
.consents-inline .consent-row .t-text{
  display:inline;
  margin:0;
  padding:0;
  font-size:14px;         /* как просила */
  line-height:1.3;
}
.consents-inline .consent-row br{ display:none; }

/* Только для BF204N с классом .consents-inline */
.consents-inline .consent-row{
  display:flex; align-items:flex-start; gap:8px; margin:4px 0;
}
.consents-inline .consent-row input[type="checkbox"]{
  flex:0 0 16px; width:16px; height:16px; margin:2px 0 0 0;
}
.consents-inline .consent-row p,
.consents-inline .consent-row span,
.consents-inline .consent-row a,
.consents-inline .consent-row .t-descr,
.consents-inline .consent-row .t-text{
  display:inline; margin:0; padding:0; line-height:1.3; font-size:14px;
}
.consents-inline .consent-row br{ display:none; }
/* ===== ЧЕКБОКС СЛЕВА, ТЕКСТ СПРАВА — ТОЛЬКО ВНУТРИ .Contents-Inline ===== */

/* A) СТАНДАРТНАЯ ФОРМА: когда текст чекбокса в .t-input-title (сверху), а галка — в label ниже.
      Ставим контейнер чекбокса в 2 колонки: [16px галка] [текст] */
.Contents-Inline .t-input-group_cb:has(.t-input-title) {
  display: grid !important;
  grid-template-columns: 16px 1fr !important;
  align-items: start !important;
  column-gap: 8px !important;
  row-gap: 0 !important;
  margin: 4px 0 !important;
  padding: 0 !important;
}
/* галка (в label) — в левую колонку */
.Contents-Inline .t-input-group_cb:has(.t-input-title) label { 
  grid-column: 1 !important; 
  margin: 0 !important; 
  padding: 0 !important; 
}
/* текст сверху — в правую колонку, делаем его «строчным» */
.Contents-Inline .t-input-group_cb:has(.t-input-title) .t-input-title {
  grid-column: 2 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
}
/* если в label вдруг есть свой текст — прячем, чтобы не было дубля */
.Contents-Inline .t-input-group_cb:has(.t-input-title) label > *:not(input) {
  display: none !important;
}
/* сама галка — компактная и выровненная по 1-й строке */
.Contents-Inline .t-input-group_cb input[type="checkbox"] {
  width: 16px !important; height: 16px !important;
  margin: 2px 0 0 0 !important;
}

/* B) СЛУЧАЙ, КОГДА ТЕКСТ УЖЕ ВНУТРИ label (классический чекбокс Tilda):
      делаем label «в одну строку» с галкой слева. */
.Contents-Inline label:has(> input[type="checkbox"]),
.Contents-Inline .t-checkbox:has(> input[type="checkbox"]) {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
}
.Contents-Inline label:has(> input[type="checkbox"]) > input,
.Contents-Inline .t-checkbox:has(> input[type="checkbox"]) > input {
  flex: 0 0 auto !important;
  width: 16px !important; height: 16px !important;
  margin: 2px 0 0 0 !important;
}
.Contents-Inline label:has(> input[type="checkbox"]) > *:not(input),
.Contents-Inline .t-checkbox:has(> input[type="checkbox"]) > *:not(input) {
  display: inline !important;
  margin: 0 !important; padding: 0 !important;
  font-size: 14px !important; line-height: 1.3 !important;
}
.Contents-Inline .t-input-group_cb br { display: none !important; }

/* C) BF204N / карточки: если галка и текст лежат внутри «контента» карточки */
.Contents-Inline .t-card__content:has(input[type="checkbox"]),
.Contents-Inline .t-descr:has(input[type="checkbox"]),
.Contents-Inline .t-text:has(input[type="checkbox"]) {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
}
.Contents-Inline .t-card__content:has(input[type="checkbox"]) input[type="checkbox"],
.Contents-Inline .t-descr:has(input[type="checkbox"]) input[type="checkbox"],
.Contents-Inline .t-text:has(input[type="checkbox"]) input[type="checkbox"] {
  flex: 0 0 16px !important;
  width: 16px !important; height: 16px !important;
  margin: 2px 0 0 0 !important;
}
.Contents-Inline .t-card__content:has(input[type="checkbox"]) p,
.Contents-Inline .t-card__content:has(input[type="checkbox"]) span,
.Contents-Inline .t-card__content:has(input[type="checkbox"]) a,
.Contents-Inline .t-descr:has(input[type="checkbox"]) p,
.Contents-Inline .t-descr:has(input[type="checkbox"]) span,
.Contents-Inline .t-descr:has(input[type="checkbox"]) a,
.Contents-Inline .t-text:has(input[type="checkbox"]) p,
.Contents-Inline .t-text:has(input[type="checkbox"]) span,
.Contents-Inline .t-text:has(input[type="checkbox"]) a {
  display: inline !important;
  margin: 0 !important; padding: 0 !important;
  font-size: 14px !important; line-height: 1.3 !important;
}
.Contents-Inline .t-card__content:has(input[type="checkbox"]) br,
.Contents-Inline .t-descr:has(input[type="checkbox"]) br,
.Contents-Inline .t-text:has(input[type="checkbox"]) br { 
  display: none !important; 
}

/* D) Плотнее между строками согласий и кнопкой */
.Contents-Inline .t-input-group_cb { margin: 4px 0 !important; }
.Contents-Inline .t-input-group_cb + .t-input-group_cb { margin-top: 4px !important; }
.Contents-Inline .t-form__submitbox { margin-top: 8px !important; }
