/* Software desenvolvido por Henrique Uebel, registro no INPI - BR512025004300-7.
   Licenciado para uso exclusivo da Addaxis Sistemas Ltda, CNPJ: 63.078.814/0001-69. */

/* ============================================================================
   BASE + UTILITÁRIOS — Portal Addaxis AI
   ============================================================================
   O sistema legado usava Tailwind, que exige Node no build. Como o objetivo do
   port é eliminar o Node, este arquivo reimplementa à mão o subconjunto de
   utilitários que as telas realmente usam, com os MESMOS nomes de classe do
   Tailwind. Isso mantém o markup do legado praticamente copiável.

   Regra: aqui só entram utilitários genéricos. Estilo de componente (botão,
   card, tabela, modal) vive em components.css.
   ============================================================================ */

/* ── Reset ────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: hsl(var(--border));
}

* {
    margin: 0;
    padding: 0;
}

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

body {
    min-height: 100vh;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    color: inherit;
}

button,
[type="button"],
[type="submit"] {
    cursor: pointer;
    background-color: transparent;
    background-image: none;
}

button:disabled,
[type="button"]:disabled,
[type="submit"]:disabled {
    cursor: not-allowed;
}

img, svg, video, canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

table {
    border-collapse: collapse;
    text-indent: 0;
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

/* Rolagem no visual do tema, não a barra clara padrão do SO. */
* {
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--muted)) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background-color: hsl(var(--muted));
    border-radius: 9999px;
    border: 2px solid hsl(var(--background));
}
*::-webkit-scrollbar-thumb:hover { background-color: hsl(var(--muted-foreground)); }

/* Foco visível e consistente — acessibilidade. */
:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

::selection {
    background-color: hsl(var(--primary) / 0.3);
    color: hsl(var(--foreground));
}

/* Respeita quem pediu menos animação no SO. */
@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;
    }
}

/* ── Layout ───────────────────────────────────────────────────────────── */

.container {
    width: 100%;
    margin-inline: auto;
    padding-inline: 2rem;
}
@media (min-width: 1400px) { .container { max-width: 1400px; } }

