/* ============================================================
   Генератор документов по персональным данным
   Локальные стили страницы /services/legal-generator/
   Префикс .lg- — не переопределяет глобальные стили сайта.
   ============================================================ */

.lg-main {
  font-family: "Onest", sans-serif;
  color: var(--white, #f3f0e9);
}

.lg-container {
  width: min(calc(100% - (var(--page-gutter, 20px) * 2)), var(--content-width, 1200px));
  margin: 0 auto;
}

/* ---------- Hero ---------- */

.lg-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 140px 0 56px;
  text-align: center;
}

.lg-title {
  margin: 0 auto 16px;
  max-width: 840px;
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.lg-lead {
  margin: 0 auto 18px;
  max-width: 680px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted, #96928c);
}

.lg-hero-note {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #ff692a;
}

.lg-hero-note span {
  color: var(--dim, #5f5c58);
  margin: 0 6px;
}

/* ---------- Tabs ---------- */

.lg-constructor {
  padding: 0 0 120px;
}

.lg-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin: 0 0 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
  border-radius: 18px;
}

.lg-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted, #96928c);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  padding: 15px 18px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lg-tab:hover {
  color: var(--white, #f3f0e9);
  background: rgba(255, 255, 255, 0.05);
}

.lg-tab.is-active {
  color: var(--white, #f3f0e9);
  background: rgba(255, 105, 42, 0.14);
  border-color: rgba(255, 105, 42, 0.45);
}

.lg-tab:focus-visible {
  outline: 2px solid #ff692a;
  outline-offset: 2px;
}

.lg-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Layout ---------- */

.lg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.lg-form-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ---------- Blocks ---------- */

.lg-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 24px;
}

.lg-block-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lg-block-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted, #96928c);
}

/* ---------- Fields & inputs ---------- */

.lg-field {
  margin-top: 18px;
}

