/* ─────────────────────────────────────────────────────────────────────────────
   EwHook Cloud — Design System Tokens
   Neutral "ink" chrome + emerald "signal" accent. Light + dark.
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* neutrals (light) */
  --bg: #f3f4f7;
  --bg-2: #eceef3;
  --surface: #ffffff;
  --surface-2: #f4f5f9;
  --surface-3: #eaecf3;
  --inset: #f7f8fb;
  --border: #e7e9f1;
  --border-strong: #d7dbe6;
  --hairline: #edeef4;
  --text: #0a0d15;
  --text-2: #2a3140;
  --muted: #5b6473;
  --muted-2: #8a93a4;
  --muted-3: #abb2c1;

  /* signal — emerald */
  --signal: #10b981;
  --signal-2: #059669;
  --signal-ink: #057a55;
  --signal-soft: #e6f8f0;
  --signal-border: #b4e8d1;
  --signal-grad: linear-gradient(180deg, #16c98c 0%, #0ea372 100%);
  --signal-glow: 0 1px 2px rgba(5,80,55,.18), 0 10px 24px -8px rgba(16,185,129,.5);

  /* semantic */
  --ok: #0c9b6e; --ok-soft: #e6f8f0; --ok-ink: #067150; --ok-border: #b4e8d1;
  --warn: #c2740a; --warn-soft: #fbf0db; --warn-ink: #8a5206; --warn-border: #f3d9a6;
  --danger: #e5484d; --danger-soft: #fde8e8; --danger-ink: #b42a2f; --danger-border: #f5c2c4;
  --info: #3b82f6;

  /* channel brand */
  --waba: #1faa53; --waba-soft: #e3f6e9; --waba-ink: #0f7a38;
  --messenger: #0084ff; --messenger-soft: #e1eeff; --messenger-ink: #0067cc;
  --instagram: #e1306c; --instagram-soft: #fde6ef; --instagram-ink: #b81e54;
  --ig-grad: linear-gradient(45deg, #f09433, #dc2743 48%, #bc1888);

  /* radii */
  --r-xl: 20px; --r-lg: 15px; --r: 12px; --r-sm: 9px; --r-xs: 7px; --pill: 999px;

  /* elevation */
  --sh-sm: 0 1px 2px rgba(12,17,32,.06);
  --sh: 0 4px 16px -6px rgba(12,17,32,.12), 0 1px 2px rgba(12,17,32,.05);
  --sh-md: 0 14px 34px -10px rgba(12,17,32,.18);
  --sh-lg: 0 30px 70px -18px rgba(12,17,32,.32);
  --top-hi: inset 0 1px 0 rgba(255,255,255,.7);
  --ring: rgba(16,185,129,.42);

  /* chrome */
  --side-w: 252px;
  --maxw: 1200px;
  --grid-line: rgba(12,17,32,.04);
  --glow-1: rgba(16,185,129,.12);
  --glow-2: rgba(59,130,246,.05);
  --scrim: rgba(12,17,32,.42);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  --spring: cubic-bezier(.34,1.4,.5,1);
}

:root[data-theme="dark"] {
  --bg: #07090f;
  --bg-2: #0a0d14;
  --surface: #11141d;
  --surface-2: #0d101a;
  --surface-3: #191e29;
  --inset: #0b0e16;
  --border: #1f232f;
  --border-strong: #2a3040;
  --hairline: #191d27;
  --text: #e9eef7;
  --text-2: #c0c9d8;
  --muted: #96a0b1;
  --muted-2: #6a7588;
  --muted-3: #4a5365;

  --signal: #18cf94;
  --signal-2: #0fb37f;
  --signal-ink: #5fe6bd;
  --signal-soft: #0f2a23;
  --signal-border: #1d4a3c;
  --signal-grad: linear-gradient(180deg, #1ad497 0%, #0fb07c 100%);
  --signal-glow: 0 0 0 1px rgba(24,207,148,.18), 0 12px 30px -8px rgba(16,185,129,.45);

  --ok: #18cf94; --ok-soft: #0f2a23; --ok-ink: #5fe6bd; --ok-border: #1d4a3c;
  --warn: #e0962f; --warn-soft: #2b2110; --warn-ink: #f4c074; --warn-border: #4a3a18;
  --danger: #f0676b; --danger-soft: #2c1517; --danger-ink: #f7a5a7; --danger-border: #4d2528;

  --waba-soft: #0f2a1a; --waba-ink: #58d98a;
  --messenger-soft: #0e1f33; --messenger-ink: #6cb6ff;
  --instagram-soft: #2c1320; --instagram-ink: #f48cb6;

  --sh-sm: 0 1px 2px rgba(0,0,0,.5);
  --sh: 0 6px 22px -8px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.5);
  --sh-md: 0 16px 40px -12px rgba(0,0,0,.7);
  --sh-lg: 0 34px 80px -20px rgba(0,0,0,.8);
  --top-hi: inset 0 1px 0 rgba(255,255,255,.04);

  --grid-line: rgba(255,255,255,.028);
  --glow-1: rgba(16,185,129,.16);
  --glow-2: rgba(59,130,246,.07);
  --scrim: rgba(2,4,8,.62);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { overflow-x: hidden; }

/* ── Global body ──────────────────────────────────────────────────────────── */
body {
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05" 1, "ss01" 1;
  overflow-x: hidden;
  background: var(--bg);
  background-image:
    radial-gradient(900px 520px at 100% -8%, var(--glow-1), transparent 60%),
    radial-gradient(820px 560px at -8% 108%, var(--glow-2), transparent 58%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}

/* ── Base elements ────────────────────────────────────────────────────────── */
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { color: var(--signal-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 8px;
}
.hidden { display: none !important; }
::selection { background: rgba(16,185,129,.26); }

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

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── Bootstrap loading ────────────────────────────────────────────────────── */
.app-boot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--bg);
}

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem 1rem;
  background: var(--bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 1.4rem;
  border-bottom: 1px solid var(--hairline);
}

.login-brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
}

.login-body {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 1.6rem 1.75rem 2rem;
}

.login-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: .2rem;
}

.login-field { display: flex; flex-direction: column; gap: .4rem; }

.login-input {
  width: 100%;
  padding: .65rem .8rem;
  background: var(--inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: .93rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.login-input:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(16,185,129,.18);
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: .68rem 1rem;
  font-size: .93rem;
  border-radius: var(--r-sm);
  margin-top: .2rem;
}

.login-err {
  padding: .55rem .75rem;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--r-xs);
  color: var(--danger-ink);
  font-size: .83rem;
  font-weight: 500;
}
