/*
  Booking pages, laid out like Calendly:
    type page → card with info column | month calendar | times of the chosen day
    form      → card with info column (incl. chosen time) | details form
    done      → confirmation card
  Fast and clear: only short, subtle transitions (switched off with "reduce motion").
*/

body {
  background-image: var(--hero-bg);
  background-repeat: no-repeat;
}

.js .no-js-only,
html:not(.js) .js-only {
  display: none !important;
}

/* --- Top bar and footer ------------------------------------------------------------ */
.topbar__inner,
.footbar {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-3);
}

.footbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-4) var(--space-5);
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- Page frames ------------------------------------------------------------------------ */
.page {
  width: 100%;
  padding: clamp(0.5rem, 3vw, 2.5rem) clamp(0.75rem, 4vw, 2rem) var(--space-5);
}

.page--booking {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Simple pages (privacy, messages, setup): one white sheet */
.page--sheet {
  max-width: 48rem;
  margin: clamp(0.5rem, 3vw, 2.5rem) auto var(--space-5);
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.page--sheet h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
}

.summary {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-3);
  margin-block: var(--space-4);
}

.notice {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: var(--space-3);
  max-width: none;
}

.flash {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto var(--space-3);
}

.flash__item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-2) var(--space-3);
  max-width: none;
  margin: 0 0 var(--space-2);
}

.flash__item--error {
  border-left-color: var(--danger);
}

.flash__item--success {
  border-left-color: var(--success);
}

/* --- Shared bits ------------------------------------------------------------------------ */
.icon {
  flex: none;
}

.avatar {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #8ca8ff 0%, var(--accent) 55%, #ff9cc2 100%);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px -10px rgba(91, 63, 214, 0.6);
}

.avatar--large {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 1.6rem;
  margin-inline: auto;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background-color 0.15s;
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-btn.is-disabled {
  color: var(--disabled);
  cursor: default;
  background: none;
}

.pane-title {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

.btn--small {
  min-height: 2.2rem;
  padding: 0.3rem 0.9rem;
  font-size: 0.9rem;
  box-shadow: none;
}

.btn--block {
  min-width: 12rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-4);
}

.actions--center {
  justify-content: center;
}

.below-card {
  margin-top: var(--space-3);
}

.below-card a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* --- Small colour dot (confirmation page) -------------------------------------------------- */
.type-dot {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  border-radius: 50%;
  background: var(--type, var(--accent));
}

/* --- Booking card: info column + pane ---------------------------------------------------- */
.booking-card {
  width: 100%;
  max-width: 62rem;
  min-height: 34rem;
  display: grid;
  grid-template-columns: minmax(15rem, 21rem) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: max-width 0.35s var(--ease);
  animation: rise 0.4s var(--ease) both;
}

/* Wider as soon as a day is chosen, to make room for the times column */
.booking-card--wide {
  max-width: 76rem;
}

.info {
  padding: clamp(1.5rem, 3vw, 2rem);
  border-right: 1px solid var(--line);
}

.info__owner {
  color: var(--muted);
  font-weight: 600;
  margin: var(--space-3) 0 var(--space-1);
}

.info__title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-bottom: var(--space-4);
}

.info__text {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: var(--space-4);
}

.meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

.meta li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.meta .icon {
  margin-top: 0.15rem;
}

.meta__strong {
  color: var(--text);
  font-weight: 650;
}

.meta--box {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-4) auto;
  max-width: 30rem;
}

/* Duration switch (15 / 30 Min.) */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.segmented__item {
  padding: 0.15rem 0.7rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

.segmented__item:hover {
  border-color: var(--accent);
}

.segmented__item.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --- Picker: month calendar + times ---------------------------------------------------------- */
.picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  padding: clamp(1.5rem, 3vw, 2rem);
}

.picker--with-times {
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem);
}

.month {
  max-width: 26rem;
}

.month__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.month__name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
  text-align: center;
}

.month__weekdays,
.month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  text-align: center;
}

.month__weekdays {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.day {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 3rem;
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  color: #77749a;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.day.is-available {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  transition:
    background-color 0.15s,
    color 0.15s;
}

.day.is-available:hover {
  background: #ddd4ff;
  color: var(--accent-strong);
}

.day.is-selected,
.day.is-selected:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* small dot under today's date */
.day.is-today::after {
  content: "";
  position: absolute;
  bottom: 14%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.month__empty {
  margin-top: var(--space-3);
  font-size: 0.92rem;
  color: var(--muted);
}

.tz-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  font-size: 0.92rem;
}

.tz-form__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.tz-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
  color: var(--accent);
  font-weight: 600;
}

