/*
 * Hausverwaltungs-Autopilot — Basis und Reset
 * ---------------------------------------------------------------------------
 * Low-specificity reset, typography and accessibility foundations. Imported
 * after tokens.css so the custom properties are available.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--hva-font-sans);
  font-size: var(--hva-font-size-md);
  line-height: var(--hva-line-height-normal);
  color: var(--hva-color-text);
  background-color: var(--hva-color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--hva-color-primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--hva-color-primary-strong);
}

h1,
h2,
h3,
h4 {
  line-height: var(--hva-line-height-tight);
  font-weight: 600;
  color: var(--hva-color-text);
  text-wrap: balance;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--hva-font-size-2xl);
}

h2 {
  font-size: var(--hva-font-size-xl);
}

h3 {
  font-size: var(--hva-font-size-lg);
}

p {
  overflow-wrap: break-word;
}

table {
  border-collapse: collapse;
}

/* --- Focus visibility (WCAG 2.4.7 / 2.4.11) ------------------------------ */
:focus-visible {
  outline: var(--hva-focus-ring);
  outline-offset: var(--hva-focus-offset);
}

/* --- Reduced motion (WCAG 2.3.3) ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Screen-reader-only utility ----------------------------------------- */
.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;
}

/* --- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: var(--hva-space-3);
  left: var(--hva-space-3);
  z-index: calc(var(--hva-z-toast) + 1);
  transform: translateY(-200%);
  transition: transform var(--hva-duration-fast) var(--hva-ease);
}

.skip-link:focus {
  transform: translateY(0);
}
