/* Shared rhythm for the existing rental and service dialogs. */
.booking-dialog,
.service-form-dialog {
  --form-border: #dcdedb;
  --form-muted: #666b65;
}

.booking-field > label,
.service-form-question,
.service-form-field label {
  margin: 0;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  line-height: 22px;
  letter-spacing: 0;
}

.booking-field,
.service-form-field { gap: 8px; min-width: 0; }

.booking-field input[type="text"]:not(.phone-country-field__input),
.booking-field input[type="tel"]:not(.phone-country-field__input),
.service-form-input:not(.phone-country-field__input) {
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--form-border);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
}

.booking-dialog .phone-country-field,
.service-form-dialog .phone-country-field {
  --phone-field-height: 50px;
  --phone-field-radius: 10px;
  --phone-field-border: var(--form-border);
  --phone-field-background: #fff;
}

:is(.booking-field input, .service-form-input):not(.phone-country-field__input):focus {
  border-color: var(--lime);
}
:is(.booking-field input, .service-form-input):not(.phone-country-field__input):focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}
.booking-dialog .booking-field input.is-invalid:not(.phone-country-field__input),
.service-form-dialog .service-form-input.is-invalid:not(.phone-country-field__input) {
  border-color: #d92d20;
}

.booking-option-card-inner,
.booking-contact-card-inner,
.service-form-option-inner,
.service-form-options.is-bike .service-form-option-inner {
  border-width: 1px;
  border-color: var(--form-border);
  border-radius: 10px;
  background-color: #fff;
}

.booking-option-card input[type="radio"]:checked ~ .booking-option-card-inner,
.booking-contact-card input[type="radio"]:checked ~ .booking-contact-card-inner,
.service-form-option input:checked + .service-form-option-inner {
  border-color: var(--lime);
  background-color: rgb(var(--lime-rgb) / .07);
  color: #111;
}

.booking-option-card input[type="radio"]:checked ~ .booking-option-card-inner .booking-option-card-txt,
.booking-option-card input[type="radio"]:checked ~ .booking-option-card-inner .booking-option-card-price,
.booking-contact-card input[type="radio"]:checked ~ .booking-contact-card-inner .contact-label-txt,
.service-form-option input:checked + .service-form-option-inner .service-form-option-copy {
  color: #111;
}

.booking-field-hint,
.service-form-hint { color: var(--form-muted); font-size: 12px; line-height: 18px; font-weight: 400; }
.booking-agreement-text,
.service-form-agreement { font-size: 13px; line-height: 20px; font-weight: 400; }
.booking-checkbox-label,
.service-form-agreement { min-height: 44px; align-items: start; }
.booking-checkbox-label { display: flex; }
.service-form-error:empty,
.service-form-status:empty,
.turnstile-slot:empty { display: none; }

