/* ============================================================================
   ЮРИДИЧЕСКИЙ КОНТУР v1 — eng.doverkapay.com (English site) (облик объектов О1–О5)

   Утверждённый вид — legal-kit/src/brands/pay.css + objects/*.astro
   (https://compliance-components-draft.vercel.app/#pay). Объекты встают в
   текущую систему темы: кнопки — `.btn .btn_second` (пилюля 80/46, радиус 80),
   поля — `.input-base .input` (62, радиус 16), чекбокс — `.input-checkbox`
   (18×18, радиус 4), карточки r30 с тенью 0 6px 25px rgb(0 0 0 / .05), панель
   cookie на #F9F9F9, акцент #7F42E1, тинт #F5F0FF. Inter уже в теме.

   Префикс `dl-` (doverka-legal). Кегли заданы в px: тема масштабирует всё в
   vw между 769 и 1920, но юридический текст обязан читаться одинаково.
   ========================================================================== */

.dl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dl-icon {
  display: inline-flex;
  line-height: 0;
}

.dl-icon svg {
  display: block;
}

/* Кнопки контура: трёхслойная разметка темы. Верхний слой без GSAP (или до
   его инициализации) должен быть невидим, иначе подпись двоится. */
[data-legal-btn] {
  white-space: nowrap;
  letter-spacing: 0;
}

[data-legal-btn] .btn__text-up {
  opacity: 0;
  pointer-events: none;
}

[data-legal-btn]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn.dl-btn--soft {
  background: #f5f0ff;
  color: #7f42e1;
}

.btn.dl-btn--soft:hover {
  background: #ebe2ff;
}

.dl-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #191919;
  cursor: pointer;
  transition: background 0.3s;
}

.dl-close:hover {
  background: #ebe2ff;
}

.dl-legal {
  font-size: 14px;
  line-height: 1.4;
  color: rgba(31, 41, 51, 0.7);
}

.dl-legal a,
.dl-consent .text a,
.dl-chat__policy a,
.dl-bubble--op a {
  color: #7f42e1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dl-legal a:hover,
.dl-consent .text a:hover,
.dl-chat__policy a:hover,
.dl-bubble--op a:hover {
  text-decoration: none;
}

/* ── Чекбокс согласия (О2, О3) — поверх `.input-checkbox` темы ─────────────── */

.dl-consent {
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: rgba(31, 41, 51, 0.7);
  cursor: default;
}

.dl-consent .input {
  top: 2px;
  cursor: pointer;
  background: #ffffff;
  border-radius: 4px;
}

.dl-consent .input::before {
  transition: border-color 0.3s;
}

.dl-consent input[type="checkbox"]:checked + .input::before {
  border-color: #7f42e1;
  background: #7f42e1;
}

.dl-consent input[type="checkbox"]:checked + .input::after {
  background-image: url('data:image/svg+xml,<svg width="13" height="10" viewBox="0 0 13 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 5 4.6 8.6 12 1.2" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-size: 12px 9px;
}

.dl-consent input[type="checkbox"]:focus-visible + .input::before {
  outline: 2px solid #7f42e1;
  outline-offset: 2px;
}

.dl-consent input[type="checkbox"].is-error + .input::before {
  border-color: #771d5c;
}

.dl-consent .text {
  cursor: pointer;
}

/* ── О1. Cookie-баннер (первый слой) — полоса внизу, как прежний бар ──────── */

.dl-banner {
  position: fixed;
  z-index: 17;
  bottom: 0;
  left: 0;
  width: 100%;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #191919;
  background: #f9f9f9;
  box-shadow: 0 -1px 4px rgba(25, 33, 61, 0.06);
}

.dl-banner__wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 24px 60px 24px 0;
}

.dl-banner__close {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.dl-banner__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 82ch;
}

.dl-banner__title {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #191919;
}

.dl-banner__text {
  color: rgba(31, 41, 51, 0.7);
}

/* Три равнозначные кнопки — требование ТЗ, не композиция: одна ширина,
   один тон, один размер. */
.dl-banner__actions,
.dl-panel__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dl-banner__actions {
  flex: 0 0 auto;
  width: 540px;
  max-width: 45%;
}

.dl-banner__actions .btn,
.dl-panel__actions .btn {
  width: 100%;
  padding-left: 12px;
  padding-right: 12px;
}

/* ── О1б. Панель настроек ─────────────────────────────────────────────────── */

.dl-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(25, 25, 25, 0.7);
  overflow-y: auto;
}

.dl-panel {
  width: 100%;
  max-width: 860px;
  max-height: 100%;
  overflow-y: auto;
  padding: 40px;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #191919;
  background: #ffffff;
  border-radius: 30px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.05);
  outline: none;
}

.dl-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dl-panel__head .dl-close {
  background: #f9f9f9;
}

.dl-panel__title {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.dl-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  border-radius: 20px;
  background: #f9f9f9;
}

