/* Base styles: reset, typography and page layout. Values come from tokens.css. */

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

body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--font-leading-normal);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--font-leading-tight);
}

h1 {
  font-size: var(--font-size-xl);
}

h2 {
  font-size: var(--font-size-lg);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* A centred column that is as wide as the window up to the "large" breakpoint
   (72rem, where the layout changes from phone/tablet to desktop) and stops
   growing there, so rows never get narrower as the window widens. */
.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-4);
  display: grid;
  /* `minmax(0, 1fr)`, not `auto`: a grid column is as wide as its widest
     content by default, so one long unbreakable title would stretch the page. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

/* The sign-in page: a single card, centred. */
.page-narrow {
  max-width: 24rem;
  margin-top: var(--space-7);
}

.card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Children stacked with a gap between them. */
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

/* Text for screen readers only (a label the design shows another way). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
