/* ─────────────────────────────────────────────
   DEVOLAR — Legal Pages Stylesheet
   ───────────────────────────────────────────── */

/* ── LAYOUT ── */
.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1280px;
  margin: 0 auto;
  padding: 100px 2rem 80px;
  gap: 4rem;
  align-items: start;
}

/* ── SIDEBAR ── */
.legal-sidebar {
  position: sticky;
  top: 84px;
}
.legal-sidebar-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.lsi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text2);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  border-left: 2px solid transparent;
}
.toc-link:hover {
  color: var(--text);
  background: var(--bg2);
}
.toc-link.active-toc {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: var(--cyan-glow);
}

/* ── MAIN CONTENT ── */
.legal-main {
  min-width: 0;
}

.legal-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.legal-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0.75rem 0 1.25rem;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.lm-item {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
}
.lm-key {
  color: var(--text3);
  margin-right: 6px;
}
.legal-intro-box {
  background: rgba(0,229,255,0.04);
  border: 1px solid rgba(0,229,255,0.15);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.7;
}
.legal-intro-box strong { color: var(--text); }
.legal-intro-box a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

/* ── SECTIONS ── */
.legal-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}
.legal-section:last-of-type {
  border-bottom: none;
}
.legal-section h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  scroll-margin-top: 100px;
  color: var(--text);
}
.legal-section h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--text);
}
.legal-section p {
  color: var(--text2);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.75;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul {
  list-style: none;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-section ul li {
  font-size: 0.93rem;
  color: var(--text2);
  padding-left: 20px;
  position: relative;
  line-height: 1.65;
}
.legal-section ul li::before {
  content: '·';
  position: absolute;
  left: 6px;
  color: var(--cyan);
  font-size: 16px;
  line-height: 1.4;
}
.legal-section a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s;
}
.legal-section a:hover { opacity: 0.75; }

/* ── INFO CARD ── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}
.ic-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ic-row:last-child { border-bottom: none; }
.ic-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.06em;
  width: 140px;
  flex-shrink: 0;
}
.ic-val { color: var(--text2); }
.ic-val a { color: var(--cyan); }

/* ── PURPOSE / DATA TABLE ── */
.purpose-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}
.pt-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  border-bottom: 1px solid var(--border);
}
.pt-row:last-child { border-bottom: none; }
.pt-row.pt-header {
  background: var(--bg2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pt-row div {
  padding: 10px 14px;
  color: var(--text2);
  border-right: 1px solid var(--border);
}
.pt-row div:last-child { border-right: none; }
.pt-row.pt-header div { color: var(--text3); }

/* ── COOKIE CATEGORY CARDS ── */
.cookie-category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s;
}
.cookie-category-card.essential {
  border-color: rgba(0,229,255,0.2);
}
.cc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}
.cc-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 3px;
}
.cc-desc { font-size: 12px; color: var(--text3); }
.cc-toggle.always-on {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.cookie-category-card p {
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

/* ── TOGGLE SWITCH ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border2);
  border-radius: 999px;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: var(--text3);
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(0,229,255,0.2); border: 1px solid var(--cyan); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--cyan); }

/* ── COOKIE TABLE ── */
.cookie-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
  margin-top: 0.75rem;
}
.ct-row {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 2.5fr 1fr;
  border-bottom: 1px solid var(--border);
}
.ct-row:last-child { border-bottom: none; }
.ct-row.ct-header {
  background: var(--bg2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ct-row div {
  padding: 8px 12px;
  color: var(--text2);
  border-right: 1px solid var(--border);
}
.ct-row div:last-child { border-right: none; }

/* ── SAVE PREFS BAR ── */
.save-prefs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.save-prefs-bar p { font-size: 13px; color: var(--text2); margin: 0; }

/* ── RIGHTS GRID ── */
.rights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.right-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.right-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--cyan);
  margin-bottom: 5px;
}
.right-item p { font-size: 12.5px; color: var(--text2); margin: 0; }

/* ── SECURITY MEASURES GRID ── */
.security-measures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.sm-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.sm-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sm-item p { font-size: 12.5px; color: var(--text2); margin: 0; line-height: 1.6; }

/* ── FOOTER LINKS ── */
.legal-footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.legal-footer-links a {
  font-size: 13px;
  color: var(--text2);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.legal-footer-links a:hover { color: var(--cyan); }

/* ── COOKIE BANNER ── */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  animation: slideUp 0.4s ease both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.cb-text { flex: 1; min-width: 200px; }
.cb-text strong { display: block; margin-bottom: 5px; font-size: 14px; }
.cb-text p { font-size: 12.5px; color: var(--text2); margin: 0; }
.cb-text a { color: var(--cyan); text-decoration: underline; }
.cb-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.cb-btn-accept { padding: 9px 20px; background: var(--cyan); color: var(--bg); border: none; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; font-family: var(--font-body); }
.cb-btn-accept:hover { opacity: 0.85; }
.cb-btn-manage { padding: 9px 18px; border: 1px solid var(--border2); color: var(--text2); background: none; border-radius: 7px; font-size: 13px; cursor: pointer; transition: border-color 0.2s, color 0.2s; font-family: var(--font-body); }
.cb-btn-manage:hover { border-color: var(--cyan); color: var(--cyan); }
.cb-btn-reject { padding: 9px 14px; border: none; background: none; color: var(--text3); font-size: 13px; cursor: pointer; font-family: var(--font-body); transition: color 0.2s; }
.cb-btn-reject:hover { color: var(--text2); }
.cookie-banner.hidden { display: none; }

/* ── MOBILE ── */
@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    padding: 90px 1.25rem 60px;
    gap: 2rem;
  }
  .legal-sidebar {
    position: static;
    order: 2;
  }
  .legal-main { order: 1; }
  .rights-grid,
  .security-measures-grid { grid-template-columns: 1fr; }
  .pt-row { grid-template-columns: 1fr 1fr; }
  .pt-row div:nth-child(2) { display: none; }
  .ct-row { grid-template-columns: 1fr 1fr; }
  .ct-row div:nth-child(3) { display: none; }
  .cookie-banner { left: 1rem; right: 1rem; bottom: 1rem; }
}
@media (max-width: 600px) {
  .legal-title { font-size: 1.8rem; }
  .pt-row { grid-template-columns: 1fr; }
  .pt-row div:not(:first-child) { display: none; }
  .pt-row.pt-header div:first-child::after { content: ' (scroll for details)'; }
}
