/* SparkFlow · Aurora Glass theme layer
   Loaded after app.css. Pure visual overrides: no layout or JS contract changes.
   Palette: rose → violet → cyan on a deep aurora canvas. */

:root {
  --bg: #f7f4ff;
  --bg-tint: #efe9ff;
  --surface: rgba(255, 255, 255, .78);
  --surface-sunk: #f1ecff;
  --surface-raised: rgba(255, 255, 255, .92);
  --ink: #1a1430;
  --ink-2: #554b6b;
  --ink-3: #8b82a3;
  --line: rgba(124, 58, 237, .13);
  --line-strong: rgba(124, 58, 237, .26);
  --flame: #ff4d6d;
  --flame-deep: #e11d48;
  --ember: #f59e0b;
  --spark-soft: #ffe4ea;
  --weak: #ffc2cf;
  --ok: #0f9f8f;
  --ok-soft: #dcf7f1;
  --warn: #b45309;
  --warn-soft: #fff1d6;
  --bad: #dc2626;
  --bad-soft: #ffe4e6;
  --info: #0e7490;
  --info-soft: #e0f2fe;
  --track: #eee6ff;
  --shadow: 0 1px 2px rgba(45, 20, 80, .06), 0 18px 40px -22px rgba(88, 28, 135, .35);
  --shadow-lg: 0 2px 8px rgba(45, 20, 80, .08), 0 36px 80px -30px rgba(88, 28, 135, .45);
  --accent-grad: linear-gradient(135deg, #ff6b6b 0%, #a855f7 48%, #38bdf8 100%);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0716;
  --bg-tint: #120c24;
  --surface: rgba(26, 19, 48, .72);
  --surface-sunk: #160f2b;
  --surface-raised: rgba(36, 26, 64, .88);
  --ink: #f4f0ff;
  --ink-2: #c4b9e0;
  --ink-3: #8e82ad;
  --line: rgba(168, 139, 250, .16);
  --line-strong: rgba(168, 139, 250, .32);
  --flame: #ff6b81;
  --flame-deep: #ff8fa3;
  --ember: #fbbf24;
  --spark-soft: #321a2b;
  --weak: #6b2f45;
  --ok: #34d399;
  --ok-soft: #0d2b27;
  --warn: #fbbf24;
  --warn-soft: #32260d;
  --bad: #fb7185;
  --bad-soft: #3a1420;
  --info: #67e8f9;
  --info-soft: #0d2a33;
  --track: #241a3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 52px -24px rgba(0, 0, 0, .8);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .45), 0 40px 90px -34px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

html { background: var(--bg); }
body {
  background: transparent !important;
  isolation: isolate;
}
.page, .auth { background: transparent !important; }

/* Animated aurora canvas. */
body::before {
  content: "";
  position: fixed;
  inset: -28%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 16% 18%, rgba(255, 107, 107, .26), transparent 70%),
    radial-gradient(38% 34% at 82% 12%, rgba(168, 85, 247, .26), transparent 72%),
    radial-gradient(46% 40% at 58% 82%, rgba(56, 189, 248, .20), transparent 72%),
    radial-gradient(30% 26% at 92% 70%, rgba(251, 191, 36, .12), transparent 70%);
  filter: blur(64px) saturate(130%);
  animation: aurora-drift 24s ease-in-out infinite alternate;
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(42% 38% at 16% 18%, rgba(255, 107, 129, .20), transparent 70%),
    radial-gradient(38% 34% at 82% 12%, rgba(139, 92, 246, .28), transparent 72%),
    radial-gradient(46% 40% at 58% 82%, rgba(56, 189, 248, .18), transparent 72%),
    radial-gradient(30% 26% at 92% 70%, rgba(251, 191, 36, .10), transparent 70%);
  filter: blur(72px) saturate(140%);
}
@keyframes aurora-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(-1%, 3%, 0) scale(1.02); }
}

