/**
 * JUQOR — Design Tokens v2
 * Paleta refinada inspirada em Telegram Premium + WhatsApp Web
 */

:root, [data-theme="dark"] {
  /* ── Backgrounds (mais suaves, menos azul-saturado) ── */
  --bg0: #0b0f17;      /* fundo base */
  --bg1: #111827;      /* sidebar */
  --bg2: #1a2234;      /* hover/card */
  --bg3: #212c40;      /* input/surface */
  --card: #151d2d;
  --card-hover: #1a2234;
  --surface: #212c40;

  /* ── Chat area — tom levemente diferente pra criar profundidade ── */
  --chat-bg: #0e1420;
  --chat-pattern: rgba(255,255,255,.015);

  /* ── Borders ── */
  --b1: #1f2a40;
  --b2: #2a3755;
  --b3: #3a4a6b;

  /* ── Accent (verde JUQOR) ── */
  --a:  #06d6a0;
  --a2: rgba(6,214,160,.25);
  --a3: rgba(6,214,160,.10);
  --a4: rgba(6,214,160,.04);
  --a-hover: #05c294;

  /* ── Status ── */
  --green: #10b981;
  --green-d: rgba(16,185,129,.18);
  --red: #ef4444;
  --red-d: rgba(239,68,68,.18);
  --blue: #3b82f6;
  --blue-d: rgba(59,130,246,.18);
  --orange: #f59e0b;
  --orange-d: rgba(245,158,11,.18);
  --purple: #8b5cf6;
  --purple-d: rgba(139,92,246,.18);
  --gold: #f4c542;
  --gold2: rgba(244,197,66,.20);

  /* ── Crypto ── */
  --sol: #9945FF;
  --sol-d: rgba(153,69,255,.18);
  --usdt: #26a17b;
  --usdt-d: rgba(38,161,123,.18);
  --usdc: #2775ca;
  --usdc-d: rgba(39,117,202,.18);

  /* ── Text hierarchy ── */
  --t0: #f1f5f9;
  --t1: #d1d9e6;
  --t2: #8b95a8;
  --t3: #5d6a84;
  --t4: #3d4a60;

  /* ── Fonts ── */
  --fh: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --fm: 'Inter', sans-serif;

  /* ── Radius ── */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 999px;

  /* ── Shadows ── */
  --shadow-glow: 0 0 24px var(--a3);
  --shadow-card: 0 4px 24px rgba(0,0,0,.35);
  --shadow-btn: 0 4px 16px var(--a2);
  --shadow-lift: 0 8px 32px rgba(0,0,0,.45);

  /* ── Transitions ── */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);

  /* ── Msg bubbles ── */
  --msg-mine-bg: linear-gradient(135deg, #06d6a0, #04b890);
  --msg-mine-text: #0a0f18;
  --msg-other-bg: var(--card);
  --msg-other-border: var(--b1);
  --msg-other-text: var(--t0);

  /* ── Sidebar width (desktop) ── */
  --sidebar-w: 340px;
}

/* ══════════════════════════════════════
   TEMA CLARO — tom papel/WhatsApp Web
   ══════════════════════════════════════ */
[data-theme="light"] {
  --bg0: #f7f9fc;
  --bg1: #ffffff;
  --bg2: #eef2f7;
  --bg3: #dde4ed;
  --card: #ffffff;
  --card-hover: #f3f6fa;
  --surface: #eef2f7;

  --chat-bg: #efeae2;
  --chat-pattern: rgba(0,0,0,.015);

  --b1: #e4e9f0;
  --b2: #d0d8e2;
  --b3: #97a3b4;

  --a:  #06a77d;
  --a2: rgba(6,167,125,.20);
  --a3: rgba(6,167,125,.08);
  --a4: rgba(6,167,125,.03);
  --a-hover: #058d6a;

  --green: #059669;
  --green-d: rgba(5,150,105,.12);
  --red: #dc2626;
  --red-d: rgba(220,38,38,.10);
  --blue: #2563eb;
  --blue-d: rgba(37,99,235,.10);
  --orange: #d97706;
  --orange-d: rgba(217,119,6,.10);
  --purple: #7c3aed;
  --purple-d: rgba(124,58,237,.10);

  --t0: #0f172a;
  --t1: #334155;
  --t2: #64748b;
  --t3: #94a3b8;
  --t4: #cbd5e1;

  --shadow-glow: 0 0 24px rgba(6,167,125,.08);
  --shadow-card: 0 4px 20px rgba(0,0,0,.06);
  --shadow-btn: 0 4px 14px rgba(6,167,125,.18);
  --shadow-lift: 0 8px 28px rgba(0,0,0,.10);

  --msg-mine-bg: linear-gradient(135deg, #06a77d, #05876a);
  --msg-mine-text: #ffffff;
  --msg-other-bg: #ffffff;
  --msg-other-border: #e4e9f0;
  --msg-other-text: #0f172a;
}

/* Theme toggle button */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--b3);
  background: var(--surface);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   LIGHT MODE — FIXES ESPECÍFICOS v2.0.1
   Elementos com cores hardcoded que não leem as vars
   ══════════════════════════════════════ */

