/* ЗОЛОТОЙ — правовые блоки: согласие, cookie, модальные документы, расширенный футер.
   Все цвета берутся из переменных темы (см. app.js) — блоки адаптируются под палитру. */

/* ---------------- Согласие в секции «Контакты» ---------------- */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  max-width: 540px;
  margin-top: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }

.consent .box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid rgba(236, 228, 210, 0.55);
  background: rgba(236, 228, 210, 0.06);
  display: grid;
  place-items: center;
  transition: border-color 0.4s var(--ease-soft, ease), background 0.4s var(--ease-soft, ease);
}
.consent .box svg {
  width: 13px;
  height: 13px;
  stroke: #1b1810;
  stroke-width: 2.4;
  fill: none;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.consent input:checked + .box {
  background: var(--gold-photo, #c9a86e);
  border-color: var(--gold-photo, #c9a86e);
}
.consent input:checked + .box svg { opacity: 1; transform: scale(1); }
.consent input:focus-visible + .box { outline: 2px solid var(--gold-photo, #c9a86e); outline-offset: 3px; }

.consent .consent-text {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(236, 228, 210, 0.74);
  text-wrap: pretty;
}
.consent .consent-text a {
  color: rgba(236, 228, 210, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--gold-photo, #c9a86e);
  transition: color 0.3s;
}
.consent .consent-text a:hover { color: #fff; }

/* подсветка при попытке нажать кнопку без согласия */
@keyframes consentFlash {
  0%, 100% { border-color: rgba(236, 228, 210, 0.55); }
  20%, 60% { border-color: var(--gold-photo, #c9a86e); }
}
.consent.flash .box { animation: consentFlash 0.7s ease; }
.consent.flash .consent-text { color: rgba(236, 228, 210, 0.96); }

/* кнопки до согласия — слегка приглушены, но кликабельны (клик подсветит согласие) */
.contact-actions .btn.is-locked { opacity: 0.5; }

/* ---------------- Cookie-баннер ---------------- */

.cookie {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(28px);
  z-index: 880;
  width: min(880px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 17px 22px;
  background: color-mix(in srgb, var(--bg-card) 90%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 50px -22px rgba(17, 15, 9, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-soft, ease), transform 0.7s var(--ease-expo, cubic-bezier(0.16, 1, 0.3, 1));
}
.cookie.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

.cookie-ico { flex: none; width: 26px; height: 26px; color: var(--gold); opacity: 0.85; }
.cookie-ico svg { width: 100%; height: 100%; display: block; }

.cookie-text {
  flex: 1;
  font-family: var(--body);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}
.cookie-text a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--gold);
  transition: color 0.3s;
}
.cookie-text a:hover { color: var(--gold-bright); }

.cookie-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.cookie .btn { padding: 12px 24px; font-size: 10.5px; }
.cookie-dismiss {
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-muted);
  line-height: 0;
  transition: color 0.3s, transform 0.3s;
}
.cookie-dismiss:hover { color: var(--text); transform: rotate(90deg); }
.cookie-dismiss svg { width: 16px; height: 16px; }

/* ---------------- Модальное окно правовых документов ---------------- */

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 5vh, 72px) 16px;
  background: rgba(14, 12, 7, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-soft, ease), visibility 0.45s;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.legal-modal.open { opacity: 1; visibility: visible; }

/* блокировка прокрутки фона при открытом окне */
html.legal-lock, body.legal-lock { overflow: hidden; }

.legal-panel {
  position: relative;
  width: min(760px, 100%);
  margin: auto 0;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px -40px rgba(10, 8, 4, 0.8);
  transform: translateY(26px) scale(0.985);
  opacity: 0;
  transition: transform 0.6s var(--ease-expo, cubic-bezier(0.16, 1, 0.3, 1)), opacity 0.5s ease;
}
.legal-modal.open .legal-panel { transform: translateY(0) scale(1); opacity: 1; }

.legal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 30px clamp(26px, 5vw, 52px) 22px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.legal-head .kicker {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 11px;
}
.legal-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.08;
  color: var(--text);
}
.legal-close {
  flex: none;
  width: 42px;
  height: 42px;
  margin-top: -2px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.35s, color 0.35s, transform 0.4s var(--ease-expo, ease), border-color 0.35s;
}
.legal-close:hover { background: var(--text); color: var(--bg); transform: rotate(90deg); }
.legal-close svg { width: 18px; height: 18px; }

.legal-body {
  padding: 30px clamp(26px, 5vw, 52px) clamp(40px, 6vw, 60px);
}
.legal-lang-note {
  margin-bottom: 26px;
  padding: 11px 16px;
  border-left: 2px solid var(--gold);
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
html[lang="ru"] .legal-lang-note { display: none; }

.legal-doc { display: none; }
.legal-doc.active { display: block; }

.legal-doc .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.legal-doc h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  color: var(--text);
  margin: 30px 0 11px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.legal-doc h3:first-of-type { margin-top: 0; }
.legal-doc h3 .n {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0;
}
.legal-doc p,
.legal-doc li {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-muted);
  text-wrap: pretty;
}
.legal-doc p { margin-bottom: 13px; }
.legal-doc p strong, .legal-doc li strong { color: var(--text); font-weight: 600; }
.legal-doc ul { list-style: none; padding: 0; margin: 0 0 13px; }
.legal-doc ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
}
.legal-doc ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}
.legal-doc a { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 2px; }

/* Карточка реквизитов */
.req-card {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: clamp(20px, 3vw, 30px);
}
.req-card dl {
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr;
  gap: 0;
  margin: 0;
}
.req-card dt,
.req-card dd {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  margin: 0;
}
.req-card dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-right: 20px;
}
.req-card dd {
  font-family: var(--body);
  font-size: 15px;
  color: var(--text);
  text-align: right;
}
.req-card dl > dt:last-of-type,
.req-card dl > dd:last-of-type { border-bottom: none; }
.req-card .req-name {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--text);
  margin-bottom: 4px;
}
.req-card .req-full {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

/* ---------------- Расширенный футер ---------------- */

.footer-legal {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}
.footer-links .flink {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  transition: color 0.35s;
}
.footer-links .flink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-expo, ease);
}
.footer-links .flink:hover { color: var(--text); }
.footer-links .flink:hover::after { transform: scaleX(1); }

.footer-company {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-disclaimer {
  font-family: var(--body);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
  opacity: 0.78;
  max-width: 86ch;
  text-wrap: pretty;
}

/* Арабская вязь — без разрядки/капители на новых моно-подписях */
html[lang="ar"] .footer-links .flink,
html[lang="ar"] .footer-company,
html[lang="ar"] .legal-head .kicker,
html[lang="ar"] .legal-doc .meta,
html[lang="ar"] .req-card dt { letter-spacing: 0; text-transform: none; }

/* RTL: реквизиты и закрытие */
html[dir="rtl"] .req-card dd { text-align: left; }
html[dir="rtl"] .legal-doc ul li { padding-left: 0; padding-right: 22px; }
html[dir="rtl"] .legal-doc ul li::before { left: auto; right: 2px; }
html[dir="rtl"] .legal-lang-note { border-left: none; border-right: 2px solid var(--gold); }

/* ---------------- Адаптив ---------------- */

@media (max-width: 720px) {
  .cookie {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    bottom: 12px;
    padding: 18px;
  }
  .cookie-actions { justify-content: space-between; }
  .cookie .btn { flex: 1; text-align: center; justify-content: center; }
  .req-card dl { grid-template-columns: 1fr; }
  .req-card dt { padding-bottom: 2px; border-bottom: none; }
  .req-card dd { text-align: left; padding-top: 2px; }
  html[dir="rtl"] .req-card dd { text-align: right; }
  .legal-head { padding: 24px 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie, .legal-modal, .legal-panel,
  .consent .box, .consent .box svg { transition: none; }
  .consent.flash .box { animation: none; }
}