.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.shrink-0 { flex-shrink: 0; }
.grow { flex-grow: 1; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-full { grid-column: 1 / -1; }

/* Espaçamentos: escala do Tailwind (0.25rem por unidade). */
.gap-0 { gap: 0; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-x-2 { column-gap: 0.5rem; }
.gap-x-4 { column-gap: 1rem; }
.gap-y-2 { row-gap: 0.5rem; }
.gap-y-4 { row-gap: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }

.px-0 { padding-inline: 0; }
.px-1 { padding-inline: 0.25rem; }
.px-2 { padding-inline: 0.5rem; }
.px-3 { padding-inline: 0.75rem; }
.px-4 { padding-inline: 1rem; }
.px-6 { padding-inline: 1.5rem; }
.px-8 { padding-inline: 2rem; }

.py-0 { padding-block: 0; }
.py-1 { padding-block: 0.25rem; }
.py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 0.75rem; }
.py-4 { padding-block: 1rem; }
.py-6 { padding-block: 1.5rem; }
.py-8 { padding-block: 2rem; }
.py-12 { padding-block: 3rem; }
.py-16 { padding-block: 4rem; }
.py-20 { padding-block: 5rem; }

.pt-0 { padding-top: 0; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
/* Usada no separador do rodapé da LandingPage; faltava e o espaçamento sumia. */
.pt-8 { padding-top: 2rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-8 { padding-bottom: 2rem; }

.m-0 { margin: 0; }
.mx-auto { margin-inline: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 0.5rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }

/* ── Dimensões ────────────────────────────────────────────────────────── */

.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }

.min-h-screen { min-height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-full { max-width: 100%; }

/* ── Tipografia ───────────────────────────────────────────────────────── */

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: var(--font-mono); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.break-all { word-break: break-all; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }

.underline { text-decoration: underline; }
/* Usada nos links de "Política de Privacidade"/"Termos" da barra de cookies e do
   rodapé — sem ela o link não dá nenhum retorno visual ao passar o mouse. */
.hover\:underline:hover { text-decoration: underline; }
.hover\:underline:hover { text-decoration: underline; }

/* ── Cores ────────────────────────────────────────────────────────────── */

.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-secondary-foreground { color: hsl(var(--secondary-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-destructive-foreground { color: hsl(var(--destructive-foreground)); }
.text-card-foreground { color: hsl(var(--card-foreground)); }
.text-success { color: hsl(var(--success)); }
.text-warning { color: hsl(var(--warning)); }
.text-info { color: hsl(var(--info)); }

.bg-background { background-color: hsl(var(--background)); }
.bg-foreground { background-color: hsl(var(--foreground)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-popover { background-color: hsl(var(--popover)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-destructive { background-color: hsl(var(--destructive)); }
.bg-success { background-color: hsl(var(--success)); }
.bg-warning { background-color: hsl(var(--warning)); }
.bg-transparent { background-color: transparent; }

/* Fundos suaves para chips de status. */
.bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.bg-destructive\/10 { background-color: hsl(var(--destructive) / 0.1); }
.bg-success\/10 { background-color: hsl(var(--success) / 0.1); }
.bg-warning\/10 { background-color: hsl(var(--warning) / 0.1); }
.bg-muted\/50 { background-color: hsl(var(--muted) / 0.5); }
.bg-card\/90 { background-color: hsl(var(--card) / 0.9); }

/* ── Bordas e cantos ──────────────────────────────────────────────────── */

.border { border-width: 1px; }
.border-0 { border-width: 0; }
.border-2 { border-width: 2px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-l-2 { border-left-width: 2px; }
.border-l-4 { border-left-width: 4px; }
.border-l-primary { border-left-color: hsl(var(--primary)); }
.border-border { border-color: hsl(var(--border)); }
.border-input { border-color: hsl(var(--input)); }
.border-primary { border-color: hsl(var(--primary)); }
.border-destructive { border-color: hsl(var(--destructive)); }
.border-transparent { border-color: transparent; }

.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* ── Efeitos ──────────────────────────────────────────────────────────── */

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.opacity-100 { opacity: 1; }

.backdrop-blur { backdrop-filter: blur(8px); }

.transition {
    transition-property: color, background-color, border-color, opacity, box-shadow, transform;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Posicionamento ───────────────────────────────────────────────────── */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
/* Ícone de busca posicionado DENTRO do campo (padrão "relative + absolute left-3
   top-3" herdado do legado). Sem estas duas regras o ícone encosta no canto
   superior esquerdo do container e fica por cima do texto digitado. */
.left-3 { left: 0.75rem; }
.top-3 { top: 0.75rem; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }

/* Esconde visualmente mantendo para leitor de tela. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ── Animações ────────────────────────────────────────────────────────── */

@keyframes portal-spin { to { transform: rotate(360deg); } }

@keyframes portal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes portal-zoom-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes portal-slide-in-right {
    from { opacity: 0; transform: translateX(1rem); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-spin { animation: portal-spin 1s linear infinite; }
.animate-fade-in { animation: portal-fade-in 150ms ease-out; }
.animate-zoom-in { animation: portal-zoom-in 150ms ease-out; }

/* ── Responsivo ───────────────────────────────────────────────────────── */

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:text-left { text-align: left; }
    .sm\:w-auto { width: auto; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:flex-row { flex-direction: row; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .md\:w-auto { width: auto; }
    /* Barra de cookies e rodapé: sem estas regras a versão desktop herda o
       empilhamento do mobile (texto e botões centralizados, um sob o outro). */
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:text-right { text-align: right; }
    .md\:ml-4 { margin-left: 1rem; }
    .md\:mt-0 { margin-top: 0; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:px-8 { padding-inline: 2rem; }
}
