/* 10-legal.css — IVILOVE LEGAL — LIGHT MODERN */

:root {
  --bg: #efefef;
  --bg-soft: #f5f5f5;
  --bg-card: rgba(255, 255, 255, 0.62);
  --bg-card-strong: rgba(255, 255, 255, 0.88);

  --ink: #202020;
  --ink-2: #4c4c4c;
  --ink-3: #7b7b7b;

  --line: rgba(32, 32, 32, 0.09);
  --line-strong: rgba(32, 32, 32, 0.16);
  --line-soft: rgba(255, 255, 255, 0.44);

  --accent: #ff4d4d;
  --accent-hover: #ff0000;
  --accent-soft: rgba(255, 106, 0, 0.10);

  --accent-2: #ff4d4d;
  --accent-2-soft: rgba(124, 77, 255, 0.10);

  --shadow-xs: 0 8px 18px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 14px 30px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 22px 54px rgba(0, 0, 0, 0.08);

  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;

  --maxw: 1240px;
  --page-bottom: 34px;

  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body.legalPage {
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  background:
    radial-gradient(circle at 15% 14%, rgba(255,255,255,.82) 0 180px, transparent 360px),
    radial-gradient(circle at 85% 12%, rgba(124,77,255,.045) 0 140px, transparent 320px),
    radial-gradient(circle at 82% 80%, rgba(255,106,0,.05) 0 180px, transparent 360px),
    linear-gradient(180deg, #f0f0f0 0%, #ebebeb 100%);
  padding:
    calc(14px + var(--sat))
    calc(14px + var(--sar))
    calc(16px + var(--sab) + var(--page-bottom))
    calc(14px + var(--sal));
}

body.legalPage::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.28),
    rgba(255,255,255,0) 26%,
    rgba(255,255,255,.24) 100%
  );
}

body.legalPage::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .35;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 96px,
      rgba(0,0,0,.018) 96px,
      rgba(0,0,0,.018) 97px
    );
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* WRAP */

.legalWrap {
  width: min(var(--maxw), 100%);
  margin-inline: auto;
  padding-bottom: var(--page-bottom);
}

/* TOPBAR */

.legalTopbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  box-shadow:
    0 12px 30px rgba(0,0,0,.05),
    inset 0 1px 0 rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.legalBrand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.legalLogo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: var(--shadow-xs);
}

.legalLogo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.legalBrandMeta {
  min-width: 0;
}

.legalBrandTitle {
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.legalBrandSub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legalTopbarActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* BUTTONS */

.legalBtn {
  appearance: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,247,249,.92));
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow:
    0 8px 18px rgba(0,0,0,.05),
    inset 0 1px 0 rgba(255,255,255,.88);
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    color .18s ease,
    background .18s ease;
}

.legalBtn:active {
  transform: translateY(1px);
}

.legalBtn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.92),
    0 0 0 6px rgba(124,77,255,.16);
}

@media (hover:hover) {
  .legalBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0,0,0,.08);
  }
}

.legalBtn--primary {
  background: var(--accent);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(255,106,0,.20);
}

.legalBtn--primary:hover {
  background: var(--accent-hover);
}

.legalBtn--ghost:hover {
  border-color: var(--line-strong);
  color: var(--accent-2);
}

/* NAV */

.legalNav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.legalChip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  box-shadow:
    0 8px 18px rgba(0,0,0,.04),
    inset 0 1px 0 rgba(255,255,255,.88);
  transition:
    transform .16s ease,
    border-color .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    background .16s ease;
}

.legalChip:active {
  transform: translateY(1px);
}

@media (hover:hover) {
  .legalChip:hover {
    transform: translateY(-1px);
    border-color: rgba(124,77,255,.20);
    color: var(--accent-2);
    background: rgba(255,255,255,.95);
  }
}

.legalChip.is-active {
  background: rgba(255, 77, 77, 0.08);
  color: var(--accent-2);
  border-color: rgba(255, 77, 77, 0.16);
}

/* MAIN */

.legalMain {
  margin-top: 12px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-card-strong);
  box-shadow:
    0 14px 34px rgba(0,0,0,.05),
    inset 0 1px 0 rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.legalTitle {
  margin: 0;
  font-weight: 800;
  letter-spacing: -.03em;
  font-size: 30px;
  color: var(--ink);
  line-height: 1.04;
}

.legalMeta {
  margin-top: 8px;
  color: var(--ink-3);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.legalMetaDot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 77, 77, 0.35);
  display: inline-block;
}

/* CONTENT */

