/* ========================================
   TRADING 2D – Reset & Normalize
   ======================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  min-height: 100dvh;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* RULE-04: sticky footer через flex-колонку, а не calc() у .main */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Typography Reset */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
}

p {
  margin: 0;
}

a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--duration-base) var(--easing-ease);
}

a:not(.btn):hover {
  color: var(--color-accent);
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Inline <svg> без CSS width/height (лише HTML-атрибути) браузер іноді не
   визнає за "вміст" при обчисленні automatic minimum size у flex-контейнері
   (кнопки-іконки: .btn-icon, header actions тощо) — SVG стискається до
   width:0 і зникає, хоча DOM/computed color лишаються коректними. flex-shrink:0
   гарантує, що іконка завжди займає свій реальний розмір. */
svg {
  flex-shrink: 0;
}

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

ul, ol {
  list-style: none;
}

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

/* Focus Styles for Accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* iOS Safari specific fixes.
   checkbox/radio виключені: appearance:none без власної заміни (рамка +
   галочка) робить їх порожнім невидимим квадратом. Нативний вигляд тут
   навпаки потрібен — саме він дає рамку й підтримує accent-color нижче. */
input:not([type="checkbox"]):not([type="radio"]),
button,
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

button,
input[type="button"],
input[type="submit"] {
  font-size: 16px; /* Prevents zoom on iOS */
}

/* iOS text input styling */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  font-size: 16px;
  padding: var(--sp-md);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--border-radius-sm);
}

/* Disable tap highlight on mobile */
a, button {
  -webkit-tap-highlight-color: transparent;
}
