/* ===== Контакты: слева «Напишите мне» (три кнопки-чата; на компьютере ещё QR-коды и форма «я напишу Вам сам»),
   справа подписка на новости (соцсети и сайты-партнёры — в колонтитуле).
   На компьютере раздел ровно в экран: ничего не листается и не двигается ===== */
.contacts { padding: 104px var(--gutter) 40px; color: #fff; scroll-snap-align: start; box-sizing: border-box; }
.contacts__wrap {
  width: 100%; max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(14px, 1.6vw, 22px);
}
.ct-card {
  min-width: 0; padding: clamp(16px, 2vw, 24px) clamp(18px, 2.2vw, 28px);
  border-radius: 24px; border: 1px solid rgba(255, 255, 255, .24);
  background: linear-gradient(165deg, rgba(7, 133, 95, .42), rgba(7, 133, 95, .22));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 50px -30px rgba(1, 41, 34, .7);
  text-shadow: 0 1px 8px rgba(5, 113, 83, .25);
}
.ct-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 2px;
  font: 700 clamp(26px, 2.3vw, 32px)/1 "Caveat", var(--serif); color: #ffc935;
}
.ct-title svg { width: 21px; height: 21px; flex-shrink: 0; color: #ffd36b; }
.ct-lead { margin: 0 0 12px; font: 400 14px/1.45 var(--sans); color: rgba(255, 255, 255, .86); }
.ct-lead b { font-weight: 600; color: #ffe39a; }

/* ---- три кнопки: сразу открывают чат со мной в мессенджере ---- */
.ct-chats { display: grid; gap: 10px; }
.ct-chat {
  display: block; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .08);
  color: #fff; text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
}
.ct-chat--telegram { --brand: #2aabee; }
.ct-chat--whatsapp { --brand: #25d366; }
.ct-chat--viber { --brand: #8f7cff; }
.ct-chat:hover, .ct-chat:active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 22%, transparent); box-shadow: 0 12px 26px -16px var(--brand); }
.ct-chat:focus-visible { outline: 2px solid #ffd36b; outline-offset: 3px; }
.ct-chat__row { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 18px 10px 14px; box-sizing: border-box; }
.ct-chat__row > svg:first-child { width: 38px; height: 38px; flex-shrink: 0; filter: drop-shadow(0 3px 8px rgba(1, 41, 34, .4)); }
.ct-chat__txt { flex: 1 1 auto; font: 500 16.5px/1.2 var(--sans); }
.ct-chat__txt b { font-weight: 700; }
.ct-chat__go { width: 20px; height: 20px; flex-shrink: 0; color: rgba(255, 226, 154, .9); transition: transform .2s; }
.ct-chat:hover .ct-chat__go { transform: translateX(3px); }
.ct-chat__qr, .ct-qrnote { display: none; }
/* форма «я напишу Вам сам» — только на компьютере (на телефоне мессенджеры есть у всех) */
.ct-callbox { display: none; }
.ct-subtitle { margin: 0 0 2px; font: 700 clamp(22px, 1.9vw, 26px)/1.05 "Caveat", var(--serif); color: #ffc935; }
.ct-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }

/* ---- форма ---- */
.ct-form { display: flex; flex-direction: column; height: 100%; }
.ct-form[hidden] { display: none; }
.ct-field { margin: 0 0 2px; padding: 0; border: 0; min-width: 0; }
.ct-label { display: block; padding: 0; margin: 0 0 5px 4px; font: 600 12.5px/1.2 var(--sans); letter-spacing: .02em; color: #ffe39a; }
.ct-hint { font-weight: 400; letter-spacing: 0; color: rgba(255, 255, 255, .7); }
.ct-input {
  box-sizing: border-box; width: 100%; height: 40px; padding: 0 16px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .09);
  color: #fff; font: 400 14.5px/1.4 var(--sans);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.ct-input::placeholder { color: rgba(255, 255, 255, .55); }
.ct-input:hover { border-color: rgba(255, 255, 255, .42); }
.ct-input:focus { outline: none; border-color: #ffd36b; background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 3px rgba(255, 211, 107, .14); }
.ct-field.is-error .ct-input { border-color: #ff9a8a; }
.ct-err { min-height: 15px; margin: 3px 0 0 6px; font: 500 12px/1.25 var(--sans); color: #ffb4a8; }
.ct-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* выбор мессенджера — три «таблетки» с фирменными значками */
.ct-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ct-pill {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 10px;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .07);
  font: 600 14px/1 var(--sans); color: rgba(255, 255, 255, .92); cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.ct-pill input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ct-pill svg { width: 22px; height: 22px; flex-shrink: 0; filter: drop-shadow(0 3px 6px rgba(1, 41, 34, .35)); }
.ct-pill:hover { border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .12); }
.ct-pill:has(input:focus-visible) { outline: 2px solid #ffd36b; outline-offset: 2px; }
.ct-pill:has(input:checked) { color: #fff; border-color: var(--brand); background: color-mix(in srgb, var(--brand) 26%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.ct-pill--telegram { --brand: #25e568; }
.ct-pill--viber { --brand: #7ce8ff; }
.ct-pill--whatsapp { --brand: #25d366; }
.ct-msgr.is-error .ct-pill { border-color: rgba(255, 154, 138, .7); }

.ct-send { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: auto; padding-top: 4px; }
.ct-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #ffd760, #f2b631); color: #3a2600; font: 600 15px/1 var(--sans);
  box-shadow: 0 10px 22px -10px rgba(255, 170, 30, .95); transition: box-shadow .2s, opacity .2s, filter .2s;
}
.ct-btn svg { width: 18px; height: 18px; }
.ct-btn:hover { filter: brightness(1.05); box-shadow: 0 12px 26px -10px rgba(255, 170, 30, 1); }
.ct-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ct-btn[disabled] { opacity: .7; cursor: wait; }
.ct-note { flex: 1 1 200px; margin: 0; font: 400 12px/1.4 var(--sans); color: rgba(255, 255, 255, .7); }
.ct-note a { color: #ffe39a; }
.ct-fail { flex-basis: 100%; margin: 0; font: 500 13px/1.4 var(--sans); color: #ffb4a8; }
.ct-fail[hidden] { display: none; }
.ct-fail a { color: #ffe39a; }

/* после отправки */
.ct-done { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 20px 0; }
.ct-done[hidden] { display: none; }
.ct-done .ct-title { display: block; }
.ct-done__ico { width: 60px; height: 60px; margin-bottom: 10px; color: #ffd36b; filter: drop-shadow(0 0 14px rgba(255, 205, 80, .5)); }
.ct-again {
  margin-top: 6px; height: 40px; padding: 0 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 214, 110, .55); background: rgba(255, 201, 53, .1); color: #ffe39a; font: 600 14px/1 var(--sans);
  transition: background .2s;
}
.ct-again:hover { background: rgba(255, 201, 53, .24); }

/* ---- подписка на новости ---- */
.ct-sub { display: flex; flex-direction: column; justify-content: center; text-align: center; }
.ct-sub__ico { width: 48px; height: 48px; margin: 0 auto 8px; color: #ffd36b; filter: drop-shadow(0 0 12px rgba(255, 205, 80, .45)); }
.ct-sub .ct-title { justify-content: center; margin-bottom: 8px; }
.ct-sub .ct-lead { margin-bottom: 12px; line-height: 1.55; }
.ct-sub__form { flex: none; display: flex; flex-direction: column; gap: 10px; max-width: none; margin: 0; }
.ct-sub__form .subscribe__input { flex: none; height: 44px; border-radius: 14px; font-size: 14.5px; text-align: center; }
.ct-sub__form .subscribe__btn { height: 44px; font-size: 15px; }
.ct-sub__form .subscribe__msg { min-height: 1.3em; margin: 0; text-align: center; }

/* темы подписки: кнопки-переключатели, по умолчанию выбрано всё */
.ct-topics { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 0 0 16px; }
.ct-topic {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .78);
  font: 500 13px/1 var(--sans); -webkit-tap-highlight-color: transparent;
  transition: background .2s, border-color .2s, color .2s;
}
.ct-topic::before {
  content: ""; width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid currentColor; opacity: .7; transition: background .2s, border-color .2s, opacity .2s;
}
.ct-topic[aria-pressed="true"] { border-color: rgba(255, 214, 110, .75); background: rgba(255, 201, 53, .18); color: #fff3cf; }
.ct-topic[aria-pressed="true"]::before {
  opacity: 1; border-color: #ffd36b;
  background: #ffd36b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 6.2 2 2 4-4.4' fill='none' stroke='%23085c44' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.ct-topic:hover { border-color: rgba(255, 214, 110, .6); }
.ct-topic:focus-visible { outline: 2px solid #ffd36b; outline-offset: 2px; }
.ct-topic--all { font-weight: 700; }

/* «Получать в Telegram» — как кнопки мессенджеров слева */
.ct-tg {
  --brand: #2aabee;
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 16px 6px 10px; box-sizing: border-box;
  border-radius: 16px; border: 1px solid rgba(42, 171, 238, .7); background: rgba(42, 171, 238, .16);
  color: #fff; text-decoration: none; text-align: left; font: 500 15.5px/1.2 var(--sans);
  transition: background .2s, box-shadow .2s;
}
.ct-tg[hidden] { display: none; }
.ct-tg > svg:first-child { width: 34px; height: 34px; flex-shrink: 0; }
.ct-tg span { flex: 1 1 auto; }
.ct-tg b { font-weight: 700; }
.ct-tg:hover { background: rgba(42, 171, 238, .28); box-shadow: 0 12px 26px -16px var(--brand); }
.ct-tg:hover .ct-chat__go { transform: translateX(3px); }
.ct-tg:focus-visible { outline: 2px solid #ffd36b; outline-offset: 3px; }
.ct-or { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; font: 500 12.5px/1 var(--sans); color: rgba(255, 255, 255, .66); }
.ct-or[hidden] { display: none; }
.ct-or::before, .ct-or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .22); }
.ct-channels { margin: 6px 0 0; font: 400 13px/1.4 var(--sans); color: rgba(255, 255, 255, .7); }
.ct-channels a { margin-left: 8px; color: #ffe39a; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255, 227, 154, .4); }
.ct-channels a[hidden] { display: none; }
.ct-channels a:hover { border-bottom-color: #ffe39a; }

/* после подписки: вместо формы — галочка и «Спасибо! Ваша подписка оформлена» */
.ct-sub.is-done > :not(.ct-sub__done) { display: none; }
.ct-sub__done { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: ct-sub-in .45s ease; }
.ct-sub__done[hidden] { display: none; }
.ct-sub__done .ct-done__ico { margin-bottom: 12px; }
.ct-sub__done .ct-title { display: block; margin-bottom: 8px; line-height: 1.1; text-wrap: balance; }
.ct-sub__done .ct-lead { margin-bottom: 14px; }
@keyframes ct-sub-in { from { opacity: 0; transform: scale(.96); } }

/* телефон и планшет: подписка под формой */
@media (max-width: 899px) {
  .contacts__wrap { grid-template-columns: minmax(0, 1fr); }
  .ct-sub { padding-top: 22px; padding-bottom: 22px; }
}

/* компьютер: раздел ровно в экран; три мессенджера в ряд с QR-кодами, под ними — форма «я напишу Вам сам» */
@media (min-width: 900px) {
  .contacts { height: 100svh; min-height: 600px; padding-top: clamp(124px, calc(6.4vw + 44px), 160px); padding-bottom: 22px; display: flex; align-items: center; }
  .contacts__wrap { max-height: 100%; }
  .ct-card--form { display: flex; flex-direction: column; }
  .ct-chats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ct-chat { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 10px 14px; }
  .ct-chat__row { min-height: 0; padding: 0; gap: 8px; justify-content: center; }
  .ct-chat__row > svg:first-child { width: 26px; height: 26px; }
  .ct-chat__txt { flex: none; font-size: 15.5px; }
  .ct-chat__pre { display: none; } /* на компьютере в карточке — только название мессенджера */
  .ct-chat__go { display: none; }
  .ct-chat__qr { display: block; box-sizing: border-box; width: clamp(96px, 8.6vw, 118px); height: auto; aspect-ratio: 1; padding: 6px; border-radius: 12px; background: #fff; image-rendering: pixelated; box-shadow: 0 8px 20px -12px rgba(1, 41, 34, .8); }
  .ct-qrnote { display: block; margin: 9px 0 0; text-align: center; font: 400 12.5px/1.4 var(--sans); color: rgba(255, 255, 255, .75); }
  .ct-callbox { display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .18); }
  .ct-callbox .ct-lead { margin-bottom: 8px; }
  .ct-done { padding: 8px 0; }
}
/* невысокий экран ноутбука — ещё плотнее */
@media (min-width: 900px) and (max-height: 720px) {
  .ct-card { padding-top: 14px; padding-bottom: 14px; }
  .ct-lead { margin-bottom: 8px; }
  .ct-input { height: 38px; }
  .ct-pill { height: 38px; }
  .ct-btn { height: 40px; }
  .ct-err { min-height: 13px; margin-top: 2px; }
  .ct-chat__qr { width: 84px; }
  .ct-qrnote { display: none; }
  .ct-callbox { margin-top: 10px; padding-top: 8px; }
}

@media (max-width: 480px) {
  .ct-pills { gap: 6px; }
  .ct-pill { flex-direction: column; gap: 5px; height: 60px; font-size: 13px; }
  .ct-btn { width: 100%; justify-content: center; }
}
