/* Legal pages — Privacy Policy (reference layout) */

body.page-legal {
  background: #f3f5f4;
  background: linear-gradient(180deg, #f5f7f6 0%, #eef1ef 100%);
}

.legal-page {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) 24px clamp(64px, 8vw, 96px);
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(20px, 3vw, 28px);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent1);
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-back:hover {
  color: var(--accent-mid);
}

.legal-back svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Hero card */
.legal-hero-card {
  padding: clamp(28px, 4vw, 40px);
  margin-bottom: clamp(32px, 5vw, 48px);
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.legal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
}

.legal-hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #e8f3ef 0%, #d4ebe4 45%, #c5e2d8 100%);
  overflow: hidden;
}

.legal-hero-visual::before,
.legal-hero-visual::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 83, 76, 0.12);
  pointer-events: none;
}

.legal-hero-visual::before {
  width: 88%;
  height: 88%;
  animation: legal-orbit 12s linear infinite;
}

.legal-hero-visual::after {
  width: 68%;
  height: 68%;
  animation: legal-orbit 9s linear infinite reverse;
}

@keyframes legal-orbit {
  to { transform: rotate(360deg); }
}

.legal-shield {
  position: relative;
  z-index: 1;
  width: min(120px, 55%);
  filter: drop-shadow(0 12px 24px rgba(0, 83, 76, 0.25));
}

.legal-hero-content h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.8vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--accent1);
}

.legal-meta {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-meta li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.legal-meta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(0, 144, 111, 0.1);
  color: var(--accent-mid);
}

.legal-meta-icon svg {
  width: 16px;
  height: 16px;
}

.legal-meta a {
  color: var(--accent-mid);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-meta a:hover {
  color: var(--accent1);
}

.legal-disclaimer {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Numbered sections */
.legal-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.legal-section {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px 24px;
  padding: clamp(28px, 4vw, 36px) 0;
  border-bottom: 1px solid var(--line);
}

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

.legal-section-badge {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 144, 111, 0.12);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent1);
  line-height: 48px;
  text-align: center;
  flex-shrink: 0;
}

.legal-section-body h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent1);
}

.legal-section-body p {
  margin: 0 0 14px;
  font-size: 0.95rem;
  line-height: 1.72;
  color: var(--ink-soft);
}

.legal-section-body p:last-child {
  margin-bottom: 0;
}

.legal-section-body ul,
.legal-section-body ol {
  margin: 0 0 14px;
  padding-left: 1.35rem;
}

.legal-section-body li {
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.legal-section-body li:last-child {
  margin-bottom: 0;
}

.legal-section-body a {
  color: var(--accent-mid);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-section-body a:hover {
  color: var(--accent1);
}

.legal-highlight {
  color: var(--accent1);
  font-weight: 700;
}

.legal-callout {
  margin: 0;
  padding: 18px 20px;
  background: rgba(0, 144, 111, 0.08);
  border-left: 3px solid var(--accent-mid);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.legal-callout p {
  margin: 0;
}

.legal-callout p + p {
  margin-top: 12px;
}

/* Data table */
.legal-table-wrap {
  margin: 8px 0 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 83, 76, 0.12);
  box-shadow: var(--shadow-sm);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.legal-table thead {
  background: var(--accent1);
  color: #fff;
}

.legal-table th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-table td {
  padding: 16px 18px;
  vertical-align: top;
  line-height: 1.55;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.legal-table tbody tr:nth-child(even) td {
  background: #f8faf9;
}

.legal-table-category {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 700;
  color: var(--accent1);
  white-space: nowrap;
}

.legal-table-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(0, 144, 111, 0.1);
  color: var(--accent-mid);
}

.legal-table-icon svg {
  width: 18px;
  height: 18px;
}

/* Terms & policies hub */
.legal-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.legal-policy-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.legal-policy-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 144, 111, 0.25);
  box-shadow: var(--shadow-md);
}

.legal-policy-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 144, 111, 0.1);
  color: var(--accent-mid);
}

.legal-policy-icon svg {
  width: 22px;
  height: 22px;
}

.legal-policy-card strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.legal-policy-card span {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.legal-policy-card em {
  font-size: 0.88rem;
  font-weight: 700;
  font-style: normal;
  color: var(--accent-mid);
}

.legal-policy-card:hover em {
  color: var(--accent1);
}

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

  .legal-hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .legal-hero-visual {
    max-width: 200px;
    margin-inline: auto;
  }

  .legal-section {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 16px;
  }

  .legal-section-badge {
    width: 40px;
    height: 40px;
    font-size: 0.72rem;
    line-height: 40px;
  }

  .legal-table-category {
    white-space: normal;
  }

  .legal-table th,
  .legal-table td {
    padding: 12px 14px;
  }
}

@media (max-width: 520px) {
  .legal-table thead {
    display: none;
  }

  .legal-table,
  .legal-table tbody,
  .legal-table tr,
  .legal-table td {
    display: block;
    width: 100%;
  }

  .legal-table tr {
    border-top: 1px solid var(--line);
    padding: 14px 0;
  }

  .legal-table tr:first-child {
    border-top: none;
  }

  .legal-table td {
    border: none;
    padding: 0 14px 8px;
    background: transparent !important;
  }

  .legal-table td:last-child {
    padding-bottom: 14px;
    color: var(--muted);
    font-size: 0.88rem;
  }
}
