/* The look both hosts share: neutral surfaces with the RAILeqmt wordmark's yellow on primary actions.
   Each host's own site.css lays out its pages on top of this. Fonts come from the system: front-end
   assets are never loaded from a CDN, and Avenir Next and Century Gothic are the geometric faces most machines already
   have. Light only: the dark "night" panels are dark in either scheme, so there is no dark mode to follow. */

:root {
  color-scheme: light;

  --ink: #18181b;
  --ink-soft: #3f3f46;
  --on-ink: #ffffff;
  --paper: #fafafa;
  --surface: #ffffff;
  --muted: #f4f4f5;
  --muted-ink: #52525b;
  --line: #e4e4e7;
  --line-soft: #e6e9ec;
  --accent: #ffc400;
  --accent-hover: #e6b000;
  --danger: #b91c1c;
  --ok: #15803d;
  --warn: #a16207;

  /* The dark panels and the grey cards. */
  --night: #14191e;
  --stone: #eaedf0;

  --font-display: "Avenir Next", Avenir, "Century Gothic", Futura, system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 2px;
  --ease: 200ms ease-out;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

code {
  font-size: 0.9em;
  background: var(--muted);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Each host draws its icons once in its layout, as <symbol>s in an .icon-sprite. An SVG element ignores the hidden
   attribute, so the sprite is hidden here. */
.icon-sprite {
  display: none;
}

/* Use the supplied wordmark in its original colours and proportions. */
.logo {
  display: inline-block;
  flex: none;
  height: 1.75rem;
  aspect-ratio: 1578 / 361;
  background: url("../img/raileqmt-logo.png") center / contain no-repeat;
  forced-color-adjust: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink);
  font: 600 0.75rem/1.25 var(--font-body);
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}

.button .icon {
  width: 1rem;
  height: 1rem;
}

.button:hover {
  background: var(--accent-hover);
}

.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button-quiet:hover {
  background: var(--muted);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted-ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--muted-ink);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted-ink);
}

.field {
  display: grid;
  min-width: 0;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 600;
}

.field input:not([type="checkbox"], [type="radio"], [type="hidden"]),
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

.field textarea {
  resize: vertical;
}

.field label:has(input[type="checkbox"], input[type="radio"]),
.checkbox label,
.company-toggle + label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
}

input[type="checkbox"],
input[type="radio"] {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--ink);
}

.table-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-wrap: normal;
}

.alert {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
}

.alert ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* "Jag handlar för ett företag" on sign-up: disabled company fields stay out of browser validation. Without
   JavaScript they remain visible and usable, and the server ignores them unless the box was checked. */
.company-toggle {
  margin-right: 0.5rem;
}

.company-fields:disabled {
  display: none;
}

.company-fields {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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