:root {
  --paper: #f5e6c9;
  --paper-deep: #ead2aa;
  --paper-light: #fff8eb;
  --ink: #5b4333;
  --muted: #8e7560;
  --line: rgba(111, 79, 52, 0.22);
  --accent: #7b6d48;
  --accent-soft: #e3d3af;
  --danger: #9c5d53;
  color-scheme: light;
  font-family: "Mali", cursive;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #e8d0a9;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.35), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(255,248,225,.42), transparent 26%),
    repeating-linear-gradient(
      0deg,
      rgba(105, 72, 42, .022) 0,
      rgba(105, 72, 42, .022) 1px,
      transparent 1px,
      transparent 4px
    ),
    #e7cda5;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(123, 94, 58, .45);
  outline-offset: 3px;
}

.legal-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    14px
    max(30px, env(safe-area-inset-bottom));
}

.legal-paper {
  position: relative;
  overflow: hidden;
  padding: 28px clamp(18px, 5vw, 54px) 34px;
  border: 1px solid rgba(113, 80, 51, .28);
  border-radius: 30px;
  background:
    radial-gradient(circle at 85% 8%, rgba(255,255,255,.48), transparent 22%),
    repeating-linear-gradient(
      90deg,
      rgba(99, 69, 40, .018) 0,
      rgba(99, 69, 40, .018) 1px,
      transparent 1px,
      transparent 5px
    ),
    var(--paper);
  box-shadow: 0 22px 48px rgba(74, 48, 27, 0.16);
}

.legal-paper::before {
  content: "";
  position: absolute;
  inset: 9px;
  pointer-events: none;
  border: 1px solid rgba(112, 76, 45, .12);
  border-radius: 23px;
}

.legal-header,
.legal-content,
.legal-footer,
.legal-note {
  position: relative;
  z-index: 1;
}

.legal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

h1 {
  margin: 0;
  font-family: "Mali", cursive;
  font-size: clamp(32px, 7vw, 54px);
  line-height: 1.05;
  font-weight: 600;
}

.subtitle {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.language-switcher {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(113, 80, 51, .2);
  border-radius: 999px;
  background: rgba(255, 247, 232, .58);
}

.language-button {
  min-width: 42px;
  min-height: 34px;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.language-button.is-active {
  background: var(--accent);
  color: #fff8e9;
  box-shadow: 0 3px 9px rgba(82, 58, 34, .16);
}

.language-divider {
  color: rgba(111, 79, 52, .33);
  font-size: 12px;
}

.legal-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(126, 91, 55, .2);
  border-radius: 16px;
  background: rgba(255, 248, 234, .64);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.legal-content {
  padding-top: 10px;
}

.legal-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.legal-section:last-child {
  border-bottom: 0;
}

.legal-section h2 {
  margin: 0 0 10px;
  font-family: "Mali", cursive;
  font-size: clamp(21px, 4vw, 27px);
  line-height: 1.35;
  font-weight: 700;
}

.legal-section h3 {
  margin: 18px 0 7px;
  font-size: 16px;
}

.legal-section p,
.legal-section li {
  color: #654f3e;
  font-size: 15px;
  line-height: 1.78;
}

.legal-section p {
  margin: 8px 0;
}

.legal-section ul,
.legal-section ol {
  margin: 9px 0 0;
  padding-left: 24px;
}

.legal-section li + li {
  margin-top: 7px;
}

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

.summary-card {
  padding: 14px;
  border: 1px solid rgba(112, 82, 54, .17);
  border-radius: 15px;
  background: rgba(255, 248, 235, .6);
}

.summary-card strong {
  display: block;
  margin-bottom: 5px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.contact-card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(112, 82, 54, .2);
  border-radius: 16px;
  background: #f9ecd4;
}

.contact-card strong {
  display: block;
  margin-bottom: 7px;
}

.contact-card p {
  margin: 3px 0;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 12px;
}

.legal-footer a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

[data-language-panel] {
  display: none;
}

[data-language-panel].is-active {
  display: block;
}

@media (max-width: 560px) {
  .legal-shell {
    padding-inline: 8px;
  }

  .legal-paper {
    padding: 23px 16px 28px;
    border-radius: 25px;
  }

  .legal-header {
    gap: 10px;
  }

  .language-switcher {
    gap: 3px;
    padding: 4px 5px;
  }

  .language-button {
    min-width: 36px;
    padding-inline: 7px;
    font-size: 12px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .legal-shell {
    width: 100%;
    padding: 0;
  }

  .legal-paper {
    border: 0;
    box-shadow: none;
  }

  .language-switcher,
  .legal-footer {
    display: none;
  }
}
