/* ==========================================================================
   Crest Legal & Compliance Pages (Terms, Privacy, Refund Policy)
   Extends styles.css · Aligned with docs/DESIGN.md
   ========================================================================== */

.legal-main {
  position: relative;
  z-index: 1;
  padding: 40px 0 72px;
}

.legal-shell {
  max-width: 820px;
  margin: 0 auto;
}

.legal-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--crest-ink-muted);
}

.legal-breadcrumb a {
  color: var(--crest-ink-secondary);
  transition: color 140ms ease;
}

.legal-breadcrumb a:hover {
  color: var(--crest-action-ink);
}

.legal-card {
  padding: 36px 40px;
  border: 1px solid var(--crest-line-strong);
  border-radius: var(--radius-lg);
  background: var(--crest-surface);
  box-shadow: var(--crest-shadow-sm);
}

.legal-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--crest-line);
}

.legal-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin-bottom: 12px;
  border: 1px solid var(--crest-line);
  border-radius: 999px;
  background: var(--crest-card-solid);
  font-size: 12px;
  font-weight: 600;
  color: var(--crest-action-ink);
}

.legal-title {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--crest-ink);
}

.legal-meta {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--crest-ink-muted);
}

.legal-summary {
  margin: 24px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--crest-line);
  border-left: 3px solid var(--crest-action);
  border-radius: var(--radius-md);
  background: var(--crest-page);
  font-size: 14px;
  color: var(--crest-ink);
}

.legal-summary strong {
  color: var(--crest-ink);
}

.legal-body {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.legal-section h2 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--crest-ink);
}

.legal-section p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--crest-ink-secondary);
}

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

.legal-section ul {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--crest-ink-secondary);
}

.legal-section a:not(.btn) {
  color: var(--crest-action-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-section a:not(.btn):hover {
  color: var(--crest-action-hover);
}

.legal-section code {
  padding: 2px 6px;
  border: 1px solid var(--crest-line);
  border-radius: 6px;
  background: var(--crest-page);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  color: var(--crest-ink);
}

.legal-nav-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--crest-line);
  font-size: 13px;
  color: var(--crest-ink-muted);
}

.legal-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.legal-nav-links a {
  color: var(--crest-ink-secondary);
  font-weight: 500;
  transition: color 140ms ease;
}

.legal-nav-links a:hover,
.legal-nav-links a[aria-current="page"] {
  color: var(--crest-action-ink);
}

/* Compact Legal Footer on Landing Page */
.site-legal-footer {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  border-top: 1px solid var(--crest-line);
  background: rgb(255 254 250 / 72%);
}

.site-legal-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 22px 0 28px;
  font-size: 13px;
  color: var(--crest-ink-muted);
}

.site-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.site-legal-links a {
  color: var(--crest-ink-secondary);
  transition: color 140ms ease;
}

.site-legal-links a:hover {
  color: var(--crest-action-ink);
}

/* Post-checkout License Claim Page (/thanks/) */
.thanks-panel[hidden],
.thanks-key-actions [hidden] {
  display: none;
}

.thanks-panel {
  margin-top: 24px;
}

.thanks-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--crest-line);
  border-radius: var(--radius-md);
  background: var(--crest-page);
  font-size: 14.5px;
  color: var(--crest-ink-secondary);
}

.thanks-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--crest-line-strong);
  border-top-color: var(--crest-action);
  border-radius: 999px;
  flex: none;
  animation: thanks-spin 0.8s linear infinite;
}

@keyframes thanks-spin {
  to {
    transform: rotate(360deg);
  }
}

.thanks-key-box {
  padding: 24px;
  border: 1px solid var(--crest-line-strong);
  border-radius: var(--radius-md);
  background: var(--crest-page);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.thanks-key-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--crest-ink-muted);
}

.thanks-key-code {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--crest-line);
  border-radius: 10px;
  background: var(--crest-card-solid);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--crest-ink);
  word-break: break-all;
}

.thanks-key-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.thanks-order-id {
  font-size: 13px;
  color: var(--crest-ink-muted);
}

.thanks-download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.thanks-error-msg {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--crest-line);
  border-radius: var(--radius-md);
  background: var(--crest-page);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--crest-ink-secondary);
}

@media (max-width: 720px) {
  .legal-main {
    padding: 24px 0 48px;
  }

  .legal-card {
    padding: 24px 20px;
  }
}
