:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --accent: #1f2937;
  --accent-text: #ffffff;
  --error: #b91c1c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #374151;
    --accent: #fbbf24;
    --accent-text: #111317;
    --error: #f87171;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 28rem;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

h1 {
  margin-top: 0;
  font-size: 1.5rem;
}

form {
  display: grid;
  gap: 0.5rem;
}

label {
  font-weight: 600;
  margin-top: 0.5rem;
}

input,
select,
button,
a.button {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

button,
a.button {
  margin-top: 1rem;
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.error {
  color: var(--error);
  font-weight: 600;
}

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

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.25rem;
}

a {
  color: inherit;
}

a.button {
  display: block;
  text-align: center;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.ride {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ride h2 {
  margin-top: 0;
}

.status {
  font-weight: 600;
}

.timeline {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  display: grid;
  padding: 0 0 0.75rem 1rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline time,
.past time {
  color: var(--muted);
  font-size: 0.9rem;
}

.past {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.notice {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

fieldset {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

label.choice {
  font-weight: 400;
  margin: 0;
}

label.choice input {
  width: auto;
}

form:has(input[name="profile"][value="rider"]:checked) .driver-only {
  display: none;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

input.code {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5em;
  text-align: center;
  padding: 0.6rem 0 0.6rem 0.5em;
  border: 2px solid var(--text);
  border-radius: 0.6rem;
  box-shadow:
    inset 0 0 0 4px var(--surface),
    inset 0 0 0 5px var(--border);
}

input.code::placeholder {
  color: var(--border);
}

details.change summary {
  cursor: pointer;
  color: var(--muted);
}

details.change[open] {
  display: grid;
  gap: 0.5rem;
}

strong {
  overflow-wrap: anywhere;
}

.past li form button {
  margin-top: 0.5rem;
}

form {
  grid-template-columns: minmax(0, 1fr);
}

input,
select {
  width: 100%;
  min-width: 0;
}

.password {
  position: relative;
  display: grid;
}

.password input {
  padding-right: 4.75rem;
}

.password button.reveal {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  margin: 0;
  padding: 0.3rem 0.65rem;
  font-size: 0.9rem;
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

form:has(option[value="standard"]:checked) .chauffeur-only,
form:has(option[value="chauffeur"]:checked) .standard-only {
  display: none;
}

.report summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.report[open] summary {
  margin-bottom: 0.5rem;
}

.landing .lede {
  font-size: 1.15rem;
}

.landing .actions a.button {
  display: inline-block;
  margin-right: 0.5rem;
  text-decoration: none;
}

a.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

ol.steps {
  padding-left: 1.25rem;
}

ol.steps li {
  margin-bottom: 0.5rem;
}

footer.site {
  margin: 2rem auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
