/* ============================================================
   LUMORA AI — Design System
   Premium dark SaaS aesthetic. Champagne + ink + electric coral.
   ============================================================ */

/* ---- Tokens ---------------------------------------------------- */
:root {
  /* Palette */
  --ink-900: #07070b;
  --ink-800: #0c0c14;
  --ink-700: #11111c;
  --ink-600: #1a1a26;
  --ink-500: #232333;
  --line:    rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  --cream-50:  #fafaf6;
  --cream-200: #ece7da;
  --cream-400: #c8bfa8;

  --champagne: #e8d5b0;
  --champagne-soft: rgba(232, 213, 176, 0.12);

  --coral:      #ff5e3a;
  --coral-soft: rgba(255, 94, 58, 0.18);
  --teal:       #6ad7c6;

  --text:       #efece4;
  --text-dim:   #a09b8d;
  --text-mute:  #6f6b60;

  /* Glass surfaces */
  --glass:      rgba(255, 255, 255, 0.04);
  --glass-2:    rgba(255, 255, 255, 0.06);
  --glass-3:    rgba(255, 255, 255, 0.09);
  --glass-blur: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,0.6), 0 12px 30px -12px rgba(0,0,0,0.4);
  --glow-coral: 0 0 0 1px rgba(255,94,58,0.35), 0 12px 40px -8px rgba(255,94,58,0.45);
  --glow-cream: 0 0 0 1px rgba(232,213,176,0.25), 0 14px 42px -10px rgba(232,213,176,0.35);

  /* Geometry */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;

  /* Type */
  --font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --font-body:    "Geist", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Menlo, monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light mode override (toggleable on <html data-theme="light">) */
html[data-theme="light"] {
  --ink-900: #f6f4ec;
  --ink-800: #ecead8;
  --ink-700: #e2dfcb;
  --ink-600: #d6d2bb;
  --line:    rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text:       #1c1b18;
  --text-dim:   #4f4c44;
  --text-mute:  #7a766b;
  --glass:      rgba(255, 255, 255, 0.55);
  --glass-2:    rgba(255, 255, 255, 0.7);
  --glass-3:    rgba(255, 255, 255, 0.85);
}

/* ---- Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--champagne); color: var(--ink-900); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); background-clip: padding-box; }

/* ---- Atmosphere (the signature look) -------------------------- */
.atmosphere {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.atmosphere::before,
.atmosphere::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.55;
  animation: drift 22s ease-in-out infinite alternate;
}
.atmosphere::before {
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(232,213,176,0.45), transparent 70%);
  top: -180px; left: -160px;
}
.atmosphere::after {
  width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(255,94,58,0.35), transparent 70%);
  bottom: -200px; right: -120px;
  animation-delay: -8s;
}
.atmosphere .grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.06;
  mix-blend-mode: overlay;
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0)        scale(1); }
  50%  { transform: translate3d(60px,30px,0)  scale(1.08); }
  100% { transform: translate3d(-30px,80px,0) scale(0.95); }
}

/* ---- Typography helpers --------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* ---- Logo ----------------------------------------------------- */
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px;
  position: relative; display: inline-block;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { color: var(--text); }
.brand-name em {
  font-style: normal;
  background: linear-gradient(120deg, var(--champagne), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Buttons -------------------------------------------------- */
.btn {
  --bg: var(--glass-2);
  --fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.005em;
  transition: transform 220ms var(--ease-spring),
              background 200ms var(--ease-out),
              box-shadow 220ms var(--ease-out),
              border-color 200ms var(--ease-out);
  position: relative;
  overflow: hidden;
}
.btn:hover  { transform: translateY(-1px); background: var(--glass-3); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --bg: linear-gradient(180deg, #ffe7c8 0%, var(--champagne) 100%);
  --fg: #1a160e;
  border-color: rgba(232,213,176,0.7);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--glow-cream); }

.btn-coral {
  --bg: linear-gradient(180deg, #ff7a59, #e94d2b);
  --fg: #fff;
  border-color: rgba(255,94,58,0.6);
}
.btn-coral:hover { box-shadow: var(--glow-coral); }

.btn-ghost {
  --bg: transparent;
  border-color: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); background: var(--glass); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* Subtle shimmer pass on primary buttons */
.btn-primary::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 700ms var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(100%); }

/* ---- Inputs --------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.input, .textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--text);
  outline: none;
  transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.input:focus, .textarea:focus {
  border-color: var(--champagne);
  background: var(--glass-2);
  box-shadow: 0 0 0 4px rgba(232,213,176,0.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.field-error {
  color: var(--coral);
  font-size: 12px;
  min-height: 14px;
}

/* ---- Card / glass panel --------------------------------------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow-md);
}

/* ---- Utility -------------------------------------------------- */
.flex      { display: flex; }
.row       { display: flex; align-items: center; }
.col       { display: flex; flex-direction: column; }
.gap-2     { gap: 8px; }
.gap-3     { gap: 12px; }
.gap-4     { gap: 16px; }
.gap-6     { gap: 24px; }
.center    { display: flex; align-items: center; justify-content: center; }
.spacer    { flex: 1; }
.muted     { color: var(--text-dim); }
.hidden    { display: none !important; }

/* ---- Reveal animation (used on auth + landing) ---------------- */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal 720ms var(--ease-out) forwards; }
.reveal-1 { animation-delay: 80ms; }
.reveal-2 { animation-delay: 180ms; }
.reveal-3 { animation-delay: 280ms; }
.reveal-4 { animation-delay: 380ms; }
.reveal-5 { animation-delay: 480ms; }
.reveal-6 { animation-delay: 580ms; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* ---- Toasts --------------------------------------------------- */
.toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  min-width: 240px; max-width: 360px;
  padding: 12px 14px;
  background: var(--glass-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  animation: toast-in 320ms var(--ease-spring);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px;
}
.toast.error { border-color: rgba(255,94,58,0.6); }
.toast.success { border-color: rgba(106,215,198,0.5); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ---- Responsive helpers --------------------------------------- */
@media (max-width: 720px) {
  body { font-size: 14.5px; }
}

/* Test mode banner */
.test-banner {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255, 94, 58, 0.12);
  border: 1px solid rgba(255, 94, 58, 0.4);
  color: #ff8a70;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  border-radius: 999px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: auto;
  user-select: none;
}
.test-banner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5e3a;
  box-shadow: 0 0 10px rgba(255, 94, 58, 0.8);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}
