/* ==========================================================================
   ECM IT-Consulting - Modern Cross-Browser Reset & Normalization
   Compatible with Chrome, Safari (macOS & iOS), Edge, and Firefox
   ========================================================================== */

/* 1. Global Box-Sizing & Margin/Padding Reset */
*,
*::before,
*::after {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 2. Document & Root Configuration */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  height: 100%;
}

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

/* 3. Body Baseline */
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-color: #ffffff;
  color: #0f172a;
}

/* 4. Media Elements */
img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* 5. Typography */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.25;
}

p {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 6. Links & Lists */
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* 7. Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* 8. Form Controls & Buttons Normalization */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  -moz-appearance: button;
  appearance: button;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  touch-action: manipulation;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/* Prevent iOS Safari 16px auto-zoom on input focus */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 16px; /* iOS Safari zoom prevention */
  border-radius: 8px;
  -webkit-border-radius: 8px;
}

/* Webkit Search Decorators */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Webkit Number Spinners */
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;
}

/* Textarea Normalization */
textarea {
  overflow: auto;
  resize: vertical;
}

/* Checkbox & Radio Buttons */
input[type="checkbox"],
input[type="radio"] {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  padding: 0;
  cursor: pointer;
  accent-color: #2563eb;
}

/* Touch-friendly interactive minimum sizes (WCAG 2.1 AAA / Apple HIG) */
.touch-target,
.btn,
.nav-link,
.dropdown-link,
.mobile-nav-toggle,
.back-to-top,
.cookie-reopen-floating,
.cookie-btn,
.footer-legal-links a {
  min-height: 44px;
  min-width: 44px;
}