/* Glass surfaces. */
.card,
.auth-card,
.metric-card,
.fold,
.status-banner,
.settings-nav,
.login-lock-card {
  background: color-mix(in srgb, var(--surface) 86%, transparent) !important;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border-color: var(--line) !important;
}
.card { box-shadow: var(--shadow); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--flame) 30%) !important; }
}

/* Brand + headings. */
.brand-mark {
  background: var(--accent-grad) !important;
  box-shadow: 0 8px 24px -8px rgba(168, 85, 247, .7), 0 0 0 1px rgba(255,255,255,.18) inset;
  animation: brand-float 6s ease-in-out infinite;
}
@keyframes brand-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.eyebrow { color: var(--flame-deep) !important; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.page-title, .auth-story h1 span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.auth-story h1 { color: var(--ink); }

/* Primary action with gradient + moving sheen. */
.button-primary {
  position: relative;
  overflow: hidden;
  background: var(--accent-grad) !important;
  background-size: 180% 180% !important;
  border: 0 !important;
  box-shadow: 0 12px 30px -14px rgba(168, 85, 247, .75), 0 0 0 1px rgba(255,255,255,.12) inset;
  transition: background-position .45s ease, transform .15s ease, box-shadow .2s ease;
}
.button-primary > * { position: relative; z-index: 1; }
.button-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.38) 48%, transparent 72%);
  transform: translateX(-130%);
  transition: transform .65s ease;
  pointer-events: none;
}
.button-primary:hover { background-position: 100% 50% !important; }
.button-primary:hover::after { transform: translateX(130%); }

/* Navigation glow. */
.nav-item.active {
  background: linear-gradient(135deg, rgba(255,107,107,.16), rgba(168,85,247,.18) 55%, rgba(56,189,248,.14)) !important;
  color: var(--flame-deep) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--flame) 22%, transparent), 0 8px 20px -14px rgba(168,85,247,.55);
}
.tabbar {
  background: color-mix(in srgb, var(--surface) 82%, transparent) !important;
  border-color: color-mix(in srgb, var(--line-strong) 70%, transparent) !important;
  box-shadow: 0 20px 50px -22px rgba(88,28,135,.55) !important;
}
.tabbar a.active {
  background: linear-gradient(135deg, rgba(255,107,107,.16), rgba(168,85,247,.18)) !important;
  color: var(--flame-deep) !important;
}

/* Status pills + badges. */
.pill {
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(8px);
}
.pill.success { background: color-mix(in srgb, var(--ok-soft) 78%, transparent); }
.pill.warning { background: color-mix(in srgb, var(--warn-soft) 78%, transparent); }
.pill.danger { background: color-mix(in srgb, var(--bad-soft) 78%, transparent); }
.pill.info { background: color-mix(in srgb, var(--info-soft) 78%, transparent); }
.spark-badge {
  background: linear-gradient(90deg, rgba(255,107,107,.18), rgba(168,85,247,.18)) !important;
  box-shadow: 0 0 0 1px rgba(255,107,107,.14) inset;
}

/* Cards / rows get a subtle glow edge on hover. */
.license-code, .friend-option, .target-record, .account-row {
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .license-code:hover, .target-record:hover {
    border-color: color-mix(in srgb, var(--flame) 30%, var(--line-strong)) !important;
    box-shadow: 0 10px 30px -22px rgba(168,85,247,.65);
  }
}

/* Inputs. */
input, select, textarea {
  background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
  border-color: var(--line) !important;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: color-mix(in srgb, var(--flame) 45%, var(--line-strong)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--flame) 16%, transparent), 0 8px 24px -18px rgba(168,85,247,.6);
}

/* Dialog glass. */
dialog, .qr-dialog-card, .chat-dialog-card {
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent) !important;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--line);
}
dialog::backdrop { background: rgba(10, 5, 25, .55) !important; backdrop-filter: blur(6px); }

/* Scrollbar. */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--flame) 35%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(255,107,107,.5), rgba(168,85,247,.5)); border-radius: 99px; }

@media (prefers-reduced-motion: reduce) {
  body::before, .brand-mark { animation: none !important; }
  .button-primary::after { display: none; }
}
