/* ============================================================
   _base.css — Reset moderno + tipografia base global
   ------------------------------------------------------------
   Carregado em SEGUNDO lugar (depois de _tokens.css),
   em TODAS as páginas.
   Define o comportamento padrão dos elementos HTML.
   ============================================================ */


/* ============================================================
   RESET (baseado em "A (more) Modern CSS Reset" - Andy Bell)
   ============================================================ */

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--text-default);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
}


/* ============================================================
   TIPOGRAFIA — HEADINGS E TEXTO
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--text-strong);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }
h5 { font-size: var(--text-lg);  }
h6 { font-size: var(--text-md);  }

p {
  line-height: var(--leading-relaxed);
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

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

strong,
b {
  font-weight: var(--font-semibold);
}


/* ============================================================
   LISTAS — neutralização global
   (cada componente reaplica list-style/padding quando precisar)
   ============================================================ */

ul,
ol {
  list-style: none;
}


/* ============================================================
   FORMULÁRIOS — comportamento padrão
   (componentes <x-ui.input>, <x-ui.button> sobrescrevem)
   ============================================================ */

label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-default);
}

input,
textarea,
select {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  color: var(--text-default);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .15);
}

textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-mono);
}

::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}


/* ============================================================
   UTILITÁRIOS GLOBAIS
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container-narrow {
  width: 100%;
  max-width: var(--content-narrow-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.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;
}

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

.text-muted  { color: var(--text-muted);  }
.text-strong { color: var(--text-strong); }
.text-brand  { color: var(--color-primary); }

.hidden { display: none !important; }


/* ============================================================
   IMPRESSÃO — mantém compatibilidade com o legado .print-area
   ============================================================ */

@media print {
  body * {
    visibility: hidden;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }
}

/* ============================================================
   ACESSIBILIDADE — respeita preferência de movimento reduzido.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    /* Reduz animações globalmente */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Restaura apenas o giro do cubo 3D */
    .cubo-3d {
        transition-duration: 1.2s !important;
    }
}