/*
 * Shared stylesheet for the RFXCommand Trust Center (legal/policy pages).
 * Used by trust/index.html and every trust/*.html document page, plus the
 * root privacy-policy.html / terms-of-service.html redirect stubs.
 */

:root {
  --color-primary-50: #f0f4fe;
  --color-primary-200: #b8c8f6;
  --color-primary-400: #4e79d3;
  --color-primary-500: #1e3a8a;
  --color-primary-600: #1b3780;
  --color-ns-cyan: #5eead4;
  --color-ns-cyan-light: #ccfbf1;
  --brand-navy: #1e3a8a;
  --brand-navy-deep: #0f172a;
  --brand-teal: #0d9488;
  --brand-teal-hover: #0f766e;
  --brand-teal-light: #ccfbf1;
  --brand-teal-soft: #5eead4;
  --brand-surface-light-1: #f8fafc;
  --brand-surface-light-2: #ffffff;
  --brand-surface-light-3: #f1f5f9;
  --brand-surface-dark-1: #0f172a;
  --brand-surface-dark-2: #1e293b;
  --brand-surface-dark-3: #293548;
}

html.dark {
  color-scheme: dark;
}

html.light {
  color-scheme: light;
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6,
html.dark .text-secondary {
  color: #ffffff !important;
}

.site-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

@media (min-width: 64rem) {
  .site-logo {
    height: 48px;
  }
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.legal-shell {
  max-width: 800px;
  margin: 0 auto;
  padding: 56px 20px 96px;
}

.legal-shell h1 {
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--color-secondary);
  opacity: 0.6;
  margin-bottom: 40px;
}

html.dark .legal-updated {
  color: var(--color-accent);
  opacity: 0.6;
}

.legal-back-link {
  color: var(--color-secondary);
  opacity: 0.7;
}

html.dark .legal-back-link {
  color: var(--color-accent);
  opacity: 0.7;
}

.legal-shell h2 {
  margin-top: 40px;
  margin-bottom: 14px;
  font-size: var(--text-heading-6, 1.25rem);
  line-height: var(--text-heading-6--line-height, 140%);
}

.legal-shell h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: var(--text-tagline-1, 1rem);
  line-height: var(--text-tagline-1--line-height, 150%);
}

.legal-shell p,
.legal-shell li {
  color: var(--color-secondary);
  opacity: 0.78;
  line-height: 1.7;
}

html.dark .legal-shell p,
html.dark .legal-shell li {
  color: var(--color-accent);
  opacity: 0.72;
}

.legal-shell ul,
.legal-shell ol {
  list-style: disc;
  padding-left: 22px;
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
}

.legal-shell ol {
  list-style: decimal;
}

.legal-shell p {
  margin-bottom: 16px;
}

.legal-shell a {
  color: var(--brand-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-shell strong {
  color: var(--color-secondary);
}

html.dark .legal-shell strong {
  color: #ffffff;
}

/* Markdown "At a Glance" callout (rendered from a leading blockquote) */
.legal-shell blockquote {
  margin: 0 0 28px;
  padding: 18px 22px;
  border-radius: 16px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  background: rgba(13, 148, 136, 0.06);
}

html.dark .legal-shell blockquote {
  border-color: rgba(94, 234, 212, 0.22);
  background: rgba(94, 234, 212, 0.06);
}

.legal-shell blockquote > *:last-child {
  margin-bottom: 0;
}

.legal-shell blockquote h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

/* Markdown tables (e.g. Subprocessors) */
.legal-shell table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.legal-shell th,
.legal-shell td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--color-secondary);
  opacity: 0.8;
  line-height: 1.6;
}

html.dark .legal-shell th,
html.dark .legal-shell td {
  color: var(--color-accent);
  opacity: 0.78;
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

.legal-shell tr:last-child th,
.legal-shell tr:last-child td {
  border-bottom: 0;
}

.legal-shell thead th {
  font-weight: 600;
  background: rgba(148, 163, 184, 0.1);
  opacity: 1;
  color: var(--color-secondary);
}

html.dark .legal-shell thead th {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.legal-shell hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  margin: 32px 0;
}

.legal-shell code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.16);
}

/* Loading / error state for the async-rendered markdown content */
.legal-markdown[data-state="loading"]::before {
  content: "Loading document\2026";
  display: block;
  color: var(--color-secondary);
  opacity: 0.6;
}

html.dark .legal-markdown[data-state="loading"]::before {
  color: var(--color-accent);
  opacity: 0.6;
}

.legal-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding: 24px clamp(20px, 5vw, 64px);
  text-align: center;
  color: var(--color-secondary);
  opacity: 0.6;
}

html.dark .legal-footer {
  color: var(--color-accent);
  opacity: 0.6;
}

/* Trust Center hub (trust/index.html) */
.trust-hub-intro {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.trust-hub-intro p {
  color: var(--color-secondary);
  opacity: 0.75;
  line-height: 1.7;
}

html.dark .trust-hub-intro p {
  color: var(--color-accent);
  opacity: 0.7;
}

.trust-hub-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.trust-hub-card,
.trust-hub-card:hover {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.05);
  text-decoration: none;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}

.legal-shell .trust-hub-card,
.legal-shell .trust-hub-card * {
  text-decoration: none;
}

.trust-hub-card:hover {
  transform: translateY(-3px);
  border-color: rgba(13, 148, 136, 0.4);
}

.trust-hub-card-title {
  color: var(--color-secondary);
  font-weight: 600;
}

html.dark .trust-hub-card-title {
  color: #ffffff;
}

.trust-hub-card-desc {
  color: var(--color-secondary);
  opacity: 0.68;
  line-height: 1.55;
}

html.dark .trust-hub-card-desc {
  color: var(--color-accent);
  opacity: 0.65;
}

.cookie-consent {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 84px;
  z-index: 9998;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 18px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 48px rgba(4, 10, 20, 0.18);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.32s ease,
    transform 0.32s ease;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent.is-visible {
  opacity: 1;
  transform: translateY(0);
}

html.dark .cookie-consent {
  background: #10151f;
  border-color: rgba(255, 255, 255, 0.08);
}

.cookie-consent-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-consent-text {
  font-size: var(--text-tagline-3);
  line-height: 1.5;
  color: var(--color-secondary);
  opacity: 0.75;
}

html.dark .cookie-consent-text {
  color: var(--color-accent);
  opacity: 0.7;
}

.cookie-consent-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
}

.cookie-consent-actions {
  display: flex;
  gap: 10px;
}

.cookie-consent-actions .btn {
  flex: 1;
}

.cookie-consent-btn {
  padding-inline: 14px;
  padding-block: 7px;
  font-size: var(--text-tagline-3);
  line-height: 1.3;
}

@media (min-width: 640px) {
  .cookie-consent {
    left: 24px;
    right: auto;
    bottom: 24px;
  }

  .cookie-consent-inner {
    flex-direction: row;
    align-items: center;
  }

  .cookie-consent-actions {
    flex-shrink: 0;
  }

  .cookie-consent-actions .btn {
    flex: none;
  }

  .cookie-consent-btn {
    padding-inline: 16px;
    padding-block: 8px;
  }
}
