/* ============================================================
   IQ MINDWARE - terms.css  v1.0
   Scope: /terms/ - Terms of Service.
   Requires: brand.css loaded first.
   Design goal: readable legal prose, clear section anchors,
   sticky sidebar TOC, trust-safe amber callouts.
   ============================================================ */


/* ============================================================
   1. PAGE TOKENS
   ============================================================ */
:root {
  --tm-surface:     #eceef2;
  --tm-card:        #ffffff;
  --tm-card-bdr:    rgba(0,0,0,.08);
  --tm-rule:        rgba(0,0,0,.09);
  --tm-amber-bg:    rgba(180,83,9,.05);
  --tm-amber-bdr:   rgba(180,83,9,.18);
  --tm-amber-text:  #92400e;
  --tm-green-bg:    rgba(46,125,50,.05);
  --tm-green-bdr:   rgba(46,125,50,.20);
  --tm-green-text:  #2e7d32;
  --tm-blue-bg:     rgba(34,170,255,.06);
  --tm-blue-bdr:    rgba(34,170,255,.20);
  --tm-blue-text:   #1a6eb0;
}


/* ============================================================
   2. PAGE SHELL
   ============================================================ */
body.terms  { background: var(--tm-surface); }
.terms-page { padding-top: 64px; }


/* ============================================================
   3. HERO
   ============================================================ */
.tm-hero {
  background: var(--card-dark);
  border-bottom: 2px solid rgba(255,255,255,.06);
  padding: 80px var(--gutter) 48px;
}
.tm-hero-inner { max-width: var(--max-w); margin: 0 auto; }
.tm-hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan-lt); display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.tm-hero-eyebrow::before {
  content: ''; display: inline-block; width: 18px; height: 1.5px;
  background: var(--cyan); flex-shrink: 0;
}
.tm-hero-title {
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 800; letter-spacing: -.024em; line-height: 1.07;
  color: var(--tc); margin-bottom: 14px;
}
.tm-hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--lime), #22AAFF);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tm-hero-meta {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.tm-hero-meta-item {
  display: flex; align-items: center; gap: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 10.5px; letter-spacing: .08em; color: var(--tcf);
}
.tm-hero-meta-item strong { color: var(--tcm); font-weight: 500; }
.tm-hero-meta-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,.20); flex-shrink: 0;
}
.tm-hero-sub {
  font-size: 14px; color: var(--tcm); max-width: 56ch; line-height: 1.72;
}
.tm-hero-sub a {
  color: var(--cyan-lt); font-weight: 700; text-decoration: none;
  border-bottom: 1px solid rgba(34,170,255,.25);
}
.tm-hero-sub a:hover { border-bottom-color: var(--cyan-lt); }


/* ============================================================
   4. MAIN LAYOUT: sidebar + content
   ============================================================ */
.tm-layout {
  max-width: var(--max-w); margin: 0 auto;
  padding: 48px var(--gutter) 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 52px; align-items: start;
}


/* ============================================================
   5. SIDEBAR TOC
   ============================================================ */
.tm-sidebar { position: sticky; top: 92px; }
.tm-toc {
  background: var(--tm-card);
  border: 1.5px solid var(--tm-card-bdr);
  border-radius: 12px; overflow: hidden;
}
.tm-toc-hd {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--tlf);
  background: rgba(0,0,0,.02);
}
.tm-toc-list { list-style: none; padding: 8px 0; }
.tm-toc-link {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 16px;
  font-size: 12px; color: var(--tlm); text-decoration: none;
  border-left: 2px solid transparent; line-height: 1.4;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.tm-toc-link:hover  { color: var(--tl); background: rgba(0,0,0,.025); border-left-color: rgba(34,170,255,.40); }
.tm-toc-link.active { color: var(--blue-dp); border-left-color: var(--cyan); font-weight: 700; background: rgba(34,170,255,.04); }
.tm-toc-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.tm-toc-num {
  font-family: 'DM Mono', monospace;
  font-size: 9px; color: var(--tlf); flex-shrink: 0; margin-top: 2px; min-width: 14px;
}

.tm-toc-footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(0,0,0,.08);
  font-size: 11px; color: var(--tlf); line-height: 1.60;
}
.tm-toc-footer a {
  color: var(--blue-dp); font-weight: 700; text-decoration: none;
  border-bottom: 1px solid rgba(39,100,183,.20);
}
.tm-toc-footer a:hover { border-bottom-color: var(--blue-dp); }


/* ============================================================
   6. DOCUMENT BODY
   ============================================================ */
.tm-doc { min-width: 0; }

/* Section */
.tm-section {
  margin-bottom: 44px;
  scroll-margin-top: 100px;
}

/* Section header */
.tm-section-hd {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid rgba(0,0,0,.09);
}
.tm-section-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--tlf); flex-shrink: 0;
}
.tm-section-title {
  font-size: 18px; font-weight: 800;
  color: var(--tl); letter-spacing: -.014em; line-height: 1.2;
}

