/* Prøv en elcykel – Vejle
   Palette: fjord navy ink, Danish cycle-route blue, hill green, reflector amber on cool white.
   Type: Familjen Grotesk for headings, Atkinson Hyperlegible for everything you read. */

@font-face {
  font-family: "Familjen Grotesk";
  src: url("/assets/fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
/* Atkinson's slashed zero looks like the Danish letter Ø, so digits come from Familjen Grotesk. */
@font-face {
  font-family: "Digits";
  src: url("/assets/fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f7fa;
  --surface: #ffffff;
  --ink: #14213d;
  --ink-2: #4a5875;
  --line: #d3dce6;
  --mist: #dce6ee;
  --blue: #1d4e89;
  --blue-dark: #153a67;
  --blue-tint: #e6eef7;
  --green: #2f6b4f;
  --green-tint: #e3efe8;
  --amber: #e8a317;
  --amber-tint: #fbf0d6;
  --red: #b3261e;
  --red-tint: #f8e3e1;
  --grey: #7a8699;
  --grey-tint: #eceff3;

  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Digits", "Atkinson Hyperlegible", "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 40rem;
  --page: 72rem;
}

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

html[data-loading] body {
  visibility: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.5rem, 3.2vw, 1.875rem);
  font-weight: 700;
}
h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
p {
  margin: 0 0 1em;
}
a {
  color: var(--blue);
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--blue-dark);
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow {
  max-width: var(--measure);
}
.muted {
  color: var(--ink-2);
}
.small {
  font-size: 0.9375rem;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 10;
}
.skip:focus {
  top: 8px;
  color: #fff;
}

/* ------------------------------------------------------------------ header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand svg {
  flex: none;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-place {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink-2);
  margin-left: 4px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.nav a,
.nav button.linklike {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
}
.nav a:hover,
.nav button.linklike:hover {
  color: var(--blue);
}
.nav a[aria-current="page"] {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav .btn {
  min-height: 40px;
  padding: 8px 14px;
  color: #fff;
}
.nav .btn:hover {
  color: #fff;
}
.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: var(--surface);
}
.lang button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 30px;
}
.lang button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}
.btn-quiet {
  background: transparent;
  color: var(--blue);
}
.btn-quiet:hover {
  background: var(--blue-tint);
  color: var(--blue-dark);
}
.btn-small {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 0.9375rem;
}
.btn-green {
  background: var(--green);
  border-color: var(--green);
}
.btn-green:hover {
  background: #24543e;
  border-color: #24543e;
}
.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  padding-left: 0;
  padding-right: 0;
}
.btn-danger:hover {
  background: transparent;
  border-color: transparent;
  color: #8c1d17;
}
.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 8vw, 88px) 0 0;
}
.hero-text {
  position: relative;
  z-index: 1;
  max-width: 38rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 7.2vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-bottom: 0.35em;
  text-wrap: balance;
}
.hero .lead {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--ink-2);
  max-width: 34rem;
  margin-bottom: 28px;
}
.hill {
  display: block;
  width: 100%;
  height: clamp(120px, 20vw, 220px);
  margin-top: clamp(24px, 5vw, 48px);
}
.hill .ground {
  fill: var(--blue);
}
.hill .contour {
  fill: none;
  stroke: var(--mist);
  stroke-width: 1.5;
}
.hill .water {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}
.hill .fjord-label {
  font-family: var(--font-body);
  font-size: 13px;
  fill: var(--ink-2);
  font-style: italic;
}
.hill .rider circle {
  fill: var(--amber);
  stroke: var(--paper);
  stroke-width: 3;
}
.hill .rider path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ sections */
.band {
  padding: clamp(40px, 7vw, 72px) 0;
}
.band-blue {
  background: var(--blue);
  color: #fff;
}
.band-blue h2,
.band-blue h3 {
  color: #fff;
}
.band-blue .muted {
  color: #c9d8ea;
}
.band-white {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-head h2 {
  margin: 0;
}

/* ------------------------------------------------------------------ the rack (public status board) */
.rack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px 0;
  margin-bottom: 20px;
}
.slot {
  padding: 0 14px 14px;
  border-bottom: 6px solid var(--ink); /* the rack's rail */
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.slot::after {
  /* the stand: painted in the bike's state colour */
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 8px;
  border-radius: 6px 6px 0 0;
  background: var(--state, var(--grey));
}
.rack > p {
  grid-column: 1 / -1;
}
.slot-photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--paper);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 6px;
}
.slot-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slot-photo > span {
  width: 58%;
  color: #b9c6d4;
  display: flex;
}
.slot-photo svg {
  width: 100%;
  height: auto;
}
.slot h3 {
  margin: 0;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9375rem;
}
.state::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--state, var(--grey));
  flex: none;
}
.slot .sub {
  font-size: 0.875rem;
  color: var(--ink-2);
  min-height: 2.8em;
  margin: 0 0 14px;
  line-height: 1.4;
}
@media (max-width: 420px) {
  .slot {
    padding: 0 10px 12px;
  }
  .slot::after {
    left: 10px;
    right: 10px;
  }
}
[data-state="available"] {
  --state: var(--green);
}
[data-state="reserved"] {
  --state: var(--amber);
}
[data-state="on_loan"] {
  --state: var(--blue);
}
[data-state="in_repair"] {
  --state: var(--grey);
}
.queue-line {
  font-size: 1.0625rem;
  margin: 0;
}

