/* ─────────────────────────────────────────────────────────────
   jordenlabs — shared style for app legal pages
   (Cashy+ / FreshLog+ privacy policies, account deletion)
   Tokens mirror index.html so these pages feel like the main site.
   Each page sets an app accent with <body class="app-cashy|app-freshlog">.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-2: #e8e8ed;
  --border-soft: rgba(0, 0, 0, 0.06);
  --text: #1d1d1f;
  --text-secondary: #424245;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --link: #0066cc;
  --red: #d70015;
  --red-dim: rgba(255, 59, 48, 0.12);
  --amber: #b25000;
  --amber-dim: rgba(255, 159, 10, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --nav-h: 52px;

  /* app accent (overridden per app below) */
  --app: #0071e3;
  --app-2: #5856d6;
  --app-dim: rgba(0, 113, 227, 0.10);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --border-soft: rgba(255, 255, 255, 0.10);
  --text: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.78);
  --text-tertiary: #86868b;
  --accent: #0a84ff;
  --link: #2997ff;
  --red: #ff6961;
  --red-dim: rgba(255, 69, 58, 0.16);
  --amber: #ff9f0a;
  --amber-dim: rgba(255, 159, 10, 0.15);
}

body.app-cashy    { --app: #3a6cf4; --app-2: #803fed; --app-dim: rgba(58, 108, 244, 0.10); }
body.app-freshlog { --app: #0b7480; --app-2: #1586b0; --app-dim: rgba(20, 160, 170, 0.12); }
html[data-theme="dark"] body.app-cashy    { --app: #7fa2ff; --app-2: #b48cff; --app-dim: rgba(127, 162, 255, 0.14); }
html[data-theme="dark"] body.app-freshlog { --app: #5ad4dc; --app-2: #6cc0f0; --app-dim: rgba(90, 212, 220, 0.14); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: var(--app-dim); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── NAV (frosted, same as main site) ── */
#scrollProg {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--app), var(--app-2));
  z-index: 300; transition: width 0.1s linear;
}
.legal-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.legal-nav.scrolled { background: rgba(255, 255, 255, 0.85); border-bottom-color: var(--border-soft); }
html[data-theme="dark"] .legal-nav { background: rgba(22, 22, 23, 0.72); }
html[data-theme="dark"] .legal-nav.scrolled { background: rgba(22, 22, 23, 0.85); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: var(--nav-h); }
.logo { display: flex; align-items: center; text-decoration: none !important; }
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.logo-text span, .grad {
  background: linear-gradient(90deg, #0090f7 0%, #6a5af9 40%, #b16cea 70%, #0090f7 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 7s ease-in-out infinite;
}
.grad-app {
  background: linear-gradient(90deg, var(--app), var(--app-2), var(--app));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 7s ease-in-out infinite;
}
@keyframes gradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-secondary); font-size: 13px;
  padding: 7px 13px; border-radius: 980px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(0, 0, 0, 0.05); text-decoration: none; }
html[data-theme="dark"] .nav-link:hover { background: rgba(255, 255, 255, 0.08); }
.theme-toggle {
  background: rgba(0, 0, 0, 0.05); border: none; color: var(--text-secondary);
  width: 30px; height: 30px; border-radius: 980px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-family: inherit; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.theme-toggle:hover { background: rgba(0, 0, 0, 0.09); color: var(--text); }
html[data-theme="dark"] .theme-toggle { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .theme-toggle:hover { background: rgba(255, 255, 255, 0.14); color: var(--text); }

/* ── HERO ── */
.legal-hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 56px;
  text-align: center;
  overflow: hidden;
}
.legal-hero::before {
  content: ''; position: absolute; z-index: -1;
  left: 50%; top: -40px; width: 760px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--app-dim), transparent);
  filter: blur(10px);
  pointer-events: none;
}
.app-icon {
  width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.eyebrow {
  font-size: 13px; font-weight: 600; color: var(--app);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px;
}
.legal-hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.035em;
  margin-bottom: 14px; text-wrap: balance;
}
.hero-sub {
  font-size: 17px; color: var(--text-secondary); max-width: 620px; margin: 0 auto;
  text-wrap: balance;
}
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  background: var(--surface); padding: 6px 12px; border-radius: 980px;
}
.chip i { font-size: 14px; color: var(--app); }

/* ── AT A GLANCE ── */
.glance { margin-bottom: 56px; }
.glance-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 12px; text-align: center;
}
.glance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.glance-grid.cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 780px; margin: 0 auto; }
.glance-tile {
  display: block; color: inherit; text-decoration: none !important;
  background: var(--surface); border-radius: var(--radius-md);
  padding: 20px 18px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}
