/* Medex — Terms & Privacy legal pages */
.legal-hero {
    position: relative;
    padding: 140px 0 72px;
    background: linear-gradient(135deg, #0f1c2e 0%, #1b416f 55%, #27a897 130%);
    overflow: hidden;
    text-align: center;
    color: #fff;
}

.legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(39,168,151,.25), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,.08), transparent 40%);
    pointer-events: none;
}

.legal-hero .container { position: relative; z-index: 1; }

.legal-hero .tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.legal-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff;
    margin-bottom: 14px;
    font-weight: 700;
}

.legal-hero p {
    max-width: 640px;
    margin: 0 auto;
    color: rgba(255,255,255,.78);
    font-size: 1.05rem;
    line-height: 1.7;
}

.legal-body {
    background: #f5f9fc;
    padding: 64px 0 80px;
}

.legal-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(15,28,46,.08);
    border: 1px solid rgba(27,65,111,.06);
    padding: clamp(28px, 4vw, 48px);
    max-width: 920px;
    margin: 0 auto;
}

.legal-card .intro {
    font-size: 1.05rem;
    color: #2c3e50;
    line-height: 1.75;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8eef4;
}

.legal-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    color: #0f1c2e;
    margin: 32px 0 12px;
    padding-top: 8px;
    /* Keep section titles below fixed header when TOC anchors are clicked */
    scroll-margin-top: 110px;
}

.legal-card h2:first-of-type { margin-top: 0; }

html {
    scroll-padding-top: 110px;
}

.legal-card p {
    color: #637080;
    line-height: 1.75;
    margin-bottom: 12px;
}

.legal-card ul {
    list-style: none;
    margin: 8px 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-card ul li {
    position: relative;
    padding-left: 22px;
    color: #637080;
    line-height: 1.65;
}

.legal-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27a897;
}

.legal-card .refund-list li strong {
    color: #1b416f;
}

.legal-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 36px;
}

.legal-nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(39,168,151,.35);
    color: #1b416f;
    font-weight: 600;
    font-size: .92rem;
}

.legal-nav-links a:hover {
    background: #27a897;
    color: #fff;
    border-color: #27a897;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 4px;
}

.footer-legal {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 6px;
}

.footer-legal a {
    color: rgba(255,255,255,.45);
    font-size: .82rem;
}

.footer-legal a:hover { color: var(--primary, #27a897); }

.footer-legal .sep {
    color: rgba(255,255,255,.25);
}

/* TOC legal layout */
.legal-hero--rich { text-align: left; padding: 130px 0 64px; }
.legal-hero--rich .container { max-width: 1100px; }
.legal-hero-icon {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); color: #7ee0d3; font-size: 1.4rem; margin-bottom: 18px;
}
.legal-updated {
  display: inline-block; margin-top: 18px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.12); font-size: .85rem; color: rgba(255,255,255,.9);
}
.legal-layout {
  display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 28px; align-items: start;
  max-width: 1100px; margin: 0 auto;
}
.legal-toc {
  position: sticky; top: 100px; background: #fff; border-radius: 18px; padding: 22px 18px;
  border: 1px solid rgba(27,65,111,.08); box-shadow: 0 10px 28px rgba(15,28,46,.06);
}
.legal-toc h3 {
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #27a897; margin-bottom: 14px;
}
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.legal-toc a {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px;
  color: #2c3e50; font-size: .9rem; font-weight: 600; text-decoration: none;
}
.legal-toc a span {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: #eaf7f5; color: #27a897;
  display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800;
}
.legal-toc a:hover, .legal-toc a:focus { background: #eaf7f5; color: #1b416f; }
.legal-toc a.is-active {
  background: #eaf7f5;
  color: #1b416f;
}
.legal-layout .legal-card { max-width: none; margin: 0; }
.legal-table-wrap { overflow-x: auto; margin: 16px 0 20px; }
.legal-table { width: 100%; border-collapse: collapse; }
.legal-table th, .legal-table td {
  border: 1px solid #e2ebf2; padding: 12px 14px; text-align: left; font-size: .95rem;
}
.legal-table th { background: #eaf7f5; color: #0f1c2e; }
@media (max-width: 991px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
  .legal-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .legal-hero-art { justify-self: start; width: 120px; height: 120px; font-size: 3rem; }
}

/* Mock-aligned split hero (left copy / right shield) */
.legal-hero--split .legal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(140px, .55fr);
  gap: 28px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}
.legal-hero--split .legal-hero-copy h1 {
  margin-bottom: 12px;
}
.legal-hero--split .legal-hero-copy p {
  margin: 0;
  max-width: 560px;
  color: rgba(255,255,255,.82);
}
.legal-hero--split .legal-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legal-hero--split .legal-updated i { color: #7ee0d3; }
.legal-hero-art {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(126, 224, 211, .85);
  font-size: 4.4rem;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.16), transparent 55%),
    rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 0 40px rgba(39,168,151,.18);
  position: relative;
}
.legal-hero-art::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px dashed rgba(126,224,211,.35);
  pointer-events: none;
}
