/* ========================================
   DESIGN TOKENS - ESTILO QUE CUIDA
   Design System Global v2.0
   ======================================== */

/* ===================================
   FUNDAÇÃO: CORES NEUTRAS GLOBAIS
   Usadas em TODOS os produtos
   =================================== */

:root {
    /* ===== BACKGROUNDS ===== */
    --color-bg-default: #ffffff;
    --color-bg-soft: #fafbfc;
    --color-bg-subtle: #f5f7f9;
    --color-bg-muted: #eef1f4;
    
    /* ===== SUPERFÍCIES ===== */
    --color-surface-default: #ffffff;
    --color-surface-raised: #ffffff;
    --color-surface-overlay: rgba(255, 255, 255, 0.95);
    
    /* ===== TEXTO ===== */
    --color-text-primary: #1a202c;
    --color-text-secondary: #4a5568;
    --color-text-tertiary: #718096;
    --color-text-disabled: #a0aec0;
    --color-text-inverse: #ffffff;
    
    /* ===== BORDAS ===== */
    --color-border-default: #e2e8f0;
    --color-border-strong: #cbd5e0;
    --color-border-subtle: #f7fafc;
    
    /* ===== ESTADOS SEMÂNTICOS ===== */
    --color-success: #38a169;
    --color-success-soft: #c6f6d5;
    --color-warning: #d69e2e;
    --color-warning-soft: #feebc8;
    --color-error: #e53e3e;
    --color-error-soft: #fed7d7;
    --color-info: #3182ce;
    --color-info-soft: #bee3f8;
    
    /* ===== ACCENT (definido por pilar) ===== */
    /* Cada produto redefine apenas estas 3 variáveis */
    --color-accent: #606c38;
    --color-accent-soft: #e8eddb;
    --color-accent-strong: #4a5428;
}

/* ===================================
   TIPOGRAFIA GLOBAL
   Escala única para todos os produtos
   =================================== */

:root {
    /* ===== FAMÍLIAS ===== */
    --font-display: "Playfair Display", serif;
    --font-body: "Inter", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
    
    /* ===== TAMANHOS (Mobile-First) ===== */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px - H1 mobile */
    --text-5xl: 3rem;        /* 48px - H1 desktop */
    --text-6xl: 3.75rem;     /* 60px */
    
    /* ===== PESOS ===== */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* ===== LINE HEIGHTS ===== */
    --leading-none: 1;
    --leading-tight: 1.2;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;
    --leading-loose: 1.8;
    
    /* ===== LETTER SPACING ===== */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
}

/* ===================================
   ESPAÇAMENTOS GLOBAIS
   Escala 4px base
   =================================== */

:root {
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */
}

/* ===================================
   BORDER RADIUS GLOBAL
   =================================== */

:root {
    --radius-none: 0;
    --radius-sm: 0.375rem;    /* 6px */
    --radius-md: 0.5rem;      /* 8px */
    --radius-lg: 0.75rem;     /* 12px */
    --radius-xl: 1rem;        /* 16px */
    --radius-2xl: 1.5rem;     /* 24px */
    --radius-3xl: 2rem;       /* 32px */
    --radius-full: 9999px;    /* Circular */
}

/* ===================================
   SOMBRAS E ELEVAÇÃO
   =================================== */

:root {
    /* ===== SOMBRAS ===== */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    /* ===== SOMBRAS COLORIDAS (accent) ===== */
    --shadow-accent-sm: 0 4px 12px rgba(var(--accent-rgb), 0.15);
    --shadow-accent-md: 0 8px 24px rgba(var(--accent-rgb), 0.2);
    --shadow-accent-lg: 0 12px 32px rgba(var(--accent-rgb), 0.25);
}

/* ===================================
   TRANSIÇÕES E ANIMAÇÕES
   =================================== */

:root {
    /* ===== DURAÇÕES ===== */
    --duration-instant: 100ms;
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 350ms;
    --duration-slower: 500ms;
    
    /* ===== EASINGS ===== */
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* ===== TRANSIÇÕES PRONTAS ===== */
    --transition-fast: all var(--duration-fast) var(--ease-out);
    --transition-base: all var(--duration-base) var(--ease-out);
    --transition-slow: all var(--duration-slow) var(--ease-out);
    --transition-colors: color var(--duration-base) var(--ease-out),
                         background-color var(--duration-base) var(--ease-out),
                         border-color var(--duration-base) var(--ease-out);
}

/* ===================================
   BREAKPOINTS (referência)
   Não são variáveis CSS, mas documentados aqui
   =================================== */

/*
    --breakpoint-sm: 640px
    --breakpoint-md: 768px
    --breakpoint-lg: 1024px
    --breakpoint-xl: 1280px
    --breakpoint-2xl: 1536px
*/

/* ===================================
   Z-INDEX SCALE
   =================================== */

:root {
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-modal-backdrop: 1300;
    --z-modal: 1400;
    --z-popover: 1500;
    --z-tooltip: 1600;
}

/* ===================================
   COMPONENTES: TAMANHOS PADRÃO
   =================================== */

:root {
    /* ===== TOUCH TARGETS ===== */
    --touch-target-min: 44px;
    
    /* ===== INPUTS ===== */
    --input-height-sm: 36px;
    --input-height-md: 44px;
    --input-height-lg: 52px;
    
    /* ===== BUTTONS ===== */
    --button-height-sm: 36px;
    --button-height-md: 44px;
    --button-height-lg: 52px;
    
    /* ===== CONTAINERS ===== */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
}

/* ===================================
   UTILITÁRIOS: OPACIDADE
   =================================== */

:root {
    --opacity-0: 0;
    --opacity-5: 0.05;
    --opacity-10: 0.1;
    --opacity-20: 0.2;
    --opacity-30: 0.3;
    --opacity-40: 0.4;
    --opacity-50: 0.5;
    --opacity-60: 0.6;
    --opacity-70: 0.7;
    --opacity-80: 0.8;
    --opacity-90: 0.9;
    --opacity-100: 1;
}

/* ===================================
   DARK MODE (preparado para futuro)
   =================================== */

@media (prefers-color-scheme: dark) {
    :root {
        /* Desabilitado por enquanto */
        /* Descomentar quando implementar dark mode */
        /*
        --color-bg-default: #1a202c;
        --color-bg-soft: #2d3748;
        --color-text-primary: #f7fafc;
        --color-text-secondary: #e2e8f0;
        */
    }
}

/* ===================================
   ACESSIBILIDADE
   =================================== */

:root {
    /* ===== FOCUS RING ===== */
    --focus-ring-width: 3px;
    --focus-ring-offset: 2px;
    --focus-ring-color: var(--color-accent);
    --focus-ring: 0 0 0 var(--focus-ring-offset) var(--color-bg-default),
                  0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
}

/* ===================================
   MOTION PREFERENCES
   =================================== */

@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-instant: 0ms;
        --duration-fast: 0ms;
        --duration-base: 0ms;
        --duration-slow: 0ms;
        --duration-slower: 0ms;
    }
}
