/* Reset + base typography + accessibility utilities */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night-charcoal);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

img,
svg {
  max-width: 100%;
  display: block;
}

/* A storybook, not a document — matches prototype/login.html verbatim.
   Only the password field should ever be selectable; everything else
   (title, subtitle, denied message, the toggle-password button) should not
   pick up a text-selection highlight on long-press or drag. This was never
   carried over when login.css was transcribed from the prototype. */
*,
*::before,
*::after {
  -webkit-user-select: none;
  user-select: none;
}
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

/* Screen-reader-only content: present for assistive tech, not on the page. */
.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;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--ivory-parchment);
  color: var(--ink);
  padding: 0.5em 1em;
  z-index: 500;
}

/* Visible, non-color-only focus indicator against both parchment and dark
   backgrounds (QA "Accessibility": focus visible everywhere). */
:focus {
  outline: none;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

/* Decorative-only elements (dust, particles, flourishes) are hidden from
   assistive technology at the markup level via aria-hidden; this class is
   the visual/pointer counterpart so they never intercept input either. */
.decorative {
  pointer-events: none;
  user-select: none;
}

::selection {
  background: var(--aged-gold-light);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-medium: 0ms;
    --motion-slow: 0ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Body text contrast target: WCAG AA on parchment. */
.parchment,
.parchment * {
  color: var(--ink);
}