.legalContent {
  margin-top: 16px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.68;
  color: rgba(20,20,26,.92);
  overflow-wrap: anywhere;
}

.legalContent h2 {
  font-size: 18px;
  margin: 22px 0 10px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}

.legalContent h3 {
  font-size: 15px;
  margin: 16px 0 6px;
  font-weight: 700;
  color: var(--ink);
}

.legalContent p {
  margin: 0 0 10px;
}

.legalContent ul,
.legalContent ol {
  margin: 0 0 10px 18px;
  padding: 0;
}

.legalContent li {
  margin: 6px 0;
}

.legalContent a {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(124,77,255,.20);
}

.legalContent a:hover {
  text-decoration-style: solid;
  text-decoration-color: var(--accent-2);
}

.legalContent .note {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124,77,255,.12);
  background: rgba(255,255,255,.72);
  color: rgba(20,20,26,.88);
}

.legalContent code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(124,77,255,.12);
  background: rgba(255,255,255,.82);
  color: rgba(20,20,26,.88);
  white-space: nowrap;
}

.legalContent .requisitesGrid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px 14px;
  align-items: start;
}

.legalContent .rk {
  color: var(--ink-3);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
  padding-top: 2px;
}

.legalContent .rv {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  min-width: 0;
  color: rgba(20,20,26,.92);
}

/* FOOTER */

.legalFooter {
  margin-top: 16px;
  padding: 14px 4px 0;
  color: var(--ink-3);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(124,77,255,.10);
}

.legalFooter a {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(124,77,255,.20);
}

.legalFooter a:hover {
  text-decoration-style: solid;
  text-decoration-color: var(--accent-2);
}

.legalPageSpacer {
  height: 1px;
  padding-bottom: calc(var(--page-bottom) + var(--sab));
}

/* RESPONSIVE */

@media (max-width: 760px) {
  :root {
    --page-bottom: 40px;
  }

  body.legalPage {
    min-height: 100dvh;
    padding:
      calc(10px + var(--sat))
      calc(10px + var(--sar))
      calc(12px + var(--sab) + var(--page-bottom))
      calc(10px + var(--sal));
  }

  .legalTitle {
    font-size: 24px;
  }

  .legalTopbar {
    flex-wrap: wrap;
    border-radius: 22px;
  }

  .legalTopbarActions {
    width: 100%;
  }

  .legalBtn {
    width: 100%;
  }

  .legalMain {
    padding: 16px 14px;
    border-radius: 22px;
  }

  .legalContent .requisitesGrid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .legalFooter {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legalBtn,
  .legalChip {
    transition: none !important;
  }
}

/* LEGAL LINKS NAV — /views/partials/legal-links.php */

.legalLinks {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 26px;
  padding: 14px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(32, 32, 32, .09);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .055);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.legalLinks::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .48);
}

.legalLinks a {
  position: relative;
  z-index: 1;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .52);
  border: 1px solid rgba(32, 32, 32, .08);
  color: #202020;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform .24s cubic-bezier(.2, .8, .2, 1),
    background .24s cubic-bezier(.2, .8, .2, 1),
    border-color .24s cubic-bezier(.2, .8, .2, 1),
    color .24s cubic-bezier(.2, .8, .2, 1),
    box-shadow .24s cubic-bezier(.2, .8, .2, 1);
}

.legalLinks a i {
  color: #ff4d4d;
  font-size: 15px;
  line-height: 1;
  opacity: .9;
}

.legalLinks a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .82);
  border-color: rgba(255, 77, 77, .22);
  color: #ff4d4d;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .045);
}

.legalLinks a:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, .92),
    0 0 0 6px rgba(255, 77, 77, .16);
}

.legalLinks a.is-active {
  background: rgba(255, 77, 77, .10);
  border-color: rgba(255, 77, 77, .30);
  color: #ff4d4d;
  box-shadow:
    0 10px 24px rgba(255, 77, 77, .10),
    inset 0 1px 0 rgba(255, 255, 255, .72);
}

.legalLinks a.is-active i {
  color: #ff4d4d;
  opacity: 1;
}

/* LEGAL LINKS RESPONSIVE */

@media (max-width: 760px) {
  .legalLinks {
    gap: 8px;
    margin: 18px 0 22px;
    padding: 12px;
    border-radius: 24px;
  }

  .legalLinks a {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
    gap: 8px;
  }

  .legalLinks a i {
    font-size: 14px;
  }
}

@media (max-width: 560px) {
  .legalLinks {
    display: grid;
    grid-template-columns: 1fr;
  }

  .legalLinks a {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 14px;
  }
}