:root {
  --navy: #1a2b56;
  --beige: #efd9cb;
  --paper: #fff9f5;
  --line: rgba(26, 43, 86, 0.16);
  --serif: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --sans: Verdana, Geneva, "DejaVu Sans", sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--beige);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.legal-header {
  position: sticky;
  z-index: 5;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(239, 217, 203, 0.96);
  backdrop-filter: blur(12px);
}

.legal-header__inner,
.legal-main,
.legal-footer__inner {
  width: min(calc(100% - 40px), 980px);
  margin-inline: auto;
}

.legal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.legal-wordmark {
  text-decoration: none;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.legal-back {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.legal-main { padding: clamp(44px, 8vw, 92px) 0 80px; }

.legal-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-main h1 {
  max-width: 840px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-wrap: balance;
}

.legal-revision {
  margin: 0 0 30px;
  color: rgba(26, 43, 86, 0.7);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.legal-toc {
  max-width: 820px;
  margin: 0 0 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 249, 245, 0.52);
}

.legal-toc summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.legal-toc ol {
  columns: 2;
  gap: 36px;
  margin: 18px 0 2px;
  padding-left: 20px;
}

.legal-toc li {
  break-inside: avoid;
  margin: 0 0 7px;
  padding-left: 3px;
  color: rgba(26, 43, 86, 0.72);
  font-size: 15px;
}

.legal-toc a { text-underline-offset: 3px; }

.legal-draft {
  margin: 0 0 38px;
  padding: 16px 18px;
  border: 1px solid rgba(26, 43, 86, 0.28);
  border-radius: 12px;
  background: rgba(255, 249, 245, 0.55);
  font-size: 12px;
  font-weight: 700;
}

.legal-content {
  max-width: 820px;
  padding: clamp(24px, 5vw, 52px);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(26, 43, 86, 0.08);
}

.legal-content h2 {
  scroll-margin-top: 92px;
  margin: 38px 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li {
  color: rgba(26, 43, 86, 0.79);
  font-size: 17px;
  overflow-wrap: anywhere;
}
.legal-content p { margin: 0 0 15px; }
.legal-content ul, .legal-content ol { margin: 0 0 20px; padding-left: 24px; }
.legal-content li + li { margin-top: 6px; }
.legal-content strong { color: var(--navy); }

.legal-requisites {
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--navy);
  line-height: 1.9;
}

.legal-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 820px;
  margin-top: 20px;
}

.legal-docs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 249, 245, 0.45);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.legal-docs a[aria-current="page"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.legal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 19px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  background: var(--navy);
  color: var(--paper);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.legal-button--ghost { background: transparent; color: var(--navy); }

.legal-footer { padding: 26px 0; border-top: 1px solid var(--line); font-size: 14px; }
.legal-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }

.status-card {
  position: relative;
  display: grid;
  align-content: center;
  min-height: calc(100dvh - 68px);
  overflow: hidden;
  text-align: center;
}
.status-card::before,
.status-card::after {
  position: absolute;
  z-index: -1;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(26, 43, 86, 0.09);
  border-radius: 50%;
  content: "";
}
.status-card::before { top: 5%; left: -220px; }
.status-card::after { right: -230px; bottom: 0; }
.status-card h1 { margin-inline: auto; }
.status-card .legal-content {
  position: relative;
  width: min(100%, 660px);
  margin-inline: auto;
  border: 1px solid rgba(26, 43, 86, 0.14);
  box-shadow: 0 26px 80px rgba(26, 43, 86, 0.09);
}
.status-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border: 1px solid var(--navy);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 30px;
  transition: color 240ms ease, background-color 240ms ease, transform 240ms ease;
}
.status-proof {
  display: inline-flex;
  margin: 0 auto 16px !important;
  padding: 7px 11px;
  border: 1px solid rgba(26, 43, 86, 0.18);
  border-radius: 999px;
  font-size: 8px !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-proof[hidden] { display: none; }
.status-spam-warning {
  margin: 18px 0 0 !important;
  padding: 14px 16px;
  border: 1px solid rgba(140, 46, 46, 0.24);
  border-radius: 14px;
  background: rgba(140, 46, 46, 0.06);
  color: #6f2525;
  font-size: 13px !important;
  line-height: 1.55 !important;
  text-align: left;
}
.status-spam-warning strong { color: #511b1b; }
.status-spam-warning[hidden] { display: none; }
.status-detail { margin: 18px 0; padding: 14px; border-block: 1px solid var(--line); text-align: left; }
.status-detail p { margin: 5px 0; overflow-wrap: anywhere; }
.status-retry { margin-top: 12px; cursor: pointer; font-family: var(--sans); }
.status-retry[hidden] { display: none; }
.status-card .legal-actions { justify-content: center; }

html[data-payment-state="confirmed"] .status-mark {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
  animation: status-confirmed 500ms ease both;
}

html[data-payment-state="failed"] .status-mark,
html[data-payment-state="attention"] .status-mark {
  border-color: #8c2e2e;
  color: #8c2e2e;
}

@keyframes status-confirmed {
  0% { opacity: 0; transform: scale(0.72); }
  70% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.stub-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.stub-action {
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font: 700 11px/1.2 var(--sans);
}

.stub-action--success { background: var(--navy); color: var(--paper); }
.stub-action:disabled { cursor: wait; opacity: 0.45; }
.stub-error { color: #7a2727 !important; font-weight: 700; }

@media (max-width: 600px) {
  .legal-header__inner, .legal-main, .legal-footer__inner { width: min(calc(100% - 28px), 980px); }
  .legal-main { padding-top: 38px; }
  .legal-main h1 { font-size: clamp(38px, 11vw, 44px); }
  .legal-revision { margin-bottom: 22px; }
  .legal-toc { padding: 14px 16px; }
  .legal-toc ol { columns: 1; }
  .legal-content { padding: 24px 18px; border-radius: 15px; }
  .legal-content p, .legal-content li { font-size: 13px; }
  .legal-content h2 { font-size: 30px; }
  .legal-docs { display: grid; }
  .legal-docs a { justify-content: center; }
  .legal-actions { display: grid; }
  .stub-actions { grid-template-columns: 1fr; }
}
