/* =========================================================
   BEATS v1.2 — shared UI for landing, register, login, owner dashboard and super admin.
   1) design tokens  (light = the previous look, dark = new)
   2) quick-read / easy-manage refinements
   3) dark fixes for translucent panels
   Switched by <html data-mode="light|dark"> (set before first paint, see ui.js).
   ========================================================= */

/* ---------- 1. tokens ---------- */
body {
  --bg: #fdf8f5; --bg2: #fffaf4; --surface: #ffffff; --surface2: #f3eef0;
  --text: #3a2230; --muted: #6d5560; --muted2: #8a7a80;
  --rose-solid: var(--rose); --wine-solid: var(--wine);
  --header-bg: #6e1f3d; --header-fg: #f4dde5;
  --ok-bg: #e3f5e5; --ok-fg: #2b6b31; --ok-line: #b7dfba; --success: #2b6b31;
  --err-bg: #fbe4e4; --err-fg: #a83a3a; --err-line: #e3a8a8; --danger: #a83a3a;
  --warn-bg: #fdf3d8; --warn-fg: #8a6d1a;
  --info-bg: #e6eefc; --info-fg: #2c5aa0; --info: #2c5aa0;
  --radius: 12px; --shadow: 0 2px 10px rgba(80,30,50,.08);
}

html[data-mode="dark"] { color-scheme: dark; }
html[data-mode="dark"] body {
  --bg: #151115; --bg2: #1c161b; --surface: #211b20; --surface2: #2c252b;
  --text: #f1e6ea; --muted: #c9b6be; --muted2: #9d8b93;
  --rose: #e48aa9; --rose-solid: #b94a72; --wine: #f0c9d6; --wine-solid: #9c3a5c; --gold: #d9b46a; --blush: #2d1c26;
  --line: rgba(228,138,169,.28);
  --header-bg: #2a1620; --header-fg: #f4dde5;
  --ok-bg: #16301b; --ok-fg: #86dc92; --ok-line: #2c5a33; --success: #2e8a3a;
  --err-bg: #3a1a1c; --err-fg: #ff9d9d; --err-line: #6b2c2e; --danger: #c24545;
  --warn-bg: #3a2f12; --warn-fg: #f0cf72;
  --info-bg: #15233d; --info-fg: #90b5f2; --info: #3a6fc4;
  --shadow: 0 2px 12px rgba(0,0,0,.45);
  /* public pages without a theme (landing, register, login...) use the rose-gold dark palette */
}
html[data-mode="dark"] body:not([data-theme]) { --cream: #1d1118; --ink: #f1dfe6; --card-tint: rgba(255,255,255,.06); }
html[data-mode="dark"] body[data-theme] { --bg: var(--cream); --bg2: var(--blush); --surface: var(--blush); --surface2: var(--cream); --text: var(--ink); --muted: var(--ink); --muted2: var(--ink); }

body { background-color: var(--bg); color: var(--text); }

/* floating light/dark button (pages without a header of their own) */
.ui-mode { background: transparent; border: 1px solid var(--header-fg, #f4dde5); color: var(--header-fg, #f4dde5); width: 34px; height: 34px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer; margin-left: 12px; vertical-align: middle; padding: 0; }
.ui-mode.float { position: fixed; top: 12px; right: 12px; z-index: 9999; background: var(--surface); color: var(--rose); border-color: var(--line); box-shadow: var(--shadow); margin: 0; }

/* ---------- 3. dark fixes: translucent white panels ---------- */
html[data-mode="dark"] :is(.success-box, .how-it-works, .lp-feature, .hiw-step, .type-card, .status-box, .nav-btn.login) { background: rgba(255,255,255,.06); color: var(--text); }
html[data-mode="dark"] .type-plain { background: rgba(255,255,255,.03); }
html[data-mode="dark"] :is(fieldset, .box) { background: var(--surface); }
html[data-mode="dark"] :is(.success-box, .status-box, .box) :is(h1, h2, p, li, label) { color: var(--text); }
html[data-mode="dark"] code { background: var(--surface2); color: var(--text); }
html[data-mode="dark"] :is(.btn, button.save, .lp-cta, .renew-btn, .tabs a.active, .pv-bar button.active) { color: #fff; }
html[data-mode="dark"] header a { color: var(--header-fg); }
html[data-mode="dark"] img { filter: brightness(.94); }
html[data-mode="dark"] header img, html[data-mode="dark"] .brand img { filter: none; }
