/*
 * Consent to personal data processing:
 * CF7 [acceptance pd-consent] block and WooCommerce checkbox.
 *
 * Block layout in CF7 forms (inside *__agreement):
 *   [x] consent label
 *       captcha notice        (.captcha-notice)
 */

:root {
  --pd-box: 18px;
  --pd-gap: 10px;
}

/* Agreement blocks: enough width for the consent text */
.c-form__agreement {
  max-width: 760px;
}

.l-form__agreement {
  max-width: none;
}

.callback__container-agreement {
  max-width: 420px;
}

/* Checkbox + label */
.wpcf7-acceptance .wpcf7-list-item {
  display: block;
  margin: 0;
}

.wpcf7-acceptance .wpcf7-list-item label,
.pd-consent__label {
  display: flex;
  align-items: flex-start;
  gap: var(--pd-gap);
  line-height: 1.35;
  cursor: pointer;
}

.wpcf7 .wpcf7-acceptance input[type="checkbox"],
.pd-consent__input {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 var(--pd-box);
  width: var(--pd-box);
  height: var(--pd-box);
  min-width: var(--pd-box);
  margin: calc((1.35em - var(--pd-box)) / 2) 0 0;
  padding: 0;
  border: 1px solid #a3aabe;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.wpcf7 .wpcf7-acceptance input[type="checkbox"]::before,
.pd-consent__input::before {
  content: none;
}

.wpcf7 .wpcf7-acceptance input[type="checkbox"]:checked,
.pd-consent__input:checked {
  border-color: #185bb3;
  background: #185bb3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16.04 12.04'%3E%3Cpath d='M5.86,12a1,1,0,0,1-.73-.32L.27,6.55a1,1,0,0,1,0-1.41,1,1,0,0,1,1.41,0L5.85,9.57,14.26.37a1,1,0,0,1,1.56,1.26l-9.22,10.09a1,1,0,0,1-.73.33Z' fill='%23fff'/%3E%3C/svg%3E") center / 60% no-repeat;
}

.wpcf7 .wpcf7-acceptance input[type="checkbox"]:focus-visible,
.pd-consent__input:focus-visible {
  outline: 2px solid #1f64bf;
  outline-offset: 2px;
}

/* Captcha notice, aligned with the label text */
.wpcf7 .wpcf7-form-control-wrap[data-name="pd-consent"] ~ .captcha-notice {
  margin: 6px 0 0;
  padding-left: calc(var(--pd-box) + var(--pd-gap));
  font-size: 0.85em;
  line-height: 1.35;
  opacity: 0.75;
}

/* Validation tip under the checkbox */
.wpcf7-acceptance ~ .wpcf7-not-valid-tip,
.wpcf7-form-control-wrap[data-name="pd-consent"] .wpcf7-not-valid-tip {
  padding-left: calc(var(--pd-box) + var(--pd-gap));
}

/* Compact callback forms: small text, but readable */
.callback__container-agreement {
  --pd-box: 16px;
  --pd-gap: 8px;
  font-size: 12px;
}

/* WooCommerce */
.pd-consent {
  margin: 0 0 20px;
  font-size: 15px;
}

.pd-consent a {
  color: #1f64bf;
}

.wpcf7-form .wpcf7-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/*
 * WordPress adds the "privacy-policy" class to <body> on the policy page,
 * and the theme's checkout rule .privacy-policy squeezed the whole page
 * to 340-582px. Restore the regular body styles there.
 */
body.privacy-policy {
  max-width: none;
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
}

@media (min-width: 575px) {
  body.privacy-policy {
    font-size: 20px;
    line-height: 1.2;
  }
}

/*
 * Personal data documents (privacy policy, consent): body.pd-doc-page.
 *
 * The page title and the document card sit in one reading column, centred
 * in the viewport when there is room.
 * From 992px the column never starts under the left floating sidebar,
 * even when it expands on hover (258px wide):
 *   992–1199px: sidebar left 20px  → right edge 278px, container padding 130px;
 *   ≥1200px:    sidebar left 57px  → right edge 315px, container padding 204px.
 */
.pd-doc-page {
  --pd-doc-width: 800px;
  --pd-doc-safe: 0px;
  /* half of (container padding-left - padding-right): shifts the column to the viewport centre */
  --pd-doc-shift: 0px;
}

@media (min-width: 992px) {
  .pd-doc-page {
    --pd-doc-safe: 172px;
    --pd-doc-shift: 50px;
  }
}

@media (min-width: 1200px) {
  .pd-doc-page {
    --pd-doc-safe: 135px;
    --pd-doc-shift: 54px;
  }
}

.pd-doc-page .app__main > .container > * {
  max-width: var(--pd-doc-width);
  margin-left: max(var(--pd-doc-safe), (100% - var(--pd-doc-width)) / 2 - var(--pd-doc-shift));
  margin-right: auto;
}

.pd-doc-page .page-headline-title {
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1;
  margin-bottom: 28px;
}

/* Document card */
.pd-doc {
  background: #fff;
  border-radius: 10px;
  -webkit-box-shadow: 9.60413px 9.45px 35.05px rgba(187, 196, 209, 0.25);
          box-shadow: 9.60413px 9.45px 35.05px rgba(187, 196, 209, 0.25);
  padding: 24px 20px 28px;
  margin-bottom: 40px;
  color: #2c333e;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .pd-doc {
    padding: 40px 48px 44px;
    font-size: 17px;
  }
}

@media (min-width: 1200px) {
  .pd-doc {
    padding: 52px 64px 56px;
  }
}

/* WordPress 6.0 wraps group content in .wp-block-group__inner-container */
.pd-doc > :first-child,
.pd-doc > .wp-block-group__inner-container > :first-child {
  margin-top: 0;
}

.pd-doc > h2:first-child,
.pd-doc > .wp-block-group__inner-container > h2:first-child {
  padding-top: 0;
  border-top: 0;
}

.pd-doc > :last-child,
.pd-doc > .wp-block-group__inner-container > :last-child {
  margin-bottom: 0;
}

.pd-doc p {
  margin: 0 0 1em;
}

.app__main .pd-doc p:first-child {
  margin-top: 0;
}

.pd-doc h2 {
  font-size: 22px;
  line-height: 1.15;
  color: #091538;
  margin: 1.9em 0 0.8em;
  padding-top: 1.3em;
  border-top: 1px solid #ebeff8;
}

@media (min-width: 768px) {
  .pd-doc h2 {
    font-size: 26px;
  }
}

.pd-doc ul {
  list-style: none;
  margin: 0 0 1.1em;
  padding: 0;
}

.pd-doc li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.45em;
}

.pd-doc li::before {
  content: "";
  position: absolute;
  left: 0.35em;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #185bb3;
}

.pd-doc a {
  color: #1f64bf;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.pd-doc a:hover {
  color: #185bb3;
  text-decoration-thickness: 2px;
}

.pd-doc strong {
  color: #091538;
  font-weight: 600;
}

/* "Редакция от ..." — last line of the document */
.pd-doc .pd-doc__meta {
  margin: 2em 0 0;
  padding-top: 1.2em;
  border-top: 1px solid #ebeff8;
  color: #7b88a4;
  font-size: 14px;
  line-height: 1.4;
}
