/**
 * ============================================================================
 * DESIGN TOKENS OFICIAIS — FAMÍLIA SIGILO / CRYPTOVAULT / VAULTDROP
 * ============================================================================
 * Extraído diretamente do código-fonte de produção do Sigilo (Tailwind v3.4.17 +
 * app/globals.css + componentes React).
 *
 * Independente de framework: basta importar este arquivo no CSS principal:
 *   @import "./design-tokens.css";
 *
 * Controle de tema:
 * - Tema escuro (padrão): <html class="dark"> ou :root sem classe .light
 * - Tema claro:           <html class="light"> ou html:not(.dark)
 * ============================================================================
 */

/* ==========================================================================
   1. VARIÁVEIS DE TEMA — ESCURO (PADRÃO)
   ========================================================================== */
:root,
html.dark,
[data-theme="dark"] {
  color-scheme: dark;

  /* --- Tokens Primitivos Oficiais (app/globals.css) --- */
  --bg: #0E0F13;
  --bg-bootstrap: #0A0D14; /* aplicado no <head> antes da hidratação no modo escuro */
  --surface: #16181E;
  --surface-2: #1D2027;
  --border: #2A2E37;
  --text: #E7E9EE;
  --text-muted: #9097A3;
  --accent: #3DDC97;
  --accent-rgb: 61, 220, 151;
  --accent-soft: rgba(61, 220, 151, 0.12);
  --warning: #F5B84B;
  --warning-rgb: 245, 184, 75;
  --danger: #F25F5C;
  --danger-rgb: 242, 95, 92;

  /* --- Variações de Destaque (Accent / Verde) --- */
  --accent-10: rgba(61, 220, 151, 0.10); /* bg-accent/10 */
  --accent-20: rgba(61, 220, 151, 0.20); /* border-accent/20, hover:bg-accent/20 */
  --accent-25: rgba(61, 220, 151, 0.25); /* border-accent/25, active:bg-accent/25 */
  --accent-30: rgba(61, 220, 151, 0.30); /* bg-accent/30 (highlight <mark>), border-accent/30 */
  --accent-35: rgba(61, 220, 151, 0.35); /* .vault-card-glow border */
  --accent-40: rgba(61, 220, 151, 0.40); /* border-accent/40 (card selecionado) */
  --accent-50: rgba(61, 220, 151, 0.50); /* hover:border-accent/50 */

  /* --- Estados de Superfície, Bordas e Texto --- */
  --bg-footer-sidebar: rgba(14, 15, 19, 0.50);    /* bg-background/50 */
  --bg-lock-overlay: rgba(14, 15, 19, 0.95);      /* bg-background/95 */
  --surface-2-hover-50: rgba(29, 32, 39, 0.50);   /* hover:bg-surface-2/50 */
  --surface-2-hover-60: rgba(29, 32, 39, 0.60);   /* hover:bg-surface-2/60 */
  --border-30: rgba(42, 46, 55, 0.30);            /* border-border/30 (divisor interno do card) */
  --border-50: rgba(42, 46, 55, 0.50);            /* border-border/50 (borda de tag no card) */
  --text-muted-30: rgba(144, 151, 163, 0.30);     /* text-text-muted/30 (ícone de lista vazia) */
  --text-muted-60: rgba(144, 151, 163, 0.60);     /* placeholder-text-muted/60 e texto de build */
  --input-border: #2A2E37;
  --input-placeholder: rgba(144, 151, 163, 0.60);

  /* --- Semânticas de Perigo (Danger / Rose) --- */
  --danger-10: rgba(242, 95, 92, 0.10);           /* bg-danger/10 */
  --danger-20: rgba(242, 95, 92, 0.20);           /* hover:bg-danger/20, border-danger/20 */
  --danger-25: rgba(242, 95, 92, 0.25);           /* border-danger/25, active:bg-danger/25 */
  --rose-400: #FB7185;                            /* ícone lixeira na sidebar/card hover */
  --rose-500: #F43F5E;                            /* hover do botão bloquear, item excluir no menu */
  --rose-bg-10: rgba(244, 63, 94, 0.10);          /* bg-rose-500/10 */
  --rose-border-20: rgba(244, 63, 94, 0.20);      /* border-rose-500/20 */

  /* --- Semânticas de Aviso e Favorito (Warning / Amber) --- */
  --warning-10: rgba(245, 184, 75, 0.10);         /* bg-warning/10 */
  --warning-20: rgba(245, 184, 75, 0.20);         /* border-warning/20 */
  --warning-40: rgba(245, 184, 75, 0.40);         /* border-warning/40 */
  --amber-400: #FBBF24;                           /* estrela de favorito nos cards e sidebar */
  --amber-500: #F59E0B;                           /* item Favoritos ativo, hover tema/admin */
  --amber-500-80: rgba(245, 158, 11, 0.80);       /* contador de Favoritos */
  --amber-bg-10: rgba(245, 158, 11, 0.10);        /* bg-amber-500/10 */
  --amber-border-20: rgba(245, 158, 11, 0.20);    /* border-amber-500/20 */

  /* --- Pílula "Sincronizado" na Coluna da Lista (Emerald) --- */
  --sync-pill-text: #34D399;                      /* dark:text-emerald-400 */
  --sync-pill-bg: rgba(16, 185, 129, 0.10);       /* bg-emerald-500/10 */
  --sync-pill-border: rgba(16, 185, 129, 0.20);   /* border-emerald-500/20 */

  /* --- Cores Auxiliares de Ícones, Cofres, Pastas e Tags (Tailwind v3) --- */
  --emerald-400: #34D399;
  --emerald-500: #10B981;
  --teal-400: #2DD4BF;
  --teal-500: #14B8A6;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --purple-400: #C084FC;                          /* cadeado cofre reforçado, olho somente leitura */
  --purple-500: #A855F7;
  --purple-bg-10: rgba(168, 85, 247, 0.10);
  --purple-border-20: rgba(168, 85, 247, 0.20);
  --purple-border-30: rgba(168, 85, 247, 0.30);
  --purple-border-40: rgba(168, 85, 247, 0.40);

  /* --- Gradiente do Logo e Fundo Mesh (.vault-bg) --- */
  --logo-gradient: linear-gradient(to top right, #10B981, #2DD4BF);
  --logo-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.20), 0 4px 6px -4px rgba(16, 185, 129, 0.20);
  --vault-bg-mesh:
    radial-gradient(at 0% 0%, rgba(61, 220, 151, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(29, 32, 39, 0.60) 0px, transparent 50%);

  /* --- Sombras de Cartões e Modais --- */
  --vault-card-shadow: none;
  --vault-card-glow-shadow: 0 0 16px -4px rgba(61, 220, 151, 0.12);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -4px rgba(0, 0, 0, 0.10);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* --- Overlays de Modal --- */
  --backdrop-70: rgba(0, 0, 0, 0.70);
  --backdrop-75: rgba(0, 0, 0, 0.75);
  --backdrop-80: rgba(0, 0, 0, 0.80);
}

/* ==========================================================================
   2. VARIÁVEIS DE TEMA — CLARO
   ========================================================================== */
html:not(.dark),
html.light,
[data-theme="light"] {
  color-scheme: light;

  /* --- Tokens Primitivos Oficiais (app/globals.css) --- */
  --bg: #F8FAFC;
  --bg-bootstrap: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-muted: #475569;
  --accent: #059669;
  --accent-rgb: 5, 150, 105;
  --accent-soft: rgba(5, 150, 105, 0.12);
  --warning: #D97706;
  --warning-rgb: 217, 119, 6;
  --danger: #E11D48;
  --danger-rgb: 225, 29, 72;

  /* --- Variações de Destaque (Accent / Verde Escuro) --- */
  --accent-10: rgba(5, 150, 105, 0.10);
  --accent-20: rgba(5, 150, 105, 0.20);
  --accent-25: rgba(5, 150, 105, 0.25);
  --accent-30: rgba(5, 150, 105, 0.30);
  --accent-35: rgba(5, 150, 105, 0.35);
  --accent-40: rgba(5, 150, 105, 0.40);
  --accent-50: rgba(5, 150, 105, 0.50);

  /* --- Estados de Superfície, Bordas e Texto --- */
  --bg-footer-sidebar: rgba(248, 250, 252, 0.50);
  --bg-lock-overlay: rgba(248, 250, 252, 0.95);
  --surface-2-hover-50: rgba(241, 245, 249, 0.50);
  --surface-2-hover-60: rgba(241, 245, 249, 0.60);
  --border-30: rgba(226, 232, 240, 0.30);
  --border-50: rgba(226, 232, 240, 0.50);
  --text-muted-30: rgba(71, 85, 105, 0.30);
  --text-muted-60: rgba(71, 85, 105, 0.60);
  --input-border: #CBD5E1;
  --input-placeholder: #94A3B8;

  /* --- Semânticas de Perigo (Danger / Rose) --- */
  --danger-10: rgba(225, 29, 72, 0.10);
  --danger-20: rgba(225, 29, 72, 0.20);
  --danger-25: rgba(225, 29, 72, 0.25);

  /* --- Semânticas de Aviso (Warning) --- */
  --warning-10: rgba(217, 119, 6, 0.10);
  --warning-20: rgba(217, 119, 6, 0.20);
  --warning-40: rgba(217, 119, 6, 0.40);

  /* --- Pílula "Sincronizado" na Coluna da Lista (Emerald) --- */
  --sync-pill-text: #059669;                      /* text-emerald-600 */
  --sync-pill-bg: rgba(16, 185, 129, 0.10);
  --sync-pill-border: rgba(16, 185, 129, 0.20);

  /* --- Fundo Mesh (.vault-bg) e Sombras no Tema Claro --- */
  --vault-bg-mesh:
    radial-gradient(at 0% 0%, rgba(5, 150, 105, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(226, 232, 240, 0.60) 0px, transparent 50%);
  --vault-card-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
  --vault-card-glow-shadow: 0 0 14px -3px rgba(5, 150, 105, 0.10);
}

/* ==========================================================================
   3. TOKENS INVARIANTES (TIPOGRAFIA, DIMENSÕES, RAIOS E TRANSIÇÕES)
   ========================================================================== */
:root {
  /* --- Famílias Tipográficas --- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* --- Escala Tipográfica --- */
  --text-2xs: 0.5625rem;   /* 9px  — badge Zero-K, tags do rodapé do card */
  --text-xs-10: 0.625rem;  /* 10px — labels uppercase, contadores mono, datas, badge role */
  --text-xs-11: 0.6875rem; /* 11px — prévia do card, botões sm, selects, labels de modal */
  --text-xs: 0.75rem;      /* 12px — padrão de botões, itens de menu, título de card, inputs */
  --text-sm: 0.875rem;     /* 14px — logo "Sigilo", título da lista (sm+), títulos de modal */
  --text-editor: 0.9375rem;/* 15px — corpo de texto do editor (.ProseMirror) */
  --text-base: 1rem;       /* 16px — input de título da nota (#note-title-input) */
  --text-lg: 1.125rem;     /* 18px — título da tela de bloqueio */
  --text-h3: 1.15rem;      /* 18.4px — H3 no conteúdo (.ProseMirror h3) */
  --text-h2: 1.35rem;      /* 21.6px — H2 no conteúdo (.ProseMirror h2) */
  --text-2xl: 1.5rem;      /* 24px — título da tela de login */
  --text-h1: 1.75rem;      /* 28px — H1 no conteúdo (.ProseMirror h1) */

  /* --- Pesos Tipográficos --- */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* --- Alturas de Linha (Line-Height) --- */
  --leading-tight: 1.25;
  --leading-h1: 1.3;
  --leading-h2: 1.35;
  --leading-h3: 1.4;
  --leading-code: 1.55;
  --leading-relaxed: 1.625;
  --leading-editor: 1.65;

  /* --- Raios de Borda (Border Radius) --- */
  --radius-sm: 0.25rem;      /* 4px  — rounded (badges Zero-K, ADMIN, ⌘K, botões rápidos de card) */
  --radius-md: 0.5rem;       /* 8px  — rounded-lg (botões padrão, itens de navegação, pílulas sync, <pre>) */
  --radius-control: 0.625rem;/* 10px — rounded-control / rounded-[10px] (miolo do logo) */
  --radius-lg: 0.75rem;      /* 12px — rounded-xl (cards em lista, itens de cofre, busca, ícones rodapé) */
  --radius-card: 0.875rem;   /* 14px — rounded-card / rounded-[14px] */
  --radius-xl: 1rem;         /* 16px — rounded-2xl (cards na grade, container do editor, modais médios) */
  --radius-2xl: 1.5rem;      /* 24px — rounded-3xl (modais Novo Cofre, Nova Pasta, Renomear, Login) */
  --radius-full: 9999px;     /* rounded-full (tags na sidebar, pílula awareness, scrollbar thumb) */

  /* --- Larguras Fixas das Colunas e Alturas de Controles --- */
  --sidebar-width-desktop: 16rem;     /* 256px (w-64) */
  --sidebar-width-mobile: 18rem;      /* 288px (w-72, drawer fixo) */
  --list-col-width-lg: 26.25rem;      /* 420px (lg:w-[420px]) */
  --grid-card-min-width: 15rem;       /* 240px (minmax(240px, 1fr)) */
  --control-height-sm: 1.75rem;       /* 28px (h-7) */
  --control-height-default: 2rem;     /* 32px (h-8 — botões, toolbar, pílula Sincronizado) */
  --control-height-lg: 2.25rem;       /* 36px (h-9 — inputs de modal e botões lg) */

  /* --- Tamanhos Padrão de Ícones (lucide-react) --- */
  --icon-xs: 0.625rem;   /* 10px (w-2.5 h-2.5) */
  --icon-sm: 0.75rem;    /* 12px (w-3 h-3) */
  --icon-md: 0.875rem;   /* 14px (w-3.5 h-3.5 — padrão em botões, toolbar, cards e navegação) */
  --icon-lg: 1rem;       /* 16px (w-4 h-4 — logo, rodapé da sidebar e títulos de modal) */
  --icon-xl: 1.25rem;    /* 20px (w-5 h-5) */
  --icon-2xl: 1.5rem;    /* 24px (w-6 h-6) */

  /* --- Transição Oficial de Alta Fluidez --- */
  --transition-props: color, background-color, border-color, opacity, transform;
  --transition-duration: 120ms;
  --transition-easing: cubic-bezier(0.16, 1, 0.3, 1);
}
