/* ============================================================================
   FLAG OS V1.9 - CSS RESET
   Arquivo: assets/css/01-reset.css
   Versão: 1.9.0
   ============================================================================ */

/* ============================================ */
/* Box Sizing                                  */
/* ============================================ */

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

/* ============================================ */
/* HTML & Body                                 */
/* ============================================ */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;

  /* Tactical Grid Background */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
}

body.modal-open {
  overflow: hidden;
}

/* A11y utility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Headings: HUD display style */
h1,
h2,
h3 {
  font-family: var(--font-title);
  letter-spacing: -0.035em;
  font-weight: 700;
}

/* ============================================================================
   HUD BACKGROUND LAYER (subtle grain + depth)
   ============================================================================ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(var(--color-primary-rgb), 0.08), transparent 55%),
    radial-gradient(700px 500px at 85% 25%, rgba(var(--color-secondary-rgb), 0.06), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%),
    url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"120\"><filter id=\"n\"><feTurbulence baseFrequency=\"0.9\" numOctaves=\"3\"/></filter><rect width=\"100%\" height=\"100%\" filter=\"url(%23n)\" opacity=\"0.05\"/></svg>');
  background-blend-mode: screen, screen, normal, normal;
  opacity: 1;
}

/* ============================================================================
   MOTION SAFETY (prefer-reduced-motion + toggle)
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

html[data-motion="reduced"] {
  scroll-behavior: auto;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ============================================ */
/* Listas                                      */
/* ============================================ */

ul,
ol {
  list-style: none;
}

/* ============================================ */
/* Links                                       */
/* ============================================ */

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

a:hover {
  text-decoration: none;
}

/* ============================================ */
/* Imagens                                     */
/* ============================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================ */
/* Botões                                      */
/* ============================================ */

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================ */
/* Inputs, Textarea, Select                    */
/* ============================================ */

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: transparent;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* Remover aparência de número */
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;
  appearance: textfield;
}

/* ============================================ */
/* Títulos                                     */
/* ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-semibold);
  line-height: 1.2;
  margin: 0;
}

/* ============================================ */
/* Parágrafos                                  */
/* ============================================ */

p {
  margin: 0;
}

/* ============================================ */
/* Seleção de Texto                            */
/* ============================================ */

::selection {
  background-color: var(--color-primary);
  color: #000;
}

::-moz-selection {
  background-color: var(--color-primary);
  color: #000;
}

/* ============================================ */
/* Details & Summary                           */
/* ============================================ */

details {
  cursor: pointer;
}

summary {
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

/* ============================================ */
/* Tabelas                                     */
/* ============================================ */

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

/* ============================================ */
/* HR                                          */
/* ============================================ */

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-lg) 0;
}

/* ============================================ */
/* Hidden Class                                */
/* ============================================ */

.hidden {
  display: none !important;
}