/* The booking steps: a dark card on a black page, four round steps over it joined by a line, honey for what is
   done and chosen. */
:root {
  --page: #000000;          /* the page */
  --card: #0e0e11;
  --edge: #24242b;
  --ink: #f3f1ec;
  --muted: #8d8b94;
  --dim: #5f5e67;
  --accent: #ffc46b;        /* the line, the steps done, the choices */
  --on-accent: #1f1606;
  --bad: #ff7a6b;
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Red Hat Display Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* held from the top: the card grows downwards as its panels change */
.stage {
  min-height: 100svh;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: clamp(28px, 12vh, 120px) 16px 32px;
}

.book {
  width: min(560px, 100%);
}

/* ---------------------------------------------------------------- the steps */
.steps {
  position: relative;
  margin-bottom: 22px;
}

/* the line, from the middle of the first step to the middle of the last (each step is a quarter wide) */
.steps__track {
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 21px;
  height: 2px;
  border-radius: 1px;
  background: var(--edge);
}

.steps__fill {
  position: absolute;
  inset: 0;
  border-radius: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.steps__list {
  position: relative;
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.step__node {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--page);
  color: var(--dim);
  box-shadow: inset 0 0 0 2px var(--edge);
  cursor: default;
  transition: box-shadow 0.35s, color 0.35s;
  -webkit-tap-highlight-color: transparent;
}

.step__node > * {
  grid-area: 1 / 1;
}

.step.is-current .step__node {
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.step.is-done .step__node {
  color: var(--on-accent);
  box-shadow: inset 0 0 0 2px var(--accent);
  cursor: pointer;
}

.step__node:disabled {
  cursor: default;
}

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

/* the honey that fills a step when it is done */
.step__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
}

.step__icon,
.step__tick {
  position: relative;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step__tick {
  stroke-width: 2.4;
}

.step__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
  transition: color 0.35s;
}

.step.is-current .step__label,
.step.is-done .step__label {
  color: var(--ink);
}

/* ---------------------------------------------------------------- the card and its panels */
.book__form {
  padding: 26px 26px 22px;
  border: 1px solid var(--edge);
  border-radius: 24px;
  background: var(--card);
}

.book__panels {
  position: relative;
  margin: 0 -8px;
  padding: 0 8px;
}

.panel {
  padding-bottom: 4px;
}

.panel__title {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  outline: none;
}

.group {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.group__label {
  margin-bottom: 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-grid;
  overflow: hidden;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip__face,
.chip__fill {
  grid-area: 1 / 1;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.chip__face {
  border-radius: 999px;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--edge);
  transition: box-shadow 0.25s;
}

@media (hover: hover) {
  .chip:hover .chip__face {
    box-shadow: inset 0 0 0 1.5px var(--muted);
  }
}

/* the honey that pours into the chip chosen, from where it was pressed */
.chip__fill {
  background: var(--accent);
  color: var(--on-accent);
  clip-path: circle(0px at 50% 50%);
}

.chip input:focus-visible + .chip__face {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- the rooms */
.rooms {
  display: grid;
  gap: 10px;
}

.room {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1.5px var(--edge);
  cursor: pointer;
  transition: box-shadow 0.3s, background-color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.room input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.room.is-on {
  background: rgba(255, 196, 107, 0.06);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

@media (hover: hover) {
  .room:not(.is-on):hover {
    box-shadow: inset 0 0 0 1.5px var(--muted);
  }
}

.room:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.room__check {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--edge);
}

.room__check i {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: var(--accent);
  transform: scale(0);
}

.room__check svg {
  position: relative;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room__name {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.room__line {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
}

.room__price {
  font-size: 16px;
  font-weight: 700;
  text-align: right;
}

.room__price small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the details */
.field {
  display: block;
  margin-bottom: 14px;
}

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field__input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  outline: none;
  background: #17171c;
  color: var(--ink);
  font: 500 16px 'Red Hat Display Variable', system-ui, sans-serif;
  box-shadow: inset 0 0 0 1.5px var(--edge);
  transition: box-shadow 0.25s;
}

.field__input:focus {
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgba(255, 196, 107, 0.16);
}

.field.is-wrong .field__input {
  box-shadow: inset 0 0 0 1.5px var(--bad);
}

.field__error {
  display: block;
  min-height: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: var(--bad);
}

.field__error:not(:empty) {
  padding-top: 7px;
}

/* ---------------------------------------------------------------- the summary */
.summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  margin: 0 0 18px;
  font-size: 15px;
}

.summary dt {
  color: var(--muted);
  font-weight: 500;
}

.summary dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--edge);
  font-size: 15px;
  color: var(--muted);
}

.total strong {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- done */
.panel--done {
  padding: 8px 0 6px;
  text-align: center;
}

.done__mark {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.done__text {
  max-width: 380px;
  margin: -8px auto 22px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the buttons */
.book__actions[hidden] {
  display: none;
}

.book__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  font: 700 15px 'Red Hat Display Variable', system-ui, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--edge);
  transition: box-shadow 0.25s, opacity 0.3s, visibility 0.3s;
}

@media (hover: hover) {
  .btn--ghost:hover {
    box-shadow: inset 0 0 0 1.5px var(--muted);
  }
}

.btn--ghost.is-gone {
  opacity: 0;
  visibility: hidden;
}

.btn--main {
  margin-left: auto;
  overflow: hidden;
  background: var(--accent);
  color: var(--on-accent);
}

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

/* the label rolls when it changes; its width is moved by the script */
.btn__clip {
  display: block;
  overflow: hidden;
}

.btn__label {
  display: block;
  white-space: nowrap;
}

.btn__arrow {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@media (hover: hover) {
  .btn--main:hover .btn__arrow {
    transform: translateX(4px);
  }
}

/* booking: the arrow gives way to a turning arc */
.btn__spin {
  display: none;
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 30 60;
  animation: spin 0.8s linear infinite;
}

.btn--main.is-busy {
  cursor: progress;
}

.btn--main.is-busy .btn__arrow {
  display: none;
}

.btn--main.is-busy .btn__spin {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* while the card changes height, what is outside it is cut */
.book__form.is-moving {
  overflow: hidden;
}

@media (max-width: 480px) {
  .book__form {
    padding: 22px 18px 18px;
  }

  .panel__title {
    font-size: 21px;
  }

  .chip__face,
  .chip__fill {
    padding: 9px 13px;
    font-size: 14px;
  }
}