a.glance-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08); }
html[data-theme="dark"] a.glance-tile:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5); }
.glance-icon {
  width: 36px; height: 36px; border-radius: 10px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--app-dim); color: var(--app); font-size: 19px;
}
.glance-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.glance-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ── LAYOUT: sticky contents + article ── */
.legal-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-bottom: 96px;
}
.toc { position: sticky; top: calc(var(--nav-h) + 28px); }
.toc-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 12px;
}
.toc ol { list-style: none; border-left: 1px solid var(--border-soft); position: relative; }
.toc a {
  display: block; margin-left: -1px; padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  font-size: 13.5px; line-height: 1.4; color: var(--text-tertiary);
  text-decoration: none !important;
  transition: color 0.15s, border-color 0.15s;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--text); font-weight: 500; border-left-color: var(--app); }
.toc .toc-num { color: var(--app); font-variant-numeric: tabular-nums; margin-right: 6px; }

.legal-body { max-width: 780px; min-width: 0; }
.lead {
  font-size: 17px; line-height: 1.7; color: var(--text-secondary);
  margin-bottom: 28px;
}
.lead strong { color: var(--text); }

/* ── POLICY SECTIONS ── */
.policy-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 34px 38px 26px;
  margin-bottom: 16px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.policy-section h2 {
  display: flex; align-items: center; gap: 12px;
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25;
  margin-bottom: 18px;
}
.num {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--app-dim); color: var(--app);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.policy-section h3 {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  margin: 26px 0 10px; color: var(--text);
}
.policy-section h2 + h3 { margin-top: 4px; }
.policy-section p,
.policy-section li { font-size: 15.5px; line-height: 1.72; color: var(--text-secondary); }
.policy-section p { margin-bottom: 12px; }
.policy-section strong, .policy-section b { color: var(--text); font-weight: 600; }

.policy-section ul, .policy-section ol { list-style: none; margin-bottom: 14px; }
.policy-section ul > li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.policy-section ul > li::before {
  content: ''; position: absolute; left: 5px; top: 0.72em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--app);
}
.policy-section ul ul { margin: 10px 0 4px; padding: 12px 16px; background: var(--bg); border-radius: var(--radius-sm); }
.policy-section ul ul > li { font-size: 14.5px; margin-bottom: 4px; }
.policy-section ul ul > li::before { background: transparent; border: 1.5px solid var(--app); width: 6px; height: 6px; }

/* "do NOT / NEVER" lists */
.policy-section ul.list-no > li { padding-left: 32px; }
.policy-section ul.list-no > li::before {
  content: '\2715'; left: 0; top: 0.28em;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red-dim); color: var(--red);
  font-size: 10px; font-weight: 700; line-height: 20px; text-align: center;
}
/* positive check lists */
.policy-section ul.list-yes > li { padding-left: 32px; }
.policy-section ul.list-yes > li::before {
  content: '\2713'; left: 0; top: 0.28em;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--app-dim); color: var(--app);
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}

/* numbered steps */
.policy-section ol.steps { counter-reset: step; margin: 4px 0 16px; }
.policy-section ol.steps > li {
  counter-increment: step; position: relative;
  padding: 12px 16px 12px 56px; margin-bottom: 8px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.policy-section ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--app), var(--app-2)); color: #fff;
  font-size: 13px; font-weight: 700; line-height: 28px; text-align: center;
}

/* labelled cards (rights, data sent) */
.policy-section ul.card-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px;
}
.policy-section ul.card-list > li {
  padding: 16px 16px 14px; margin: 0;
  background: var(--bg); border-radius: var(--radius-md);
  font-size: 14.5px; line-height: 1.6;
}
.policy-section ul.card-list > li::before { display: none; }
.policy-section ul.card-list > li.wide { grid-column: 1 / -1; }
.card-ico {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; margin-bottom: 10px;
  background: var(--app-dim); color: var(--app); font-size: 16px;
}
.policy-section ul.card-list > li > strong:first-of-type,
.policy-section ul.card-list > li > b:first-of-type { display: block; margin-bottom: 2px; }

/* callouts */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; margin: 4px 0 18px;
  border-radius: var(--radius-md);
  background: var(--app-dim);
}
.callout > i { font-size: 20px; color: var(--app); line-height: 1.5; flex-shrink: 0; }
.callout p { margin: 0 !important; color: var(--text) !important; }
.callout.warn { background: var(--amber-dim); }
.callout.warn > i { color: var(--amber); }

/* in-app paths like "Settings → Delete All Data" */
.path {
  font-weight: 600; color: var(--text);
  background: var(--bg); padding: 1px 8px; border-radius: 6px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  white-space: normal;
}
/* inside cards/steps the background is --bg, so flip the chip to --surface */
.card-list .path, .steps .path, .contact-box .path { background: var(--surface); }
.callout .path { background: var(--bg); }

