/* Shared layout for /terms.html and /privacy.html */

.legal-page {
  min-height: 100%;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

.legal-page .blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.legal-shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.legal-brand-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cff, #ff6a55);
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(139, 92, 255, 0.35);
}

.legal-brand-word {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.legal-back:hover {
  background: var(--surface);
  border-color: rgba(139, 92, 255, 0.25);
}

.legal-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 32px;
  box-shadow: var(--shadow-modal);
  border: 1px solid rgba(30, 20, 60, 0.06);
}

.legal-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.legal-lead {
  margin: 0 0 22px;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.45;
}

.legal-body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

.legal-body h2 {
  margin: 22px 0 10px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.legal-body h2:first-child {
  margin-top: 0;
}

.legal-body p {
  margin: 0 0 14px;
}

.legal-body ul,
.legal-body ol {
  margin: 0 0 14px;
  padding-left: 1.25em;
}

.legal-body li {
  margin: 0 0 6px;
}

.legal-body p:last-child,
.legal-body ul:last-child,
.legal-body ol:last-child {
  margin-bottom: 0;
}

.legal-placeholder {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--accent-tint);
  border: 1px dashed rgba(139, 92, 255, 0.35);
  color: var(--dim);
  font-size: 14px;
  line-height: 1.55;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.legal-footer-links a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.legal-footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 560px) {
  .legal-shell {
    padding: 20px 16px 40px;
  }

  .legal-card {
    border-radius: 20px;
    padding: 22px 18px 26px;
  }

  .legal-brand-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    font-size: 22px;
  }

  .legal-back {
    font-size: 13px;
    min-height: 36px;
    padding: 0 12px;
  }
}