[data-theme="light"] body {
  background: var(--bg0);
  color: var(--t1);
}

/* Sidebar e contact items no light */
[data-theme="light"] #sidebar {
  background: var(--bg1);
  border-right: 1px solid var(--b1);
}

[data-theme="light"] .sidebar-header,
[data-theme="light"] .sidebar-profile {
  background: var(--bg1);
  border-bottom: 1px solid var(--b1);
}

[data-theme="light"] .contact-item {
  color: var(--t1);
}
[data-theme="light"] .contact-item:hover {
  background: var(--bg2);
}
[data-theme="light"] .contact-item.active {
  background: rgba(6,167,125,.10);
}
[data-theme="light"] .contact-name,
[data-theme="light"] .sidebar-profile-name {
  color: var(--t0);
}
[data-theme="light"] .contact-last {
  color: var(--t2);
}

/* Avatares no light mode - mais saturados pra contraste */
[data-theme="light"] .sidebar-avatar,
[data-theme="light"] .contact-avatar.dm,
[data-theme="light"] .chat-header-avatar.dm {
  background: linear-gradient(135deg, rgba(6,167,125,.15), rgba(37,99,235,.15));
  border: 1px solid rgba(6,167,125,.25);
  color: #047857;
}
[data-theme="light"] .contact-avatar.grp,
[data-theme="light"] .chat-header-avatar.grp {
  background: linear-gradient(135deg, rgba(124,58,237,.15), rgba(37,99,235,.15));
  border: 1px solid rgba(124,58,237,.25);
  color: #6d28d9;
}

/* Online dot no light - border precisa ser clara */
[data-theme="light"] .online-dot {
  border: 2.5px solid var(--bg1);
}

/* Chat no light */
[data-theme="light"] .chat-view {
  background: var(--chat-bg);
}
[data-theme="light"] .chat-header {
  background: var(--bg1);
  border-bottom: 1px solid var(--b1);
}
[data-theme="light"] .chat-header-name {
  color: var(--t0);
}
[data-theme="light"] .msg:not(.mine):not(.system) .msg-bubble {
  background: #ffffff;
  border: 1px solid var(--b1);
  color: var(--t0);
}
[data-theme="light"] .msg.mine .msg-bubble {
  background: var(--msg-mine-bg);
  color: var(--msg-mine-text);
}
[data-theme="light"] .msg.system .msg-bubble {
  background: var(--bg2);
  border: 1px solid var(--b1);
}
[data-theme="light"] .messages-date-separator {
  background: var(--bg1);
  border: 1px solid var(--b1);
  color: var(--t2);
}
[data-theme="light"] .msg-reaction {
  background: #ffffff;
  border: 1px solid var(--b1);
}

/* Input bar no light */
[data-theme="light"] .chat-input-bar {
  background: var(--bg1);
  border-top: 1px solid var(--b1);
}
[data-theme="light"] .msg-input-wrap {
  background: var(--bg2);
  border: 1px solid var(--b1);
}
[data-theme="light"] .msg-input-wrap:focus-within {
  background: #ffffff;
  border-color: var(--a);
}
[data-theme="light"] #msg-input {
  color: var(--t0);
}
[data-theme="light"] #msg-input::placeholder {
  color: var(--t3);
}
[data-theme="light"] .btn-round:hover {
  background: var(--bg2);
}