/* contact block */
.contact-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 8px 0 14px; padding: 18px 20px;
  background: var(--bg); border-radius: var(--radius-md);
}
.contact-box .label { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.contact-box .value { font-size: 15.5px; font-weight: 600; color: var(--text); word-break: break-all; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 980px;
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
  text-decoration: none !important; border: none; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--app), var(--app-2)); color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22); transform: translateY(-1px); }

.fine-print {
  margin-top: 28px; padding: 0 4px;
  font-size: 13px; line-height: 1.6; color: var(--text-tertiary);
}

.related {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px;
}
.related a {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); text-decoration: none !important;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}
.related a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08); }
.related img { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; }
.related .r-label { font-size: 12px; color: var(--text-tertiary); }
.related .r-title { font-size: 14.5px; font-weight: 600; }
.related i.ti-arrow-right { margin-left: auto; color: var(--text-tertiary); }

/* ── FOOTER (same as main site) ── */
footer { background: var(--surface); border-top: 1px solid var(--border-soft); padding: 28px 0 32px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-tertiary);
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-tertiary); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-links a[aria-current="page"] { color: var(--text); }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); background: rgba(0, 0, 0, 0.05); font-size: 16px;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.footer-social a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
html[data-theme="dark"] .footer-social a { background: rgba(255, 255, 255, 0.08); }

/* ── BACK TO TOP ── */
#toTop {
  position: fixed; right: 24px; bottom: 24px; z-index: 500;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--surface); color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--border-soft);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s, color 0.2s;
}
#toTop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#toTop:hover { background: var(--app); color: #fff; }

/* theme switch ripple (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .glance-grid { grid-template-columns: repeat(2, 1fr); }
  /* block (not grid) so the sticky contents bar sticks for the whole article */
  .legal-layout { display: block; }
  .toc {
    position: sticky; top: var(--nav-h); z-index: 100;
    margin: 0 -24px 20px; padding: 10px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-soft);
  }
  html[data-theme="dark"] .toc { background: rgba(22, 22, 23, 0.85); }
  .toc-title { display: none; }
  .toc ol {
    display: flex; gap: 8px; border-left: none;
    overflow-x: auto; scrollbar-width: none; padding: 0 24px;
    scroll-padding: 0 24px;
  }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc li { flex-shrink: 0; }
  .toc a {
    margin: 0; padding: 7px 13px; border: none; border-radius: 980px;
    background: var(--surface); font-size: 13px; white-space: nowrap;
  }
  /* --bg text on --app: white on the deep light-mode accent, black on the bright dark-mode accent */
  .toc a.active { background: var(--app); color: var(--bg); border: none; }
  .toc a.active .toc-num { color: inherit; opacity: 0.8; }
  .policy-section { scroll-margin-top: calc(var(--nav-h) + 72px); }
  .legal-body { max-width: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .toc { margin: 0 -16px 16px; }
  .toc ol { padding: 0 16px; scroll-padding: 0 16px; }
  .legal-hero { padding: calc(var(--nav-h) + 44px) 0 40px; }
  .app-icon { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 18px; }
  .hero-sub { font-size: 15.5px; }
  .glance { margin-bottom: 36px; }
  .glance-grid { gap: 10px; }
  .glance-tile { padding: 16px 14px; }
  .policy-section { padding: 24px 20px 16px; border-radius: 20px; }
  .policy-section h2 { font-size: 19px; gap: 10px; }
  .num { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
  .policy-section p, .policy-section li { font-size: 15px; }
  .policy-section ul.card-list { grid-template-columns: 1fr; }
  .related { grid-template-columns: 1fr; }
  .lead { font-size: 16px; }
  .nav-link span { display: none; }
  .nav-link { padding: 7px 10px; }
  .footer-inner { flex-direction: column; text-align: center; gap: 12px; }
  .footer-links { justify-content: center; }
  #toTop { right: 16px; bottom: 16px; }
}
@media (max-width: 380px) {
  .glance-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── PRINT: plain document ── */
@media print {
  .legal-nav, #scrollProg, .toc, #toTop, .footer-social, .theme-toggle, .glance { display: none !important; }
  body { background: #fff; color: #000; }
  .legal-hero { padding: 0 0 16px; text-align: left; }
  .legal-hero::before { display: none; }
  .app-icon { margin: 0 0 12px; width: 48px; height: 48px; }
  .legal-layout { display: block; padding: 0; }
  .policy-section { background: none; padding: 0; margin-bottom: 20px; break-inside: avoid-page; }
  .grad, .grad-app { -webkit-text-fill-color: currentColor; background: none; }
}
