/* Styles for legal content (privacy policy, terms) — shared by the
   standalone pages (privacy-policy.html / terms.html) and the in-app
   overlay modals in index.html. Loaded after st.css — reuses the same
   design tokens (--accent, --border, --font-display, --gold, etc.)
   defined in st.css's :root, so it must always be included on a page
   that already has st.css linked. */

/* ── Standalone-page chrome (privacy-policy.html / terms.html only) ── */
body.legal-page-body {
  background: var(--bg);
  min-height: 100%;
}
.legal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.legal-page-header .logo-img { height: 28px; width: auto; display: block; }
.legal-back-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.legal-back-link:hover { text-decoration: underline; }

/* The standalone page presents the same "card floating on the app
   background" look as an in-app modal, so it feels like the same
   product whether you land here directly or open it as an overlay. */
.legal-page-card-wrap {
  display: flex;
  justify-content: center;
  padding: 3rem 1.25rem 4rem;
}
.legal-page-card {
  background: var(--surface);
  border-radius: 12px;
  width: 720px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.1);
  border: 1px solid var(--border);
  overflow: hidden;
}
.legal-page-card .legal-content { padding: 2.6rem 2.6rem 3rem; }

/* ── In-app overlay modal (index.html) ── */
.legal-modal-box {
  width: 700px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.legal-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 2rem 2.4rem 2.6rem;
  background: var(--surface);
}
@media (max-width: 640px) {
  .legal-modal-box { width: 100%; }
  .legal-modal-body { padding: 1.4rem 1.3rem 2rem; }
}

/* ── Shared typography, used inside both contexts ── */
.legal-content { counter-reset: legalsec; }

.legal-content h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 .4rem;
  color: var(--text);
}
.legal-updated {
  color: var(--muted);
  font-size: .76rem;
  letter-spacing: .02em;
  margin: 0 0 1.7rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* Numbered section headings, styled like the form panel's circular
   ①②③ section icons for a consistent look across the whole app. */
.legal-content h2 {
  counter-increment: legalsec;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.4rem 0 1rem;
}
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content h2::before {
  content: counter(legalsec);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(var(--accent-rgb), .08);
}

.legal-content p, .legal-content li {
  line-height: 1.7;
  font-size: .9rem;
  color: var(--text);
}
.legal-content p { margin: 0 0 1rem; }
.legal-content ul, .legal-content ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
}
.legal-content li { margin-bottom: .4rem; }
.legal-content li::marker { color: var(--gold); }
.legal-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-content strong { color: var(--text); font-weight: 700; }
.legal-content code {
  background: rgba(var(--accent-rgb), .06);
  border-radius: 4px;
  padding: .1rem .35rem;
  font-size: .85em;
}

.legal-note {
  background: rgba(var(--accent-rgb), .05);
  border: 1px solid rgba(var(--accent-rgb), .14);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  font-size: .83rem;
  line-height: 1.6;
  margin: 0 0 1.8rem;
  color: var(--text);
}
