/* ────────────────────────────────────────────────────────────────────
 * Brand OS · Design tokens (ported from /OSX Tool LightDark Mode Design)
 * Single CSS file shared by landing, auth and dashboard.
 * Supports auto / dark / light via [data-theme] on <html> and three accents.
 * ────────────────────────────────────────────────────────────────────*/

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #07070a;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ===== DARK (default + auto-dark) ===== */
:root,
[data-theme="dark"] {
  --app-bg:
    radial-gradient(1100px 760px at 6% -12%, rgba(143,123,240,0.26), transparent 56%),
    radial-gradient(980px 820px at 116% -4%, rgba(110,80,222,0.22), transparent 54%),
    radial-gradient(1000px 900px at 52% 132%, rgba(72,118,214,0.18), transparent 60%),
    linear-gradient(180deg, #101016, #0a0a0e);
  --sidebar: rgba(20,20,28,0.62);
  --surface: rgba(28,28,36,0.85);
  --surface-2: rgba(54,54,67,0.8);
  --surface-3: rgba(76,76,93,0.82);
  --glass-border: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.11);
  --border-2: rgba(255,255,255,0.06);
  --hi: rgba(255,255,255,0.08);
  --text: #f2f1f8;
  --text-2: #aaa9ba;
  --text-3: #76757f;
  --card: #1e1e27;
  --shadow: inset 0 1px 0 var(--hi), 0 1px 2px rgba(0,0,0,0.32), 0 18px 46px rgba(0,0,0,0.46);
  --shadow-pop: inset 0 1px 0 rgba(255,255,255,0.12), 0 28px 72px rgba(0,0,0,0.58);
  --blur: blur(20px) saturate(1.4);
}

/* ===== LIGHT (explicit + auto-light fallback) ===== */
[data-theme="light"] {
  --app-bg:
    radial-gradient(1050px 700px at 4% -12%, rgba(150,120,238,0.30), transparent 56%),
    radial-gradient(960px 780px at 118% 2%, rgba(176,146,244,0.24), transparent 54%),
    radial-gradient(900px 820px at 50% 130%, rgba(150,170,240,0.18), transparent 60%),
    linear-gradient(180deg, #f1eff7, #e7e4f0);
  --sidebar: rgba(255,255,255,0.62);
  --surface: rgba(255,255,255,0.86);
  --surface-2: rgba(244,243,250,0.82);
  --surface-3: rgba(232,230,243,0.85);
  --glass-border: rgba(255,255,255,0.75);
  --border: rgba(28,22,60,0.09);
  --border-2: rgba(28,22,60,0.05);
  --hi: rgba(255,255,255,0.85);
  --text: #1b1a26;
  --text-2: #5f5d70;
  --text-3: #9694a6;
  --card: #ffffff;
  --shadow: inset 0 1px 0 var(--hi), 0 1px 2px rgba(40,30,80,0.05), 0 14px 36px rgba(80,66,140,0.11);
  --shadow-pop: inset 0 1px 0 rgba(255,255,255,0.92), 0 28px 64px rgba(70,55,130,0.24);
  --blur: blur(20px) saturate(1.3);
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --app-bg:
      radial-gradient(1050px 700px at 4% -12%, rgba(150,120,238,0.30), transparent 56%),
      radial-gradient(960px 780px at 118% 2%, rgba(176,146,244,0.24), transparent 54%),
      radial-gradient(900px 820px at 50% 130%, rgba(150,170,240,0.18), transparent 60%),
      linear-gradient(180deg, #f1eff7, #e7e4f0);
    --sidebar: rgba(255,255,255,0.62);
    --surface: rgba(255,255,255,0.86);
    --surface-2: rgba(244,243,250,0.82);
    --surface-3: rgba(232,230,243,0.85);
    --glass-border: rgba(255,255,255,0.75);
    --border: rgba(28,22,60,0.09);
    --border-2: rgba(28,22,60,0.05);
    --hi: rgba(255,255,255,0.85);
    --text: #1b1a26;
    --text-2: #5f5d70;
    --text-3: #9694a6;
    --card: #ffffff;
    --shadow: inset 0 1px 0 var(--hi), 0 1px 2px rgba(40,30,80,0.05), 0 14px 36px rgba(80,66,140,0.11);
    --shadow-pop: inset 0 1px 0 rgba(255,255,255,0.92), 0 28px 64px rgba(70,55,130,0.24);
    --blur: blur(20px) saturate(1.3);
  }
}

/* ===== ACCENTS (last; overrides theme) ===== */
:root,
[data-accent="lavender"] {
  --accent: #8f7bf0; --accent-2: #7a64e8; --accent-3: #674fd6;
  --accent-soft: rgba(143,123,240,0.16); --glow: rgba(143,123,240,0.65); --on-accent: #ffffff;
}
[data-accent="violet"] {
  --accent: #8a57e6; --accent-2: #7340d6; --accent-3: #5f2fc4;
  --accent-soft: rgba(138,87,230,0.16); --glow: rgba(138,87,230,0.68); --on-accent: #ffffff;
}
[data-accent="indigo"] {
  --accent: #6f73e8; --accent-2: #565ad9; --accent-3: #4347c8;
  --accent-soft: rgba(111,115,232,0.16); --glow: rgba(111,115,232,0.66); --on-accent: #ffffff;
}

/* ===== Animations ===== */
@keyframes bvFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bvRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bvPop  { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bvDrift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,30px) scale(1.12); } }
@keyframes bvDrift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-46px,38px) scale(1.08); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ===== Root layouts ===== */
.app-root {
  position: relative;
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--text);
  overflow-x: hidden;
}
.glow-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.glow-layer .g1 { position:absolute; top:-14%; left:-6%; width:50%; height:62%; border-radius:50%; background:radial-gradient(circle, var(--glow), transparent 68%); filter:blur(36px); opacity:0.55; animation: bvDrift1 21s ease-in-out infinite; }
.glow-layer .g2 { position:absolute; top:-8%; right:-8%; width:50%; height:62%; border-radius:50%; background:radial-gradient(circle, var(--accent-3), transparent 70%); filter:blur(40px); opacity:0.4; animation: bvDrift2 25s ease-in-out infinite; }
.glow-layer .g3 { position:absolute; bottom:-22%; left:38%; width:55%; height:66%; border-radius:50%; background:radial-gradient(circle, rgba(96,134,224,0.5), transparent 70%); filter:blur(44px); opacity:0.38; animation: bvDrift1 29s ease-in-out infinite; }

/* ===== Shared components ===== */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand-logo .mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px var(--accent-soft);
}
.brand-logo .wm {
  font-size: 17px; font-weight: 700;
  letter-spacing: -0.3px;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  border: none; border-radius: 11px;
  color: var(--on-accent);
  font-size: 14px; font-weight: 650;
  cursor: pointer;
  box-shadow: 0 8px 22px var(--accent-soft);
  transition: transform .12s ease;
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

.chip {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--text-2);
}
.chip.active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-size: 13px; font-weight: 600;
  padding: 11px 20px;
  border-radius: 12px;
  box-shadow: 0 14px 36px var(--accent-soft);
  z-index: 100;
  display: flex; align-items: center; gap: 9px;
  animation: bvRise .18s ease;
}
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }

.alert {
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert.error   { background: rgba(231, 70, 70, .12); color: #ff8b8b; border: 1px solid rgba(231, 70, 70, .25); }
.alert.success { background: rgba(55, 196, 107, .12); color: #5be191; border: 1px solid rgba(55, 196, 107, .25); }
