/* ==========================================================================
   base.css — design tokens, typography, form controls, a11y
   Loaded on every page (master template + standalone auth pages).
   ========================================================================== */

/* --- 1. Design tokens ---------------------------------------------------- */
:root {
  /* Brand palette */
  --color-surface: #42464b; /* dark slate — nav, cards, containers */
  --color-surface-2: #4c5157; /* slightly lifted slate */
  --color-bg: #e5e5e5; /* page background */
  --color-accent: #ab87cd; /* fey purple (brand lavender) */
  --color-accent-hover: #bfa0dc; /* lighter purple (hover) */
  --color-accent-press: #9d78c0; /* deeper purple (active) */
  --color-on-dark: #e5e5e5; /* text on slate */
  --color-on-light: #1f2124; /* text on light bg */
  --color-on-accent: #1f2124; /* dark text on purple (passes contrast) */
  --color-border: #42464b;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-heading: var(--font-sans);
  --line: 1.6;

  /* Spacing & shape */
  --space: 1rem;
  --radius: 12px;
  --radius-lg: 20px;
  --nav-height: 56px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

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

/* --- 6. Typography ------------------------------------------------------- */
body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: var(--line);
  color: var(--color-on-light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem);
}
h2 {
  font-size: clamp(1.4rem, 1rem + 1.6vw, 1.9rem);
}
h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 0.75em;
}

a {
  color: var(--color-accent);
}
a:hover {
  color: var(--color-accent-press);
}

/* --- 7. Form controls ---------------------------------------------------- */
button,
input[type="submit" i],
input[type="button" i],
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-on-accent);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
button:hover,
input[type="submit" i]:hover,
input[type="button" i]:hover,
.btn:hover {
  background: var(--color-accent-hover);
}
button:active,
input[type="submit" i]:active,
input[type="button" i]:active,
.btn:active {
  background: var(--color-accent-press);
  transform: translateY(1px);
}

input:not([type="submit" i]):not([type="button" i]):not([type="checkbox"]):not(
    [type="radio"]
  ),
select,
textarea {
  font: inherit;
  color: var(--color-on-light);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  max-width: 100%;
}

/* --- 8. Responsive helpers ---------------------------------------------- */
.tableWrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

/* --- 9. Accessibility ---------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

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