/*
 * Reset, base typography, and the app shell. Nothing component-specific:
 * component CSS lives in app/components/<name>/<name>_component.css.
 *
 * Every value here comes from tokens.css. No hex codes, spacing pixel values,
 * or font sizes in this file.
 */

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

* {
  margin: 0;
}

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

body {
  background: var(--surface-sunken);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  font-weight: var(--weight-bold);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--primary-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

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

/* --- Forms ------------------------------------------------------------- */

input, select, textarea {
  font: inherit;
  color: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  width: 100%;
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.field {
  margin-bottom: var(--space-4);
}

/* --- App shell --------------------------------------------------------- */

.nav {
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-6);
}

.nav__brand {
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  color: var(--text);
}

.nav__links {
  display: flex;
  gap: var(--space-4);
  flex: 1;
}

.nav__link {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.nav__link:hover {
  background: var(--surface-sunken);
  text-decoration: none;
}

.nav__link--active {
  color: var(--primary-700);
  background: var(--primary-50);
}

.nav__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.nav__user form {
  display: inline;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.muted {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.flash {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--info-50);
  color: var(--info-700);
}

.flash--alert {
  background: var(--error-50);
  color: var(--error-700);
}

/* Centered single-column page, used by sign-in and password reset. */
.narrow {
  max-width: 24rem;
  margin: var(--space-8) auto;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
