/* ═══════════════════════════════════════════════════
   FlorDePlan — Legal Page
   Premium Dark Design System
═══════════════════════════════════════════════════ */

/* ── 1. TOKENS ── */
:root {
  --bg: #060b0a;
  --bg-1: #0c1210;
  --bg-2: #121a17;
  --surface: #131c18;
  --surface-hi: #1a2722;
  --surface-glass: rgba(18,26,23,.72);
  --border: #1e2e28;
  --border-hi: #2a4038;
  --border-glow: rgba(16,185,129,.22);
  --text: #f0fdf4;
  --text-2: #c8e6d0;
  --muted: #7a9485;
  --accent: #10b981;
  --accent-hi: #34d399;
  --accent-glow: rgba(16,185,129,.35);
  --accent-surface: rgba(16,185,129,.08);
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.45);
  --ease: cubic-bezier(.16,1,.3,1);
  --wrap: 1000px;
  --pad: clamp(16px, 4vw, 32px);
}

/* ── 2. RESET & BASE ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body.legal-page {
  background: var(--bg);
  color: var(--text-2);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

h1, h2, h3, .outfit {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; transition: all 0.2s var(--ease); }
a:hover { color: var(--accent-hi); }
p { margin-bottom: 1rem; }
ul { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }
strong { color: var(--text); }
hr {
  border: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
  margin: 2rem 0;
}

::selection { background: rgba(16,185,129,.28); color: #fff; }
.muted { color: var(--muted); }
.text-accent { color: var(--accent); }

/* Ambient Background */
.ambient-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(16,185,129,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 100%, rgba(16,185,129,0.05) 0%, transparent 50%);
  opacity: 0.8;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); width: 100%; }

/* ── 3. READING PROGRESS ── */
.reading-progress-container {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: transparent; z-index: 1000;
}
.reading-progress-bar {
  height: 100%; background: var(--accent);
  width: 0%; transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── 4. NAVBAR ── */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, rgba(6,11,10,.97), rgba(6,11,10,.88));
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(255,255,255,.04);
  box-shadow: var(--shadow-md);
  padding: 0; isolation: isolate;
}
.top-nav::after {
  content:''; position:absolute; bottom:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,.5) 50%, transparent);
  opacity: 0.6;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.logo-box {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hi));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px var(--accent-glow);
  color: var(--bg);
}
.logo-box .material-symbols-outlined { font-size: 24px; font-weight: 600; }
.nav-links { display: flex; gap: 24px; }
.nav-link { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--text); }

/* ── 5. HERO ── */
.legal-hero {
  position: relative; margin-block: 40px; padding: 48px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface), var(--bg-1));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: center;
}
.legal-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at top, rgba(16,185,129,.05), transparent 70%);
  pointer-events: none;
}
.hero-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  background: var(--bg-2); color: var(--muted);
  border: 1px solid var(--border-hi);
}
.badge-accent {
  background: var(--accent-surface); color: var(--accent-hi);
  border-color: rgba(16,185,129,.3);
}
.badge .material-symbols-outlined { font-size: 16px; }
.legal-hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin-bottom: 20px; }
.legal-hero .lead { color: var(--muted); font-size: 16px; max-width: 600px; margin: 0 auto; }

/* ── 6. MAIN LAYOUT ── */
.grid-main {
  display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start;
  margin-bottom: 60px;
}

/* ── 7. STICKY TOC ── */
.toc {
  position: sticky; top: 96px; z-index: 10;
}
.toc-inner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-md);
}
.toc-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 16px; padding-left: 8px; }
.toc-nav { display: flex; flex-direction: column; gap: 8px; }
.toc-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--muted); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
  position: relative;
}
.toc-link .material-symbols-outlined { font-size: 18px; opacity: 0.7; transition: opacity 0.2s; }
.toc-link:hover {
  color: var(--text-2); background: var(--bg-2);
  transform: translateX(4px);
}
.toc-link.active {
  color: var(--accent); background: var(--accent-surface);
  border-color: rgba(16,185,129,.15);
  font-weight: 600;
}
.toc-link.active .material-symbols-outlined { opacity: 1; color: var(--accent); }
.toc-link.active::before {
  content: ''; position: absolute; left: 0; top: 10%; bottom: 10%; width: 3px;
  background: var(--accent); border-radius: 0 4px 4px 0;
}

/* ── 8. CONTENT CARDS ── */
.block { display: flex; flex-direction: column; gap: 32px; }
.card {
  scroll-margin-top: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover { border-color: var(--border-hi); box-shadow: var(--shadow-md); }
.card > h2 { font-size: 24px; margin-bottom: 24px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 16px; }

/* ── 9. ACCORDIONS ── */
.legal-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}
.legal-details:hover { border-color: var(--border-hi); }
.legal-details[open] {
  background: var(--surface-hi);
  border-color: var(--border-glow);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.legal-details summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--text);
  user-select: none;
}
.legal-details summary::-webkit-details-marker { display: none; }
.summary-title { flex: 1; font-size: 15px; }
.chevron { font-size: 20px; color: var(--muted); transition: transform 0.3s var(--ease); }
.legal-details[open] summary .chevron { transform: rotate(180deg); color: var(--accent); }
.details-content {
  padding: 0 20px 20px 20px;
  animation: slideDown 0.3s var(--ease);
  color: var(--text-2);
}
.details-content p:last-child { margin-bottom: 0; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 10. CALLOUTS ── */
.callout {
  display: flex; gap: 16px; padding: 20px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border-left: 4px solid var(--border-hi);
  margin-block: 24px;
}
.callout.warning {
  background: rgba(245, 158, 11, 0.08); /* --warn surface */
  border-color: var(--warn);
}
.callout.info {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
}
.callout-icon { font-size: 24px; }
.warning .callout-icon { color: var(--warn); }
.info .callout-icon { color: #38bdf8; }
.callout-text p { margin-bottom: 12px; font-size: 14px; }
.callout-text p:last-child { margin-bottom: 0; }

/* ── 11. FOOTER ── */
.legal-foot {
  margin-top: auto; padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.legal-foot .wrap {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.legal-foot small { color: var(--muted); font-size: 13px; }
.foot-links { display: flex; gap: 16px; }

/* ── 12. RESPONSIVE ── */
@media (max-width: 900px) {
  .grid-main { grid-template-columns: 1fr; }
  .toc {
    position: static; margin-bottom: 32px;
  }
  .toc-inner { padding: 16px; }
  .toc-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .toc-link { flex: 1 1 auto; justify-content: center; font-size: 13px; padding: 8px 12px; }
  .toc-link.active::before { display: none; }
  .toc-link.active { border: 1px solid var(--accent-glow); }
}

@media (max-width: 640px) {
  .nav { padding-block: 12px; }
  .nav-links { display: none; } /* Hide links on mobile for cleaner top bar */
  .legal-hero { padding: 32px 20px; border-radius: var(--radius-lg); }
  .legal-hero h1 { font-size: 28px; }
  .card { padding: 20px; }
  .legal-foot .wrap { flex-direction: column; text-align: center; justify-content: center; }
  .toc-link { flex: 1 1 100%; justify-content: flex-start; }
}

@media (max-width: 768px), (hover:none) and (pointer:coarse) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .details-content { opacity: 1 !important; transform: none !important; }
}