/* Badges no light */
[data-theme="light"] .badge-green { background: rgba(5,150,105,.12); color: #047857; }
[data-theme="light"] .badge-sol   { background: rgba(124,58,237,.12); color: #7c3aed; }
[data-theme="light"] .badge-gold  { background: rgba(234,179,8,.15); color: #a16207; }
[data-theme="light"] .badge-red   { background: rgba(220,38,38,.10); color: #b91c1c; }
[data-theme="light"] .badge-orange { background: rgba(217,119,6,.12); color: #c2410c; }
[data-theme="light"] .badge-purple { background: rgba(124,58,237,.12); color: #6d28d9; }

/* Empty state chat view no light */
[data-theme="light"] .chat-empty {
  background: var(--chat-bg);
}
[data-theme="light"] .chat-empty-icon {
  background: var(--bg1);
  border: 1px solid var(--b1);
  color: var(--t3);
}
[data-theme="light"] .chat-empty-title {
  color: var(--t0);
}

/* Modal no light */
[data-theme="light"] .modal {
  background: var(--card);
  border: 1px solid var(--b1);
}
[data-theme="light"] .modal-title { color: var(--t0); }
[data-theme="light"] .input {
  background: var(--bg2);
  border: 1px solid var(--b1);
  color: var(--t0);
}
[data-theme="light"] .input:focus {
  background: #ffffff;
}
[data-theme="light"] .input-search {
  background: var(--bg2);
  color: var(--t0);
}
[data-theme="light"] .input-search:focus {
  background: #ffffff;
  border-color: var(--a);
}

/* Botões no light */
[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border: 1px solid var(--b1);
  color: var(--t1);
}
[data-theme="light"] .btn-secondary:hover {
  background: var(--bg2);
  border-color: var(--b3);
}
[data-theme="light"] .btn-icon {
  color: var(--t2);
}
[data-theme="light"] .btn-icon:hover {
  background: var(--bg2);
  color: var(--t0);
}

/* Back btn no light */
[data-theme="light"] .back-btn {
  background: #ffffff;
  border: 1px solid var(--b1);
  color: var(--t1);
}
[data-theme="light"] .back-btn:hover {
  background: var(--bg2);
  border-color: var(--b3);
}

/* Logo no light - mantém verde do accent */
[data-theme="light"] .sidebar-logo:hover {
  background: var(--bg2);
}
[data-theme="light"] .sidebar-logo-text {
  color: var(--t0);
}

/* Landing no light */
[data-theme="light"] #landing {
  background: var(--bg0);
}
[data-theme="light"] .l-title {
  color: var(--t0);
}
[data-theme="light"] .l-feat {
  background: var(--card);
  border: 1px solid var(--b1);
}
[data-theme="light"] .l-feat-text {
  color: var(--t1);
}

/* E2E banner no light */
[data-theme="light"] .e2e-banner {
  background: rgba(6,167,125,.05);
  border-bottom: 1px solid var(--b1);
}

/* Scrollbar no light */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: var(--b2);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: var(--b3);
}

/* ══════════════════════════════════════
   v2.0.2 — FIXES ADICIONAIS DE LIGHT MODE
   Telas: landing, loading, payment, setup, disclaimer
   ══════════════════════════════════════ */

/* DISCLAIMER */
[data-theme="light"] .disc-overlay {
  background: rgba(0,0,0,.45);
}
[data-theme="light"] .disc-box {
  background: #ffffff;
  border: 1px solid var(--b1);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
[data-theme="light"] .disc-title { color: var(--t0); }
[data-theme="light"] .disc-sub   { color: var(--t3); }
[data-theme="light"] .disc-text  { color: var(--t1); }
[data-theme="light"] .disc-text strong { color: var(--t0); }
[data-theme="light"] .disc-check span  { color: var(--t1); }
[data-theme="light"] .disc-cb {
  border: 2px solid var(--b2);
  background: #ffffff;
}

/* LANDING */
[data-theme="light"] .l-tag  { color: var(--t3); }
[data-theme="light"] .l-desc { color: var(--t1); }
[data-theme="light"] .l-bg::before {
  background: radial-gradient(circle, rgba(6,167,125,.05), transparent 70%);
}
[data-theme="light"] .l-bg::after {
  background: radial-gradient(circle, rgba(124,58,237,.04), transparent 70%);
}
[data-theme="light"] .l-feat-icon.c1 { background: rgba(6,167,125,.10); }
[data-theme="light"] .l-feat-icon.c2 { background: rgba(37,99,235,.10); }
[data-theme="light"] .l-feat-icon.c3 { background: rgba(5,150,105,.10); }
[data-theme="light"] .l-feat-icon.c4 { background: rgba(124,58,237,.10); }
[data-theme="light"] .l-coin.sol  { background: rgba(124,58,237,.12); color: #6d28d9; }
[data-theme="light"] .l-coin.usdt { background: rgba(5,150,105,.12); color: #047857; }
[data-theme="light"] .l-coin.usdc { background: rgba(37,99,235,.12); color: #1d4ed8; }
[data-theme="light"] .l-wallets { color: var(--t2); }
[data-theme="light"] .l-trust-item { color: var(--t2); }
[data-theme="light"] .l-trust { border-top: 1px solid var(--b1); }
[data-theme="light"] .l-dev {
  color: var(--orange);
  border: 1px solid var(--b2);
}
[data-theme="light"] .l-dev:hover {
  border-color: var(--orange);
  background: var(--orange-d);
}

/* LOADING SPINNER */
[data-theme="light"] .spinner {
  border: 2.5px solid var(--bg3);
  border-top-color: var(--a);
}
[data-theme="light"] .step-dot { background: var(--b2); }
[data-theme="light"] .step-dot.active { background: var(--a); }

/* PAYMENT */
[data-theme="light"] #payment { background: var(--bg0); }
[data-theme="light"] .crypto-tab {
  background: #ffffff;
  border: 1px solid var(--b1);
}
[data-theme="light"] .crypto-tab:hover { border-color: var(--b3); background: var(--bg2); }
[data-theme="light"] .crypto-tab.active {
  border-color: var(--a);
  background: rgba(6,167,125,.06);
  box-shadow: inset 0 0 0 1px rgba(6,167,125,.12);
}
[data-theme="light"] .crypto-name { color: var(--t0); }
[data-theme="light"] .crypto-net  { color: var(--t3); }
[data-theme="light"] .wallet-display {
  background: #ffffff;
  border: 1px solid var(--b1);
}
[data-theme="light"] .wallet-display .addr { color: var(--t1); }
[data-theme="light"] .wallet-display .net  { color: var(--t3); }
[data-theme="light"] .copy-btn {
  background: #ffffff;
  border: 1px solid var(--b2);
  color: var(--a);
}
[data-theme="light"] .copy-btn:hover {
  border-color: var(--a);
  background: rgba(6,167,125,.04);
}

/* BTN PRIMARY no light (garantia: fundo verde, texto branco) */
[data-theme="light"] .btn-primary,
[data-theme="light"] .l-cta {
  background: linear-gradient(135deg, #06a77d, #058d6a) !important;
  color: #ffffff !important;
  border: none !important;
}
[data-theme="light"] .btn-primary:hover,
[data-theme="light"] .l-cta:hover {
  background: linear-gradient(135deg, #058d6a, #047857) !important;
}

/* SETUP */
[data-theme="light"] #setup { background: var(--bg0); }

/* Price info tag (v2.0.2 novo) */
.price-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--t3);
  margin-top: 4px;
}
.price-live strong {
  color: var(--a);
  font-weight: 700;
  font-family: var(--fm);
}
.price-live .price-pulse {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pricePulse 2s ease-in-out infinite;
}
@keyframes pricePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* SELETOR DE IDIOMA no disclaimer */
.lang-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--b1);
}
.lang-btn {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--b1);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--t2);
  font-family: var(--fh);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lang-btn:hover {
  border-color: var(--b3);
  color: var(--t0);
}
.lang-btn.active {
  border-color: var(--a);
  background: var(--a4);
  color: var(--a);
}
[data-theme="light"] .lang-btn {
  background: #ffffff;
  border: 1px solid var(--b1);
}
[data-theme="light"] .lang-btn.active {
  background: rgba(6,167,125,.06);
  border-color: var(--a);
  color: var(--a);
}
.lang-flag {
  font-size: 14px;
  line-height: 1;
}

/* Label do seletor */
.lang-label {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  text-align: center;
  margin-top: 14px;
  margin-bottom: 8px;
}