/* ------------------------------------------------------------------ steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px 32px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  border-top: 2px solid rgba(255, 255, 255, 0.35);
  padding-top: 14px;
}
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--amber);
}
.steps p {
  margin: 0;
  color: #d9e4f1;
}

/* ------------------------------------------------------------------ shop info */
.shop-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: start;
}
.shop-info .name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
}

/* ------------------------------------------------------------------ prose (rules) */
.prose {
  max-width: var(--measure);
}
.prose h2 {
  font-size: 1.375rem;
  margin-top: 1.6em;
}
.prose .lead {
  font-size: 1.1875rem;
  color: var(--ink-2);
}
.page {
  padding: clamp(32px, 6vw, 64px) 0 clamp(48px, 8vw, 88px);
}

/* ------------------------------------------------------------------ forms */
.form {
  display: grid;
  gap: 18px;
  max-width: 28rem;
}
.field {
  display: grid;
  gap: 6px;
}
.field label,
.label {
  font-weight: 700;
}
.hint {
  font-size: 0.875rem;
  color: var(--ink-2);
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 48px;
  width: 100%;
}
input:focus,
textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-tint);
}
input[aria-invalid="true"] {
  border-color: var(--red);
}
.code-input {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.4em;
  text-align: center;
  max-width: 14rem;
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.check input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--blue);
  flex: none;
}
.choice {
  display: grid;
  gap: 10px;
}
.choice label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 400;
}
.choice label:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-tint);
}
.choice input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--blue);
  flex: none;
}
.choice b {
  display: block;
}
.days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.days label {
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  min-width: 92px;
  text-align: center;
  line-height: 1.25;
  font-weight: 400;
}
.days label b {
  display: block;
  font-family: var(--font-display);
}
.days label span {
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.days input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.days label:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.days label:has(input:checked) span {
  color: #d9e4f1;
}
.days label:has(input:focus-visible) {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.form-error {
  color: var(--red);
  font-weight: 700;
  margin: 0;
}
.form-error:empty {
  display: none;
}

/* ------------------------------------------------------------------ status panel (my page) */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--state, var(--blue));
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: 28px;
}
.panel h2 {
  margin-bottom: 0.4em;
}
.panel[data-state="waiting"] {
  --state: var(--blue);
}
.panel[data-state="offered"] {
  --state: var(--amber);
}
.panel[data-state="confirmed"] {
  --state: var(--green);
}
.panel[data-state="picked_up"] {
  --state: var(--green);
}
.panel[data-state="overdue"] {
  --state: var(--red);
}
.panel[data-state="none"] {
  --state: var(--grey);
}
.position {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}
.position .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 14vw, 6rem);
  line-height: 0.9;
  color: var(--blue);
  letter-spacing: -0.04em;
}
.callout {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 16px 0;
}
.callout-warn {
  background: var(--red-tint);
  color: #6f1813;
  font-weight: 700;
}
.callout-amber {
  background: var(--amber-tint);
}
.account {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

/* ------------------------------------------------------------------ shop screen */
.shop-grid {
  display: grid;
  gap: 32px;
}
.shop-section h2 {
  font-size: 1.375rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.count {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0;
}
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rows > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.rows > li:first-child {
  border-top: 0;
}
.rows .who {
  font-weight: 700;
}
.rows .meta {
  font-size: 0.9375rem;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}
.rows .flag {
  color: var(--red);
  font-weight: 700;
}
.rows .empty {
  display: block;
  color: var(--ink-2);
}
.rows .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 560px) {
  .rows > li {
    grid-template-columns: 1fr;
  }
  .rows .row-actions {
    justify-content: flex-start;
  }
}

/* ------------------------------------------------------------------ dialog + toast */
dialog {
  border: 0;
  border-radius: 14px;
  padding: 24px;
  width: min(30rem, calc(100vw - 32px));
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(20, 33, 61, 0.28);
}
dialog::backdrop {
  background: rgba(20, 33, 61, 0.45);
}
dialog h2 {
  font-size: 1.375rem;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  max-width: calc(100vw - 32px);
  z-index: 50;
}
.toast[data-kind="error"] {
  background: var(--red);
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  justify-content: space-between;
}
.site-footer p {
  margin: 0;
}

.loading-line {
  color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ additions */
html[data-loading] body {
  animation: reveal 0s 1.2s forwards; /* never leave the page hidden if a script fails */
}
@keyframes reveal {
  to {
    visibility: visible;
  }
}
.btn-red {
  background: var(--red);
  border-color: var(--red);
}
.btn-red:hover {
  background: #8c1d17;
  border-color: #8c1d17;
}
.hill-wrap {
  position: relative;
  height: clamp(110px, 17vw, 200px);
  margin-top: clamp(28px, 5vw, 56px);
}
.hill-wrap .hill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}
.hill-wrap .contour,
.hill-wrap .water {
  vector-effect: non-scaling-stroke;
}
.fjord-label {
  position: absolute;
  left: var(--gutter);
  bottom: calc(8% + 12px);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.rider {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 30px;
  color: var(--ink);
  transform-origin: 50% 100%;
  will-change: transform;
}
.rider svg {
  width: 100%;
  height: 100%;
  display: block;
}
noscript p {
  padding: 16px var(--gutter);
  background: var(--amber-tint);
  margin: 0;
}
