/* ==========================================================================
   tokens.css — Design tokens + reset base (compartilhado: portal e admin)
   Portal Feira e Companhia
   ========================================================================== */

:root {
    /* Cores — superfícies */
    --color-bg: #FFFFFF;
    --color-surface: #F8F9FB;
    --color-surface-2: #F1F3F6;
    --color-dark: #18191A;
    --color-dark-2: #242526;

    /* Cores — texto */
    --color-text: #1F2328;
    --color-text-muted: #5F6672;
    --color-text-inverse: #FFFFFF;
    --color-text-inverse-muted: #B0B3B8;

    /* Cores — marca */
    --color-primary: #D9381E;          /* vermelho editorial */
    --color-primary-dark: #B52C15;
    --color-primary-soft: #FDECE9;
    --color-secondary: #1E7E34;        /* verde institucional / WhatsApp */
    --color-secondary-dark: #17652A;
    --color-secondary-soft: #E6F4EA;

    /* Cores — estado */
    --color-info: #1A73E8;
    --color-info-soft: #E8F0FE;
    --color-warning: #B06000;
    --color-warning-soft: #FEF3E0;
    --color-danger: #C5221F;
    --color-danger-soft: #FCE8E6;

    /* Bordas sutis */
    --color-border: #EAECEF;
    --border: 1px solid var(--color-border);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    /* Tipografia */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: 2.5rem;
    --lh-tight: 1.22;
    --lh-base: 1.65;
    --ls-tight: -0.02em;

    /* Espaçamento (escala de 4px) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* Sombras difusas modernas */
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.05);
    --shadow: 0 6px 18px -6px rgba(16, 24, 40, 0.08);
    --shadow-hover: 0 12px 24px -8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 32px -10px rgba(16, 24, 40, 0.12);

    /* Layout */
    --container: 1200px;
    --container-narrow: 760px;
    --sidebar-width: 260px;

    /* Curvas e transições */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    margin: 0 0 var(--space-3);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
}

h1 { font-weight: 800; }

p { margin: 0 0 var(--space-4); }

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

img, picture, video, svg {
    display: block;
    max-width: 100%;
}

img { height: auto; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

table { border-collapse: collapse; width: 100%; }

/* Foco elegante (sem contorno azul padrão grosseiro) */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid rgba(217, 56, 30, 0.5);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ---------- Utilitários ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

.container--narrow { max-width: var(--container-narrow); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-3);
    top: -100px;
    z-index: 1000;
    padding: var(--space-2) var(--space-4);
    background: var(--color-dark);
    color: var(--color-text-inverse);
    border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-3); }

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