.tz-select select {
  width: auto;
  max-width: 100%;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
}

/* With JS: the select is invisible but still clickable/focusable over the label */
.js .tz-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.js .tz-select:has(select:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.tz-select .icon {
  width: 16px;
  height: 16px;
}

.picker__times {
  animation: slide-in 0.3s var(--ease) both;
}

.times__day {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 2.6rem 0 var(--space-3);
}

.times {
  list-style: none;
  margin: 0;
  padding: 0 0.25rem 0 0;
  display: grid;
  gap: 0.6rem;
  max-height: 27rem;
  overflow-y: auto;
}

/* One time: a single button; once chosen it splits into "time | Weiter" */
.slot {
  display: grid;
  grid-template-columns: 1fr 0fr;
  transition:
    grid-template-columns 0.25s var(--ease),
    gap 0.25s var(--ease);
}

.slot.is-active {
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.slot__time,
.slot__next {
  min-height: 3.1rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  cursor: pointer;
}

.slot__time {
  display: grid;
  place-items: center;
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--surface);
  color: var(--accent);
  transition:
    border-color 0.15s,
    background-color 0.15s,
    color 0.15s;
}

.slot__time:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.slot.is-active .slot__time {
  background: #55526f;
  border-color: #55526f;
  color: #ffffff;
  box-shadow: none;
}

.slot__next {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  opacity: 0;
  visibility: hidden; /* also hidden from screen readers until chosen */
  transition:
    opacity 0.2s,
    visibility 0.2s;
}

.slot.is-active .slot__next {
  opacity: 1;
  visibility: visible;
}

.slot__next:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

/* Without JavaScript a time links directly to the form (booking) or reloads the
   page with that time chosen (rescheduling), so only the chosen slot shows the button */
html:not(.js) .slot:not(.is-active) .slot__next {
  display: none;
}

/* --- Details form ----------------------------------------------------------------------------- */
.details {
  padding: clamp(1.5rem, 3vw, 2rem);
}

.form {
  display: grid;
  gap: var(--space-4);
  max-width: 32rem;
}

.form .btn {
  justify-self: start;
}

.field label,
.field legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  padding: 0;
}

fieldset.field {
  border: 0;
  padding: 0;
  margin: 0;
}

.req {
  color: var(--danger);
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #c9c3ec;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}

.options {
  display: grid;
  gap: 0.5rem;
}

.option {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-weight: 500 !important;
  cursor: pointer;
  margin: 0 !important;
}

.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option input {
  accent-color: var(--accent);
  width: 1.1rem;
  height: 1.1rem;
}

/* "Gäste hinzufügen": the field opens on click (always open without JavaScript) */
.js .field--guests:not(.is-open) .field__body {
  display: none;
}

.js .field--guests.is-open [data-guests-toggle] {
  display: none;
}

.field__help {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.field__error,
.errorlist {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

/* Honeypot field: invisible for people, still present for bots */
.field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.status--cancelled,
.status--declined {
  background: #fbe9ee;
  color: var(--danger);
}

/* --- Confirmation ------------------------------------------------------------------------------ */
.confirm-card {
  width: 100%;
  max-width: 40rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(1.5rem, 5vw, 3rem);
  animation: rise 0.4s var(--ease) both;
}

.confirm-card .avatar {
  margin-inline: auto;
}

.confirm-card__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: var(--space-4) 0 var(--space-2);
}

.confirm-card__lead {
  color: var(--muted);
  margin-inline: auto;
}

.check {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
  animation: pop 0.45s var(--ease) 0.15s both;
}

.check--pending {
  background: var(--accent);
}

.check .icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* --- Legacy blocks on simple pages ----------------------------------------------------------- */
.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.prose h2 {
  font-size: 1.3rem;
  margin-top: var(--space-4);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  word-break: break-all;
}

/* --- Motion -------------------------------------------------------------------------------------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

/* --- Small screens: everything in one column ----------------------------------------------------- */
@media (max-width: 52rem) {
  .booking-card,
  .booking-card--wide {
    grid-template-columns: minmax(0, 1fr);
    max-width: 36rem;
    min-height: 0;
  }

  .info {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .picker--with-times {
    grid-template-columns: minmax(0, 1fr);
  }

  .month {
    max-width: none;
  }

  .times__day {
    margin-top: 0;
  }

  .times {
    max-height: none;
    overflow: visible;
  }
}
