:root {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color-scheme: light;
  line-height: 1.6;
  --page-bg: radial-gradient(circle at top, #fefbff 0%, #f6f7fb 50%, #eef0f6 100%);
  --text-color: #0c1324;
  --text-color-rgb: 12, 19, 36;
  --muted-text: rgba(14, 18, 40, 0.6);
  --panel-bg: #ffffff;
  --panel-shadow: 0 25px 80px rgba(11, 15, 45, 0.1);
  --nav-shadow: 0 12px 35px rgba(15, 21, 56, 0.1);
  --hero-gradient: linear-gradient(135deg, #5d4bff, #b44bff);
  --hero-text: #ffffff;
  --primary: #4d3cff;
  --primary-soft: rgba(77, 60, 255, 0.08);
  --card-bg: rgb(246, 247, 251);
  --border-color: rgba(77, 60, 255, 0.1);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: radial-gradient(circle at top, #050507 0%, #090c11 45%, #0f1421 100%);
  --text-color: #f4f6ff;
  --text-color-rgb: 244, 246, 255;
  --muted-text: rgba(244, 246, 255, 0.65);
  --panel-bg: #121727;
  --panel-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  --nav-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  --hero-gradient: linear-gradient(135deg, #3f36c7, #9b37cf);
  --hero-text: #f8f7ff;
  --primary: #91a8ff;
  --primary-soft: rgba(145, 168, 255, 0.12);
  --card-bg: rgba(255, 255, 255, 0.04);
  --border-color: rgba(145, 168, 255, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text-color);
  transition: background 0.3s ease, color 0.3s ease;
}

.legal-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.hero {
  position: relative;
  padding: 72px 32px 32px;
  text-align: center;
  background: var(--hero-gradient);
  color: var(--hero-text);
  border-radius: 32px;
  box-shadow: 0 25px 55px rgba(93, 75, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  margin: 0 0 10px;
  opacity: 0.8;
}

.hero h1 {
  margin: 10px 0 0;
  font-size: clamp(2.2rem, 5.8vw, 3.1rem);
  line-height: 1.15;
}

.hero-intro {
  margin: 18px auto 0;
  max-width: 680px;
  font-size: 1.05rem;
  opacity: 0.95;
}

.last-updated {
  margin-top: 20px;
  font-size: 0.95rem;
  opacity: 0.85;
}

.hero-controls {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
  z-index: 1;
}

/* Controls */
.hero-controls {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
  z-index: 1;
}

.control-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 7px 3px 3px;
  width: var(--control-width, 240px);
  max-width: 100%;
  border-radius: 999px;
  background: rgba(8, 4, 42, 0.25);
  box-shadow: 0 12px 30px rgba(6, 2, 24, 0.35);
}

.control-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.language-control {
  --control-width: 240px;
  min-width: 180px;
  max-width: 240px;
}

.language-select-shell {
  position: relative;
  width: 100%;
  display: block;
  flex: 1;
  min-width: 0;
}

.language-select-shell select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  border: none;
  background: none;
  appearance: none;
}

.language-select__display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 34px 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: var(--hero-text);
  min-height: 34px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 40px rgba(15, 5, 60, 0.35);
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.language-select-shell:focus-within .language-select__display {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 55px rgba(15, 5, 60, 0.45);
}

.language-select__caret {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--hero-text);
  border-bottom: 2px solid var(--hero-text);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
  opacity: 0.8;
}

.theme-control {
  --control-width: 240px;
  min-width: 180px;
  max-width: 240px;
}

.theme-toggle {
  --toggle-width: 100%;
  --toggle-height: 34px;
  --toggle-padding: 4px;
  --toggle-knob: 22px;
  position: relative;
  width: var(--toggle-width);
  height: var(--toggle-height);
  border: none;
  background: transparent;
  color: var(--hero-text);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
  overflow: visible;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 15px 35px rgba(7, 2, 25, 0.45);
  transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

body[data-theme="dark"] .theme-toggle::before {
  background: rgba(5, 8, 30, 0.4);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle__thumb {
  position: absolute;
  top: 50%;
  left: var(--toggle-padding);
  width: var(--toggle-knob);
  height: var(--toggle-knob);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe06d, #ff9f43);
  box-shadow: 0 6px 20px rgba(255, 224, 109, 0.9);
  transition: left 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
  transform: translateY(-50%);
}

body[data-theme="dark"] .theme-toggle__thumb {
  left: calc(100% - var(--toggle-knob) - var(--toggle-padding));
  background: radial-gradient(circle at 30% 30%, #fff4dd 0%, #cbd6ff 55%, #6a7bd1 100%);
  box-shadow: 0 8px 26px rgba(111, 135, 255, 0.75);
}

.theme-toggle__label {
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 0.95rem;
  pointer-events: none;
  width: 100%;
  text-align: left;
  padding: 0 calc(var(--toggle-knob) + 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legal-nav {
  margin: 32px auto;
  padding: 8px;
  border-radius: 16px;
  background: var(--panel-bg);
  box-shadow: var(--nav-shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.legal-nav a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.legal-nav a:hover,
.legal-nav a:focus-visible {
  background: var(--primary-soft);
  outline: none;
}

.legal-nav a[aria-current="page"] {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 25px rgba(76, 60, 255, 0.35);
}

.content {
  background: var(--panel-bg);
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: var(--panel-shadow);
}

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

.legal-section h2 {
  font-size: 1.6rem;
  margin: 0 0 12px;
  color: var(--text-color);
}

.legal-rich-text p {
  margin: 0 0 12px;
  color: rgba(var(--text-color-rgb, 12, 19, 36), 0.9);
  font-size: 1.03rem;
}

.legal-rich-text ul,
.legal-rich-text ol {
  padding-left: 24px;
  margin: 0 0 14px;
  color: rgba(var(--text-color-rgb, 12, 19, 36), 0.9);
}

.legal-rich-text li {
  margin: 4px 0;
}

.legal-rich-text a {
  color: var(--primary);
  text-decoration: underline;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 26px 0;
}

.info-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
}

.info-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.info-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.legal-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--muted-text);
}

.legal-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.noscript-message {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
  text-align: center;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .hero {
    padding: 48px 18px 24px;
  }

  .hero-controls {
    position: static;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    text-align: left;
    margin-bottom: 16px;
  }

  .control-pill {
    width: 100%;
    align-self: flex-start;
    padding: 6px 10px;
  }

  .language-control,
  .theme-control {
    max-width: none;
  }

  .language-control__icon,
  .theme-control__icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }

  .language-select__display {
    min-height: 40px;
  }

  .language-select-shell {
    max-width: none;
    width: 100%;
  }

  .theme-control .theme-toggle {
    --toggle-width: 100%;
    --toggle-height: 40px;
    --toggle-knob: 28px;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .hero {
    border-radius: 22px;
    padding: 32px 18px 18px;
  }

  .content {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .legal-shell {
    padding: 24px 16px 48px;
  }
}
