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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
}

/* ─── Range input ─────────────────────────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0891b2;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0891b2;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ─── Number input — hide arrows ──────────────────────────────────────────── */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ─── Textarea ────────────────────────────────────────────────────────────── */
textarea {
  resize: vertical;
  font-family: inherit;
}

/* ─── Buttons reset ───────────────────────────────────────────────────────── */
button {
  font-family: inherit;
  cursor: pointer;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ─── Focus visible ───────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid #0891b2;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Selection ───────────────────────────────────────────────────────────── */
::selection {
  background: rgba(8, 145, 178, 0.2);
  color: inherit;
}

/* ─── Transitions ─────────────────────────────────────────────────────────── */
button, input, textarea, select, label {
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* ─── Password monospace font fallback ────────────────────────────────────── */
.password-display {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ─── Responsive: prevent long German words from breaking layout ──────────── */
@media (max-width: 480px) {
  span, p, h1, h2, h3, label {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* ─── Loading skeleton pulse ──────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.skeleton {
  animation: pulse 1.5s ease-in-out infinite;
  background: #e2e8f0;
  border-radius: 6px;
}

/* ─── Fade in on mount ────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
#root > div {
  animation: fadeIn 0.3s ease;
}