.dl-row__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dl-row__name {
  font-size: 18px;
  font-weight: 600;
  color: #191919;
}

.dl-row__desc {
  font-size: 16px;
  color: rgba(31, 41, 51, 0.7);
}

.dl-row__side {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: #b8bbbe;
}

.dl-row__locked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.dl-toggle {
  flex: none;
  position: relative;
  width: 52px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e6e6e6;
  cursor: pointer;
  transition: background 0.2s;
}

.dl-toggle__knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.dl-toggle.is-on {
  background: #7f42e1;
}

.dl-toggle.is-on .dl-toggle__knob {
  transform: translateX(22px);
}

.dl-toggle.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.dl-toggle:focus-visible {
  outline: 2px solid #7f42e1;
  outline-offset: 2px;
}

.dl-panel__actions {
  margin-top: 24px;
}

/* ── О3 + О5. Юридический блок футера ───────────────────────────────────── */

.footer__legal {
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #191919;
  background: #f4f4f4;
}

.dl-foot__wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px 80px;
  padding: 50px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dl-foot__label {
  font-size: 16px;
  opacity: 0.5;
}

.dl-foot__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 36px 72px;
}

.dl-foot__col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 240px;
  max-width: 380px;
}

.dl-foot__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dl-foot__links a,
.dl-foot__links button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  color: rgba(31, 41, 51, 0.7);
  cursor: pointer;
  transition: 0.5s;
}

.dl-foot__links a:hover,
.dl-foot__links button:hover {
  color: #7f42e1;
}

.dl-foot__req {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 22px 0 30px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: rgba(31, 41, 51, 0.7);
}

.dl-foot__req a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Незаполненный реквизит из ТЗ — должен бросаться в глаза, а не выглядеть правдоподобно. */
.dl-todo {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(127, 66, 225, 0.12);
  white-space: nowrap;
}

/* Подписка */
.dl-sub {
  flex: 1 1 520px;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dl-sub__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dl-sub__field {
  flex: 1 1 260px;
}

.dl-sub__field .input {
  background: #ffffff;
}

.dl-sub__btn {
  height: 62px;
  padding: 0 30px;
  font-size: 16px;
}

.dl-consents {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dl-sub__status {
  min-height: 1.4em;
  color: #771d5c;
}

.dl-sub__status:empty {
  display: none;
}

.dl-sub__pending {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 26px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  border-radius: 30px;
  background: #ffffff;
}

.dl-sub__pending-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.dl-sub__pending-text {
  color: rgba(31, 41, 51, 0.7);
}

/* ── О4. Онлайн-чат ──────────────────────────────────────────────────────── */

.dl-chat-launcher {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 16;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #7f42e1;
  color: #ffffff;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background 0.3s, bottom 0.3s;
}

.dl-chat-launcher:hover {
  background: #5f38b4;
}

.dl-chat-launcher[hidden] {
  display: none;
}

/* Пока внизу стоит cookie-баннер, лаунчер поднимается над ним. */
body.dl-has-banner .dl-chat-launcher,
body.dl-has-banner .dl-chat {
  bottom: calc(var(--dl-banner-h, 120px) + 20px);
}

.dl-chat {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 16;
  display: flex;
  flex-direction: column;
  width: 440px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  overflow: hidden;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #191919;
  background: #ffffff;
  border-radius: 30px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.dl-chat[hidden] {
  display: none;
}

.dl-chat__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: #7f42e1;
  color: #ffffff;
}

.dl-chat__title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.dl-chat__min {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  cursor: pointer;
}

.dl-chat__min:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dl-chat__log {
  flex: 1 1 auto;
  min-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.dl-bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.5;
}

.dl-bubble p + p {
  margin-top: 10px;
}

.dl-bubble--op {
  align-self: flex-start;
  background: #f5f0ff;
  color: #191919;
}

.dl-bubble--me {
  align-self: flex-end;
  background: #7f42e1;
  color: #ffffff;
}

.dl-chat__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: flex-start;
}

.dl-chat__choices[hidden],
.dl-chat__form[hidden],
.dl-chat__offer[hidden] {
  display: none;
}

.dl-chat__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 17px;
  border-radius: 20px;
  background: #f5f0ff;
}

.dl-chat__form-title {
  font-size: 16px;
}

.dl-chat__field {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  border-radius: 16px;
  background: #ffffff;
  font: inherit;
  letter-spacing: inherit;
  color: #191919;
  outline: none;
  transition: border-color 0.3s;
}

.dl-chat__field:focus {
  border-color: #191919;
}

.dl-chat__form .btn {
  width: 100%;
}

.dl-chat__composer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid rgba(31, 41, 51, 0.08);
}

.dl-chat__offer {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  color: #7f42e1;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.dl-chat__offer:hover {
  text-decoration: none;
}

.dl-chat__label {
  font-size: 14px;
  font-weight: 500;
}