/* Prose */
.tm-prose {
  font-size: 14.5px; color: var(--tlm); line-height: 1.80;
}
.tm-prose p { margin-bottom: 13px; }
.tm-prose p:last-child { margin-bottom: 0; }
.tm-prose strong { color: var(--tl); }
.tm-prose a {
  color: var(--blue-dp); font-weight: 700; text-decoration: none;
  border-bottom: 1px solid rgba(39,100,183,.22);
}
.tm-prose a:hover { border-bottom-color: var(--blue-dp); }
.tm-prose ul {
  padding-left: 20px; margin-bottom: 13px; margin-top: 4px;
}
.tm-prose li { margin-bottom: 6px; }

/* Inline callout boxes */
.tm-callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 10px; margin: 16px 0;
}
.tm-callout--amber {
  background: var(--tm-amber-bg); border: 1px solid var(--tm-amber-bdr);
}
.tm-callout--green {
  background: var(--tm-green-bg); border: 1px solid var(--tm-green-bdr);
}
.tm-callout--blue {
  background: var(--tm-blue-bg); border: 1px solid var(--tm-blue-bdr);
}
.tm-callout-icon { font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.tm-callout-text { font-size: 13.5px; line-height: 1.65; }
.tm-callout--amber .tm-callout-text { color: var(--tm-amber-text); }
.tm-callout--green .tm-callout-text { color: var(--tm-green-text); }
.tm-callout--blue  .tm-callout-text { color: var(--tm-blue-text);  }
.tm-callout-text strong { color: inherit; }
.tm-callout-text a { color: inherit; font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; opacity: .7; }
.tm-callout-text a:hover { opacity: 1; }

/* Definition rows (key: value pairs) */
.tm-defs { margin: 12px 0 16px; display: flex; flex-direction: column; gap: 0; }
.tm-def-row {
  display: grid; grid-template-columns: 180px 1fr;
  padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.07);
  gap: 16px; align-items: baseline;
}
.tm-def-row:first-child { border-top: 1px solid rgba(0,0,0,.07); }
.tm-def-key {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px; letter-spacing: .07em; color: var(--tlf);
  text-transform: uppercase; font-weight: 500;
}
.tm-def-val {
  font-size: 14px; color: var(--tlm); line-height: 1.55;
}
.tm-def-val a { color: var(--blue-dp); font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(39,100,183,.22); }
.tm-def-val a:hover { border-bottom-color: var(--blue-dp); }
.tm-def-val strong { color: var(--tl); }

/* Service table */
.tm-service-grid {
  display: flex; flex-direction: column; gap: 8px; margin: 12px 0;
}
.tm-service-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--tm-card);
  border: 1.5px solid var(--tm-card-bdr);
  border-radius: 8px;
}
.tm-service-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tm-service-name { font-size: 13.5px; font-weight: 800; color: var(--tl); flex-shrink: 0; min-width: 150px; }
.tm-service-desc { font-size: 13px; color: var(--tlm); flex: 1; line-height: 1.45; }
.tm-service-badge {
  font-family: 'DM Mono', monospace;
  font-size: 8.5px; letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px; flex-shrink: 0;
}
.tm-service-badge--live  { background: rgba(46,125,50,.08); border: 1px solid rgba(46,125,50,.20); color: #2e7d32; }
.tm-service-badge--soon  { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.22); color: #92400e; }
.tm-service-badge--bundle { background: rgba(167,139,250,.09); border: 1px solid rgba(167,139,250,.22); color: #5b21b6; }

/* Policy link row */
.tm-policy-links {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px;
}
.tm-policy-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; min-height: 40px;
  font-size: 12.5px; font-weight: 800;
  background: var(--tm-card); border: 1.5px solid var(--tm-card-bdr);
  color: var(--blue-dp); text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.tm-policy-link:hover { background: rgba(34,170,255,.06); border-color: rgba(34,170,255,.25); }
.tm-policy-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.tm-policy-link::before { content: '->'; font-size: 11px; color: var(--tlf); }

/* Divider between major sections */
.tm-divider {
  border: none; border-top: 1px solid rgba(0,0,0,.08); margin: 0 0 44px;
}

/* Last updated stamp */
.tm-updated {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 6px;
  background: rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.08);
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: .07em; color: var(--tlf);
  margin-bottom: 32px;
}
.tm-updated-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); flex-shrink: 0; }


/* ============================================================
   7. RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .tm-layout { grid-template-columns: 190px 1fr; gap: 36px; }
}
@media (max-width: 800px) {
  .tm-layout { grid-template-columns: 1fr; }
  .tm-sidebar { display: none; }
}
@media (max-width: 600px) {
  .tm-hero { padding: 80px var(--gutter) 36px; }
  .tm-def-row { grid-template-columns: 140px 1fr; }
}
