/* ==========================================================================
   DatomIQ - CSS Reset / Normalize
   Reset moderno para consistência cross-browser
   ========================================================================== */

/* ========================================
   BOX SIZING
   ======================================== */

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

/* ========================================
   RESET DE MARGENS E PADDING
   ======================================== */

* {
  margin: 0;
  padding: 0;
}

/* ========================================
   HTML E BODY
   ======================================== */

html {
  /* Previne ajustes de tamanho de fonte no iOS */
  -webkit-text-size-adjust: 100%;
  /* Scroll suave para navegação por âncoras */
  scroll-behavior: smooth;
  /* Melhora a renderização de fontes */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* Altura mínima para cobrir a viewport */
  min-height: 100vh;
  /* Renderização de texto */
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* ========================================
   TIPOGRAFIA
   ======================================== */

/* Remove estilos de lista */
ul,
ol {
  list-style: none;
}

/* Herda fontes para elementos de formulário */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove decoração de links */
a {
  text-decoration: none;
  color: inherit;
}

/* ========================================
   IMAGENS E MEDIA
   ======================================== */

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

/* ========================================
   TABELAS
   ======================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ========================================
   FORMULARIOS
   ======================================== */

/* Remove aparência padrão de inputs */
input,
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  outline: none;
}

/* Remove aparência padrão de botões */
button {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
}

/* Remove spinner de inputs numéricos */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Remove ícone de limpar no IE/Edge */
input::-ms-clear {
  display: none;
}

/* Remove ícone de senha no IE/Edge */
input::-ms-reveal {
  display: none;
}

/* Estilo consistente para placeholder */
::placeholder {
  opacity: 1;
}

/* Remove resize de textarea (controlado via CSS específico) */
textarea {
  resize: vertical;
}

/* ========================================
   FOCO E ACESSIBILIDADE
   ======================================== */

/* Remove outline padrão (será substituído por estilos customizados) */
:focus {
  outline: none;
}

/* Estilo de foco visível para acessibilidade (navegação por teclado) */
:focus-visible {
  outline: 2px solid var(--nebula-purple, #4B3B8B);
  outline-offset: 2px;
}

/* Esconde elementos visualmente mas mantém para screen readers */
.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;
}

/* ========================================
   REDUCAO DE MOVIMENTO
   ======================================== */

/* Respeita preferência de movimento reduzido do usuário */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   SELECAO DE TEXTO
   ======================================== */

::selection {
  background-color: var(--nebula-purple, #4B3B8B);
  color: var(--starlight-white, #FFFFFF);
}

::-moz-selection {
  background-color: var(--nebula-purple, #4B3B8B);
  color: var(--starlight-white, #FFFFFF);
}

/* ========================================
   SCROLLBAR CUSTOMIZADA
   ======================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--deep-space, #020024);
}

::-webkit-scrollbar-thumb {
  background: var(--stardust-grey, #505050);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nebula-purple, #4B3B8B);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--stardust-grey, #505050) var(--deep-space, #020024);
}