.dl-chat__input {
  width: 100%;
  min-height: 84px;
  padding: 12px 16px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  border-radius: 16px;
  background: transparent;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: inherit;
  color: #191919;
  resize: none;
  outline: none;
  transition: border-color 0.3s;
}

.dl-chat__input::placeholder {
  color: rgba(25, 25, 25, 0.7);
}

.dl-chat__input:focus {
  border-color: #191919;
}

.dl-chat__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dl-chat__policy {
  font-size: 14px;
  line-height: 1.4;
  color: rgba(31, 41, 51, 0.7);
}

/* ── Страницы документов: строка «Версия · Дата · Статус» ───────────────── */

.dl-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 30px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  color: rgba(25, 25, 25, 0.5);
}

/* ── Телефон ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .dl-banner__wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 0 16px;
  }

  .dl-banner__close {
    top: 0;
    right: 0;
    transform: none;
    width: 32px;
    height: 32px;
  }

  .dl-banner__body {
    padding-right: 40px;
  }

  .dl-banner__title {
    font-size: 18px;
  }

  .dl-banner__actions,
  .dl-panel__actions {
    grid-template-columns: 1fr;
  }

  .dl-banner__actions {
    width: 100%;
    max-width: none;
  }

  .dl-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .dl-panel {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .dl-panel__title {
    font-size: 20px;
  }

  .dl-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 16px;
    padding: 16px;
  }

  .dl-row__text {
    grid-column: 1;
    grid-row: 1;
  }

  .dl-row__side {
    display: contents;
  }

  .dl-row__side > .dl-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .dl-row__side > .dl-row__locked {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dl-foot__wrapper {
    gap: 30px;
    padding: 25px 0 30px;
  }

  .dl-foot__cols {
    gap: 26px;
    width: 100%;
  }

  .dl-foot__col {
    min-width: min(240px, 100%);
    max-width: none;
    width: 100%;
  }

  .dl-foot__req {
    flex-direction: column;
    padding: 22px 0 25px;
  }

  .dl-todo {
    white-space: normal;
  }

  .dl-sub {
    flex-basis: 100%;
    max-width: none;
  }

  .dl-sub__btn {
    width: 100%;
    height: 50px;
  }

  .dl-sub__field .input {
    height: 50px;
    border-radius: 10px;
  }

  .dl-chat-launcher {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .dl-chat {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 20px);
    border-radius: 24px;
  }

  .dl-chat__foot {
    flex-wrap: wrap;
  }

  .dl-chat__foot .btn {
    flex: 1 1 100%;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   О1. COOKIE-БАННЕР — НИЖЕ РОСТОМ

   Правка заказчика 2026-09-22: «баннеры слишком высокие». Полоса и так была
   горизонтальной, но высоту держали отдельная строка ссылок под текстом и
   щедрые поля: 323 px на десктопе. Строка ссылок ушла внутрь абзаца (см.
   legal.js), поля поджаты, заголовок с 22 до 20.

   Блок стоит в конце файла и переопределяет правила выше — так правка видна
   одним куском и откатывается одним куском.

   ⚠️ Требование ТЗ о равнозначности трёх кнопок не тронуто: один тон, один
   размер, три равные колонки — и на десктопе, и на телефоне.
   ══════════════════════════════════════════════════════════════════════════ */

.dl-banner__wrapper {
  gap: 28px;
  padding: 18px 52px 18px 0;
}

.dl-banner__body {
  gap: 5px;
}

.dl-banner__title {
  font-size: 20px;
}

.dl-banner__actions {
  width: 500px;
  max-width: 48%;
}

/* ⚠️ НА ТЕЛЕФОНЕ КНОПКИ ОСТАЮТСЯ РЯДОМ, А НЕ СТОЛБИКОМ. Столбик стоил бы двух
   лишних высот кнопки и вдобавок задавал бы трём вариантам порядок сверху
   вниз — а ТЗ требует, чтобы они читались как равные. Помещается за счёт
   кегля 12 и узких полей; перенос внутри одной кнопки сделал бы её выше
   соседних, поэтому подпись не переносится. */
@media (max-width: 768px) {
  .dl-banner__wrapper {
    gap: 12px;
    padding: 16px 40px 16px 0;
  }
  .dl-banner__title {
    font-size: 18px;
  }
  .dl-banner__actions {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .dl-banner__actions .btn {
    height: 46px;
    font-size: 12px;
    padding: 0 6px;
    white-space: nowrap;
  }
}

/* ⚠️ ССЫЛКИ НА Д3 И Д1 ВНУТРИ АБЗАЦА ОБЯЗАНЫ ОСТАВАТЬСЯ ССЫЛКАМИ. Пока они
   стояли отдельной строкой, их красил .dl-legal a; переехав в .dl-banner__text,
   они унаследовали цвет абзаца и лишились подчёркивания — то есть перестали
   читаться как ссылки. ТЗ требует, чтобы документы были доступны из баннера.
*/
.dl-banner__text a {
  color: #7f42e1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dl-banner__text a:hover {
  text-decoration: none;
}