.lg-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lg-label-spaced { margin-top: 16px; }
.lg-option { display: flex; align-items: flex-start; gap: 9px; color: var(--muted, #96928c); font-size: 13px; line-height: 1.45; }
.lg-option input { margin-top: 3px; accent-color: #ff692a; }
.lg-help { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; color: #ff8a55; font-size: 11px; cursor: help; }
.lg-nested-block { margin-top: 20px; padding: 18px; border: 1px solid rgba(255, 105, 42, .3); border-radius: 14px; background: rgba(255, 105, 42, .04); }
.lg-nested-title { margin: 0; font-size: 15px; }
.lg-basis-list { display: grid; gap: 10px; margin-top: 16px; }
.lg-basis-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.2fr); gap: 12px; align-items: center; color: var(--muted, #96928c); font-size: 13px; }
.lg-basis-row .lg-input { padding-block: 10px; }
.lg-consent-scope-list { display: grid; gap: 10px; margin-top: 16px; }
.lg-consent-scope-option { min-height: 46px; padding: 11px 13px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; color: #d8d5ce; background: rgba(255,255,255,.025); cursor: pointer; }
.lg-consent-scope-option input { width: 17px; height: 17px; margin: 0; accent-color: #ff692a; }
#lg-separate-consents-label + .lg-segmented { margin-top: 12px; }
.lg-service-list { display: grid; gap: 14px; }
.lg-service-item { padding: 16px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.lg-service-item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.lg-service-item-title { margin: 0; color: #f3f0e9; font-size: 14px; font-weight: 700; }
.lg-remove-service-btn { border: 0; padding: 4px 0; color: #96928c; background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
.lg-remove-service-btn:hover { color: #ff692a; }
.lg-service-self-hosted { margin-top: 14px; }
.lg-add-service-btn { width: 100%; margin-top: 12px; padding: 12px 16px; border: 1px dashed rgba(255, 105, 42, .55); border-radius: 12px; color: #ff8a55; background: rgba(255, 105, 42, .05); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.lg-add-service-btn:hover { border-style: solid; background: rgba(255, 105, 42, .1); }

.lg-block > .lg-field:first-of-type,
.lg-block > .lg-segmented:first-of-type,
.lg-block > .lg-chips:first-of-type {
  margin-top: 16px;
}

.lg-block-sub + .lg-chips {
  margin-top: 14px;
}

.lg-label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #96928c);
}

.lg-input {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.35;
  color: var(--white, #f3f0e9);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
  border-radius: 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lg-input::placeholder {
  color: var(--dim, #5f5c58);
}

select.lg-input {
  color-scheme: dark;
}

select.lg-input option {
  color: #171512;
  background: #ffffff;
}

.lg-input:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.lg-input:focus-visible {
  outline: none;
  border-color: #ff692a;
  background: rgba(255, 255, 255, 0.06);
}

.lg-input:disabled,
.lg-input.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lg-field.has-error .lg-input {
  border-color: var(--orange-red, #ef3b20);
}

.lg-helper {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dim, #5f5c58);
}

.lg-optional {
  color: var(--dim, #5f5c58);
  font-size: .82em;
  font-weight: 400;
}

.lg-error-text {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--orange-red, #ef3b20);
}

/* ---------- Segmented control ---------- */

.lg-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
  border-radius: 14px;
}

.lg-segment {
  appearance: none;
  flex: 1 1 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #96928c);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lg-segment:hover {
  color: var(--white, #f3f0e9);
  background: rgba(255, 255, 255, 0.05);
}

.lg-segment.is-selected {
  color: var(--white, #f3f0e9);
  background: rgba(255, 105, 42, 0.16);
  border-color: rgba(255, 105, 42, 0.5);
}

.lg-segment:focus-visible {
  outline: 2px solid #ff692a;
  outline-offset: 2px;
}

.lg-segment:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Chips ---------- */

.lg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.lg-chip {
  appearance: none;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #96928c);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lg-chip:hover {
  color: var(--white, #f3f0e9);
  border-color: rgba(255, 255, 255, 0.28);
}

.lg-chip.is-selected,
.lg-chip[aria-pressed="true"] {
  color: var(--white, #f3f0e9);
  background: rgba(255, 105, 42, 0.16);
  border-color: rgba(255, 105, 42, 0.55);
}

.lg-chip:focus-visible {
  outline: 2px solid #ff692a;
  outline-offset: 2px;
}

.lg-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Notices (warning / info) ---------- */

.lg-notice {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.lg-notice--warning {
  color: #ffb08f;
  background: rgba(239, 59, 32, 0.1);
  border: 1px solid rgba(239, 59, 32, 0.35);
}

.lg-notice--info {
  color: var(--muted, #96928c);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.13));
}

.lg-notice[hidden] {
  display: none;
}

/* ---------- Conditional fields ---------- */

.lg-conditional[hidden] {
  display: none;
}

/* ---------- Preview ---------- */

.lg-preview {
  position: static;
  min-width: 0;
}

.lg-preview-doc {
  position: relative;
  background: #f7f4ec;
  color: #1a1815;
  border-radius: 20px;
  padding: 44px 48px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.lg-preview-doc[hidden] {
  display: none;
}

.lg-constructor-status { margin: 0 0 18px; padding: 10px 12px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.lg-constructor-status.is-ready { color: #23633f; background: #e4f3e9; }
.lg-constructor-status.is-warning { color: #7a5210; background: #fff0c9; }
.lg-constructor-status.is-critical { color: #8d271f; background: #ffe0da; }
.lg-purpose-term-grid { display: grid; gap: 10px; margin: 10px 0 16px 0; padding: 12px; border: 1px solid rgba(31, 28, 24, .12); border-radius: 10px; background: rgba(255, 255, 255, .45); }
.lg-purpose-term { display: grid; gap: 6px; }
.lg-purpose-term .lg-label { font-size: 12px; }

.lg-consent-empty { display: grid; gap: 14px; padding: 8px 0 18px; }
.lg-consent-empty h3 { margin: 8px 0 0; font-size: 20px; line-height: 1.35; }
.lg-consent-empty p { margin: 0; color: #5f5a54; }
.lg-preview-doc.is-unavailable .lg-doc-actions button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.lg-doc-actions {
  position: static;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}

.lg-copy-btn,
.lg-doc-action-btn {
  appearance: none;
  border: 1px solid #d8d5ce;
  border-radius: 10px;
  background: #fffdf8;
  color: #1a1815;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.lg-copy-btn {
  background: transparent;
  border-color: transparent;
}

.lg-copy-btn:hover {
  background: rgba(255, 255, 255, 0.48);
  border-color: #d8d5ce;
}

.lg-doc-action-btn:focus-visible {
  outline: 2px solid #d84218;
  outline-offset: 2px;
}

.lg-doc-action-btn:hover {
  background: #ffffff;
  border-color: #bdb8ae;
}

.lg-copy-btn:focus-visible {
  outline: 2px solid #d84218;
  outline-offset: 2px;
}

.lg-copy-btn.is-copied {
  background: rgba(255, 255, 255, 0.68);
  border-color: #d8d5ce;
  color: #1a1815;
}

.lg-save-btn {
  background: #ff692a;
  border-color: #ff692a;
  color: #ffffff;
}

.lg-save-btn:hover,
.lg-save-btn.is-saved {
  background: #e95620;
  border-color: #e95620;
}

.lg-save-btn:focus-visible {
  outline-color: #ff692a;
}

.lg-save-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

/* ---------- Печать документа (PDF) ---------- */

@media print {
  @page {
    size: A4;
    margin: 20mm 18mm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  .site-header,
  #publicMobileMenu,
  .lg-hero,
  .lg-tabs,
  .lg-form-col,
  .page-footer,
  #lg-form-help,
  #lg-cookie-help,
  #lg-marketing-help,
  #lg-next,
  #lg-disclaimer,
  .lg-doc-actions,
  .lg-copy-btn,
  .lg-doc-action-btn,
  .lg-constructor-status {
    display: none !important;
  }

  .lg-constructor,
  .lg-main {
    padding: 0 !important;
  }

  .lg-container {
    width: auto;
  }

  .lg-layout {
    display: block;
  }

  .lg-preview {
    position: static;
  }

  .lg-preview-doc {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    background: #ffffff;
  }

  body[data-lg-print-panel] .lg-preview-doc {
    display: none !important;
  }

  body[data-lg-print-panel="panel-policy"] #panel-policy,
  body[data-lg-print-panel="panel-consent"] #panel-consent {
    display: block !important;
  }

  .lg-doc-body {
    gap: 14px;
    counter-reset: legal-section;
  }

  .lg-doc-section h3 {
    font-size: 15px;
    break-after: avoid;
  }

  .lg-doc-section h3::before {
    counter-increment: legal-section;
    content: counter(legal-section) ". ";
  }

  .lg-doc-section p,
  .lg-doc-list,
  .lg-doc-checkbox-line {
    font-size: 13px;
    line-height: 1.55;
    color: #111111;
  }

  .lg-doc-section {
    break-inside: auto;
  }

  .lg-doc-section p,
  .lg-doc-section li {
    orphans: 3;
    widows: 3;
  }

  .lg-doc-purpose {
    break-inside: avoid;
  }
}

@media (max-width: 720px) {
  .lg-field-grid,
  .lg-basis-row { grid-template-columns: 1fr; }
}

/* ---------- Документ: живой текст preview ---------- */

.lg-doc-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lg-doc-section h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.lg-doc-section p {
  margin: 0 0 6px;
  font-size: 14.5px;
  line-height: 1.6;
  color: #33302b;
}

.lg-doc-section p:last-child {
  margin-bottom: 0;
}

.lg-doc-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: #33302b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lg-doc-empty {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: #6b675f;
  font-style: italic;
}

.lg-doc-mark {
  color: #d84218;
  font-weight: 600;
}

.lg-doc-purpose {
  margin-bottom: 12px;
}

.lg-doc-purpose p {
  margin: 0 0 4px;
}

.lg-doc-card {
  background: rgba(216, 66, 24, 0.05);
  border: 1px solid rgba(216, 66, 24, 0.18);
  border-radius: 14px;
  padding: 20px 22px;
}

.lg-form-help {
  margin-top: 20px;
  padding: 22px 24px;
  color: var(--white, #f3f0e9);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
}

.lg-form-help h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.3;
}

.lg-form-help p {
  margin: 10px 0 0;
  color: #c7c1b8;
  font-size: 14px;
  line-height: 1.55;
}

.lg-form-help-checkbox {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.lg-form-help-checkbox--secondary {
  margin-top: 16px;
}

.lg-form-help-checkbox p {
  margin: 0;
  color: var(--white, #f3f0e9);
}

.lg-form-help .lg-form-help-line {
  margin: 0;
  color: var(--white, #f3f0e9);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.lg-form-help-link {
  color: #ff8a54;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lg-form-help-policy {
  overflow-wrap: anywhere;
}

.lg-cookie-banner {
  margin-top: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.lg-cookie-banner p {
  margin: 0;
  color: var(--white, #f3f0e9);
}

.lg-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.lg-cookie-action {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--white, #f3f0e9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.lg-cookie-action--primary {
  color: #ffffff;
  background: #d84218;
  border-color: #d84218;
}

#lg-next .lg-doc-card {
  margin-top: 20px;
  color: var(--white, #f3f0e9);
  background: rgba(255, 105, 42, 0.08);
  border-color: rgba(255, 105, 42, 0.28);
}

#lg-next .lg-doc-card h3 {
  color: var(--white, #f3f0e9);
}

#lg-next .lg-doc-card > h3:not(:first-child) {
  margin-top: 20px;
}

#lg-next .lg-doc-card p,
#lg-next .lg-doc-list {
  color: #c7c1b8;
}

.lg-next-link {
  color: #ff8a54;
  font-weight: 600;
}

.lg-next-legal {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.lg-doc-checkbox {
  background: #ffffff;
  border: 1px solid #d8d4cc;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0;
}

.lg-doc-checkbox-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1815;
}

.lg-doc-list--ordered {
  padding-left: 22px;
  list-style: decimal;
}

.lg-doc-disclaimer {
  margin: 18px 0 0;
  padding: 16px 20px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #aaa49b;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.lg-doc-kicker {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d84218;
}

.lg-doc-title {
  margin: 0 0 18px;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .lg-layout {
    grid-template-columns: 1fr;
  }

  .lg-preview {
    position: static;
  }

  .lg-preview-doc {
    padding: 34px 32px;
  }
}

@media (max-width: 720px) {
  .lg-hero {
    padding: 118px 0 40px;
  }

  .lg-lead {
    font-size: 15.5px;
  }

  .lg-tabs {
    grid-template-columns: 1fr;
  }

  .lg-constructor {
    padding-bottom: 80px;
  }

  .lg-block {
    padding: 20px;
  }

  .lg-preview-doc {
    padding: 26px 22px;
    border-radius: 16px;
  }

  .lg-doc-actions {
    justify-content: stretch;
  }

  .lg-copy-btn,
  .lg-doc-action-btn {
    flex: 1 1 auto;
  }

  .lg-save-btn {
    flex-basis: 100%;
  }

}

.lg-doc-date {
  margin: -4px 0 16px;
  font-size: 12px;
  color: #6b675f;
}
