/* Trial Room legal pages — matches app light palette (#15157d primary) */

:root {
  --background: #f9f9fb;
  --surface: #ffffff;
  --surface-low: #f3f3f5;
  --text: #1a1c1d;
  --text-secondary: #464652;
  --border: #c7c5d4;
  --primary: #15157d;
  --primary-container: #2e3192;
  --on-primary: #ffffff;
  --outline: #777683;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow: 0 8px 32px rgba(21, 21, 125, 0.08);
  --content-max: 720px;
  --shell-max: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
}

.skip-link:focus {
  left: 1rem;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
  color: var(--on-primary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-mark {
  width: 44px;
  height: 44px;
  color: rgba(255, 255, 255, 0.2);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-primary);
}

.brand-tag {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.header-meta {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.95;
  font-weight: 500;
  color: var(--on-primary);
  text-align: right;
  max-width: 14rem;
  line-height: 1.4;
}

.shell {
  flex: 1;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 840px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.toc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow);
}

@media (min-width: 840px) {
  .toc-card {
    position: sticky;
    top: 1rem;
  }
}

.toc-title {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--outline);
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list li {
  margin-bottom: 0.35rem;
}

.toc-list a {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  padding: 0.2rem 0;
  line-height: 1.35;
}

.toc-list a:hover {
  text-decoration: underline;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--shadow);
}

.hero {
  border-color: rgba(21, 21, 125, 0.15);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-low) 100%);
}

.pill {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(21, 21, 125, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.75rem;
}

.meta {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--outline);
}

.meta strong {
  color: var(--text-secondary);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--primary);
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  scroll-margin-top: 1rem;
}

h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.lead {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.card p {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
}

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

strong {
  color: var(--text);
  font-weight: 600;
}

ul,
ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

ul li,
ol li {
  margin-bottom: 0.4rem;
}

.note {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(21, 21, 125, 0.06);
  border-radius: 12px;
  border-left: 3px solid var(--primary-container);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.link-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.link-list li {
  margin-bottom: 0.5rem;
}

.link-list a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.link-list a:hover {
  text-decoration: underline;
}

.email-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.email-link:hover {
  text-decoration: underline;
}

.footer {
  text-align: center;
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer p {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  color: var(--outline);
}

.footer-url {
  font-size: 0.75rem;
  opacity: 0.8;
}

@media (max-width: 480px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-meta {
    text-align: left;
    max-width: none;
  }

  .shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card {
    padding: 1rem 1.125rem;
  }
}
