@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;500;700&display=swap');

.legal-page,
.legal-page * {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f7fb;
  color: #182432;
  font-family: 'Roboto Slab', Georgia, 'Times New Roman', serif;
  text-rendering: optimizeLegibility;
}

.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(83, 93, 161, 0.12), transparent 34rem),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
}

.legal-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.legal-hero,
.legal-card,
.cookie-consent-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(24, 36, 50, 0.1);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(18, 35, 52, 0.08);
}

.legal-hero {
  padding: 36px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.legal-hero::after {
  content: "";
  position: absolute;
  right: -54px;
  top: -64px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(20, 183, 137, 0.12);
  pointer-events: none;
}

.legal-eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 11px;
  border-radius: 8px;
  color: #0d5b5f;
  background: rgba(18, 122, 127, 0.12);
  font-size: 0.86rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.legal-hero h1 {
  margin: 0 0 12px;
  color: #182432;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}

.legal-hero p,
.legal-card p,
.legal-card li,
.legal-card td,
.legal-card th {
  color: #5e6c79;
  line-height: 1.7;
}

.legal-hero p {
  max-width: 760px;
  margin: 0;
  position: relative;
  z-index: 1;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.legal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(24, 36, 50, 0.1);
  border-radius: 8px;
  background: #fff;
  color: #182432;
  font-size: 0.9rem;
  font-weight: 700;
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.legal-nav {
  position: sticky;
  top: 96px;
  padding: 18px;
}

.legal-nav a,
.legal-doc-link {
  display: block;
  color: #0d5b5f;
  font-weight: 700;
  text-decoration: none;
}

.legal-nav a {
  padding: 9px 10px;
  border-radius: 8px;
}

.legal-nav a:hover,
.legal-doc-link:hover {
  background: rgba(18, 122, 127, 0.08);
  text-decoration: none;
}

.legal-card {
  padding: 28px;
  margin-bottom: 18px;
}

.legal-card h2 {
  margin: 0 0 14px;
  color: #182432;
  font-size: 1.45rem;
}

.legal-card h3 {
  margin: 20px 0 10px;
  color: #182432;
  font-size: 1.08rem;
}

.legal-card ul,
.legal-card ol {
  padding-left: 1.25rem;
}

.legal-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.legal-card th,
.legal-card td {
  padding: 12px;
  border: 1px solid rgba(24, 36, 50, 0.1);
  text-align: left;
  vertical-align: top;
}

.legal-card th {
  color: #182432;
  background: rgba(18, 122, 127, 0.08);
}

.legal-region-control {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px;
  margin-bottom: 18px;
}

.legal-region-control label {
  color: #182432;
  font-weight: 700;
}

.legal-region-control select {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(24, 36, 50, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #182432;
}

.legal-region-control select:focus,
.legal-toggle-all:focus,
.lang-flag-btn:focus {
  outline: 3px solid rgba(83, 93, 161, 0.22);
  outline-offset: 2px;
}

.language-selector.language-flags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lang-flag-btn {
  min-width: 46px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(24, 36, 50, 0.14);
  border-radius: 8px;
  background: #fff;
  color: #182432;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-flag-btn:hover,
.lang-flag-btn.active,
.lang-flag-btn[aria-pressed="true"] {
  border-color: #0d5b5f;
  background: rgba(18, 122, 127, 0.10);
  color: #0d5b5f;
}

.legal-region-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.94rem;
}

.region-panel {
  display: none;
  border-left: 4px solid #127a7f;
}

body[data-legal-region="kz"] .region-panel[data-region="kz"],
body[data-legal-region="eu"] .region-panel[data-region="eu"],
body[data-legal-region="uk"] .region-panel[data-region="uk"],
body[data-legal-region="us"] .region-panel[data-region="us"],
body[data-legal-region="other"] .region-panel[data-region="other"],
body[data-legal-show-all-regions="true"] .region-panel {
  display: block;
}

.legal-toggle-all {
  border: 1px solid #0d5b5f;
  border-radius: 8px;
  background: transparent;
  color: #0d5b5f;
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.legal-toggle-all:hover {
  background: rgba(18, 122, 127, 0.08);
}

.legal-checkout-waiver {
  padding: 18px;
  border: 1px solid rgba(18, 122, 127, 0.3);
  border-radius: 8px;
  background: rgba(18, 122, 127, 0.08);
}

.legal-checkout-waiver label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #182432;
  font-weight: 700;
  line-height: 1.55;
}

.legal-checkout-waiver input {
  margin-top: 4px;
}

.legal-pay-button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.cookie-consent-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(460px, calc(100% - 36px));
  padding: 20px;
}

.cookie-consent-panel h2 {
  margin: 0 0 8px;
  color: #182432;
  font-size: 1.1rem;
}

.cookie-consent-panel p {
  margin: 0 0 14px;
  color: #5e6c79;
  line-height: 1.55;
}

.cookie-consent-actions,
.cookie-preference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cookie-consent-actions button,
.cookie-preference-list button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #0d5b5f;
  font-weight: 700;
}

.cookie-primary {
  background: #0d5b5f;
  color: #fff;
}

.cookie-secondary {
  background: #fff;
  color: #0d5b5f;
}

.cookie-preference-list {
  display: none;
  margin-top: 14px;
}

.cookie-consent-panel.is-customizing .cookie-preference-list {
  display: grid;
  grid-template-columns: 1fr;
}

.cookie-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid rgba(24, 36, 50, 0.1);
  border-radius: 8px;
}

@media (max-width: 991px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-nav {
    position: static;
  }
}

@media (max-width: 640px) {
  .legal-shell {
    width: min(100% - 20px, 1040px);
    padding: 36px 0 52px;
  }

  .legal-hero,
  .legal-card {
    padding: 22px;
  }

  .legal-region-control {
    align-items: stretch;
  }

  .legal-region-control label,
  .legal-region-control select,
  .legal-toggle-all,
  .language-selector.language-flags {
    width: 100%;
  }

  .lang-flag-btn {
    flex: 1;
  }
}