.booking-step-nav .dialog-submit-new.booking-btn-submit,
.service-form-submit {
  flex-shrink: 0;
  min-height: 52px;
  height: 52px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 800;
  line-height: 24px;
  letter-spacing: 0;
  box-shadow: none;
}
.booking-step-nav { margin-top: 0; }
.booking-dialog .phone-country-field[data-phone-country-field] > .phone-country-field__input,
.service-form-dialog .phone-country-field[data-phone-country-field] > .phone-country-field__input {
  padding: 0 14px;
  min-height: var(--phone-field-height);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.booking-dialog-container .booking-desktop-close,
.service-form-close { width: 44px; height: 44px; top: 12px; right: 12px; }

.booking-battery-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-height: 52px;
  padding-block: 4px;
  color: #111;
  cursor: pointer;
}
.booking-battery-option input { position: relative; width: 22px; height: 22px; margin: 0; appearance: none; border: 1px solid #c8cbc7; border-radius: 5px; background: #fff; cursor: inherit; }
.booking-battery-option input:checked { border-color: var(--lime); background: var(--lime); }
.booking-battery-option input:checked::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #111; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.booking-battery-option input:disabled { background: #f5f6f4; }
.booking-battery-option input:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.booking-battery-copy { display: grid; gap: 2px; min-width: 0; }
.booking-battery-title { font-size: 14px; font-weight: 600; line-height: 20px; }
.booking-battery-hint { color: var(--form-muted); font-size: 12px; line-height: 18px; }
.booking-battery-price { white-space: nowrap; font-size: 13px; font-weight: 600; line-height: 20px; }
.booking-battery-price:empty { display: none; }
.booking-battery-option.is-unavailable { cursor: default; }
.booking-battery-option.is-unavailable .booking-battery-title { color: var(--form-muted); }

@media (min-width: 769px) {
  .booking-dialog-right,
  .service-form-body { padding: 48px 36px 28px; }
  .booking-form-new { display: flex; flex-direction: column; flex: 1; margin: 0; gap: 20px; }
  .booking-step[data-step="3"] { margin-top: auto; }
  .service-form-submit { margin-top: auto; }
  .booking-step,
  .service-form-fields { gap: 20px; }
  .booking-period-grid,
  .booking-contact-grid,
  .service-form-options,
  .service-form-options.is-bike { gap: 12px; }
  .service-form-options.is-bike { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .booking-option-card-inner { height: 64px; }
  .booking-option-card-txt { font-size: 18px; line-height: 24px; font-weight: 700; }
  .booking-option-card-price { font-size: 13px; line-height: 20px; }
  .booking-contact-card-inner { height: 48px; gap: 8px; padding-inline: 8px; }
  .contact-label-txt { font-size: 13px; }
  .service-form-body { justify-content: flex-start; gap: 20px; }
  .service-form-question { margin-bottom: 8px; }
  .service-form-question + .service-form-options { margin-bottom: 20px; }
  .service-form-options.is-bike { margin-bottom: 0; }
  .service-form-option-inner,
  .service-form-options.is-bike .service-form-option-inner { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding-inline: 12px; }
  .service-form-logo { margin-bottom: 0; }
  .service-form-hero > h2,
  .booking-left-title { margin: 20px 0 8px; line-height: 1.15; letter-spacing: -.02em; }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .booking-dialog-container,
  .service-request-form { grid-template-columns: minmax(240px, 34%) minmax(0, 1fr); }
  .booking-dialog-right,
  .service-form-body { padding-inline: 24px; }
  .booking-dialog-left,
  .service-form-hero { padding-inline: 20px; }
  .service-form-options.is-repair { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-form-options.is-bike .service-form-option-inner { min-height: 60px; grid-template-columns: 24px minmax(0, 1fr); justify-items: stretch; gap: 8px; padding: 0 10px; text-align: left; }
  .service-form-option-copy { overflow-wrap: break-word; }
  .booking-contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .booking-contact-card-inner { gap: 6px; padding-inline: 6px; }
  .contact-label-txt { font-size: 12px; }
  .contact-icon { width: 16px; height: 16px; }
}

@media (max-width: 768px) {
  .booking-dialog,
  .service-form-dialog { width: min(420px, calc(100vw - 28px)); border-radius: 16px; }
  .booking-dialog-left,
  .service-form-hero { height: 140px; min-height: 140px; padding: 16px 20px; }
  .service-form-hero { display: flex; flex-direction: column; justify-content: flex-end; }
  .booking-left-logo,
  .service-form-logo { position: absolute; top: 16px; left: 20px; margin: 0; }
  .service-form-logo { width: 86px; }
  .booking-left-title,
  .service-form-hero h2 { position: relative; inset: auto; max-width: none; margin: 0 0 4px; font-size: 22px; line-height: 26px; letter-spacing: -.02em; }
  .booking-left-subtitle,
  .service-form-hero p { position: relative; inset: auto; max-width: 280px; min-height: 36px; margin: 0; font-size: 13px; line-height: 18px; }
  .booking-dialog-right,
  .service-form-body { padding: 20px; }
  .booking-form-new,
  .booking-form-new .booking-step { gap: 14px; }
  .booking-option-card-inner { height: 56px; }
  .booking-field input[type="text"]:not(.phone-country-field__input),
  .booking-field input[type="tel"]:not(.phone-country-field__input),
  .service-form-input:not(.phone-country-field__input) { min-height: 48px; padding-block: 10px; }
  .booking-dialog .phone-country-field,
  .service-form-dialog .phone-country-field { --phone-field-height: 46px; }
  .service-request-form { display: flex; flex-direction: column; overflow: hidden; height: min(648px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); border-radius: 16px; }
  .service-form-dialog { max-height: calc(100dvh - 32px); }
  .service-form-body { height: auto; min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
  .service-form-question { margin-bottom: 8px; }
  .service-form-options { gap: 12px; }
  .service-form-question + .service-form-options { margin-bottom: 16px; }
  .service-form-options.is-bike { margin-bottom: 12px; }
  .service-form-option-inner { min-height: 68px; grid-template-columns: 24px minmax(0, 1fr); padding-inline: 10px; }
  .service-form-fields { gap: 16px; }
  .service-form-selected { margin: 0 0 12px; padding: 12px; gap: 8px; }
  .service-form-hint,
  .service-form-error { font-size: 12px; line-height: 18px; }
  .service-form-progress { margin-top: 8px; }
  .service-form-step-count { margin-block: 8px; font-size: 11px; line-height: 14px; }
  .booking-battery-option { gap: 10px; }
}

/* Phone dialogs prioritise the form over decorative media. The title remains
   visible for orientation, while the photo treatment stays on tablets and up. */
@media (max-width: 480px) {
  .booking-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .booking-dialog-container {
    max-height: calc(100dvh - 16px);
  }

  .booking-dialog-left {
    min-height: 62px;
    height: 62px;
    justify-content: center;
    padding: 12px 64px 12px 16px;
    border-block-end: 1px solid var(--form-border);
    background: #fff;
  }

  .booking-left-logo,
  .booking-left-subtitle {
    display: none;
  }

  .booking-left-title {
    max-width: none;
    margin: 0;
    color: #111;
    font-size: 20px;
    line-height: 24px;
    letter-spacing: -.02em;
    text-wrap: pretty;
  }

  .booking-dialog-container .booking-desktop-close {
    top: 9px;
    right: 10px;
    color: #111;
    background: #f0f1ef;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .booking-dialog-right {
    flex: 1 1 auto;
    padding: 12px 16px max(14px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 12px 68px;
    -webkit-overflow-scrolling: touch;
  }

  .booking-form-new,
  .booking-form-new .booking-step {
    gap: 10px;
  }

  .booking-field {
    gap: 6px;
  }

  .booking-option-card-inner {
    height: 50px;
  }

  .booking-battery-option {
    min-height: 44px;
    padding-block: 2px;
  }

  .booking-agreement-text {
    font-size: 12px;
    line-height: 17px;
  }

  .booking-step-nav {
    gap: 8px;
  }

  .booking-step-nav .dialog-submit-new.booking-btn-submit {
    min-height: 48px;
    height: 48px;
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .booking-dialog-right {
    padding-inline: 12px;
  }

  .booking-period-grid,
  .booking-contact-grid {
    gap: 8px;
  }

  .booking-option-card-txt {
    font-size: 14px;
  }

  .booking-option-card-price {
    font-size: 11px;
  }
}
