/* Shared tokens (standalone legal pages + footer) — aligned with app DESIGN_light / DESIGN_dark */
:root {
  --accent:      #5b6af0;
  --accent-soft: rgba(91, 106, 240, 0.12);
  --bg:          #f5f6fa;
  --surface:     #ffffff;
  --border:      rgba(26, 29, 46, 0.1);
  --text:        #1a1d2e;
  --muted:       #7a7f99;
  --radius:      12px;
  --shadow:      0 12px 32px rgba(26, 29, 46, 0.06);
  --page-inline: 20px;
  --header-bg:   #ffffff;
  --header-border: rgba(26, 29, 46, 0.08);
}

/* Dark tokens: explicit choice (home / js/theme-boot.js) or OS dark when unset */
html[data-theme="dark"] {
  --accent:      #a5b4fc;
  --accent-soft: rgba(165, 180, 252, 0.14);
  --bg:          #0f172a;
  --surface:     #1e293b;
  --border:      rgba(148, 163, 184, 0.35);
  --text:        #e2e8f0;
  --muted:       #94a3b8;
  --shadow:      0 40px 40px rgba(6, 14, 32, 0.12);
  --header-bg:   rgba(15, 23, 42, 0.78);
  --header-border: rgba(148, 163, 184, 0.25);
}

@media (prefers-color-scheme: dark) {
  /* When data-theme is not set, follow OS (e.g. static HTML before script runs). */
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --accent:      #bdc2ff;
    --accent-soft: rgba(189, 194, 255, 0.14);
    --bg:          #0b1326;
    --surface:     #171f33;
    --border:      rgba(69, 70, 84, 0.45);
    --text:        #dae2fd;
    --muted:       #c6c5d7;
    --shadow:      0 40px 40px rgba(6, 14, 32, 0.12);
    --header-bg:   rgba(11, 19, 38, 0.78);
    --header-border: rgba(69, 70, 84, 0.35);
  }
}

/* Login: stack card + footer */
#login-screen {
  flex-direction: column;
  justify-content: flex-start;
}

/* App shell: pin footer when content is short (shared footer after #app) */
.site-root > .site-footer {
  margin-top: auto;
  flex-shrink: 0;
}

.site-footer {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px var(--page-inline) 28px;
  box-sizing: border-box;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.site-footer-meta {
  margin-bottom: 10px;
  max-width: 42em;
  margin-left: auto;
  margin-right: auto;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 6px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer-meta a {
  font-weight: 600;
}

.site-footer-sep {
  color: var(--muted);
  opacity: 0.65;
  user-select: none;
  padding: 0 0.35em;
}

/* ─── Standalone legal pages ───────────────────────────── */
.legal-body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .legal-body {
  font-family: Manrope, system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .legal-body {
    font-family: Manrope, system-ui, -apple-system, sans-serif;
  }
}

.legal-header {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  padding: 14px var(--page-inline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.legal-brand {
  font-size: 17px;
  font-weight: 700;
  font-family: Manrope, Inter, system-ui, sans-serif;
  color: var(--accent);
  letter-spacing: -0.3px;
  text-decoration: none;
}

.legal-brand:hover {
  text-decoration: underline;
}

.legal-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.legal-back:hover {
  color: var(--text);
}

.legal-main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px var(--page-inline) 40px;
  box-sizing: border-box;
}

.legal-main h1 {
  font-size: 1.65rem;
  font-weight: 700;
  font-family: Manrope, Inter, system-ui, sans-serif;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.legal-main h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 26px 0 10px;
  color: var(--text);
}

.legal-main p {
  margin-bottom: 12px;
  color: var(--text);
}

.legal-main ul {
  margin: 0 0 14px 1.1rem;
  padding: 0;
}

.legal-main li {
  margin-bottom: 8px;
}

.legal-main a {
  color: var(--accent);
  font-weight: 500;
}

.legal-main a:hover {
  text-decoration: underline;
}

.legal-note {
  font-size: 13px;
  color: var(--muted);
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--header-border);
  margin-top: 28px;
}

.legal-body .site-footer {
  border-top: 1px solid var(--border);
  margin-top: 0;
}

/* Support ticket form (support.html) */
.support-ticket-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.support-ticket-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 14px;
  margin-bottom: 6px;
  color: var(--text);
}

.support-ticket-form input,
.support-ticket-form textarea {
  width: 100%;
  max-width: 36rem;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.support-ticket-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* data-deletion.html — full-width deletion request (no 36rem cap) */
.data-deletion-request-form input,
.data-deletion-request-form textarea {
  max-width: none;
  width: 100%;
}

.support-ticket-actions {
  margin-top: 16px;
}

.support-ticket-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.support-ticket-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.support-ticket-msg {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.support-ticket-msg.is-error {
  color: #b42318;
}

html[data-theme="dark"] .support-ticket-msg.is-error {
  color: #ff8a80;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .support-ticket-msg.is-error {
    color: #ff8a80;
  }
}
