/* Customer booking: the backoffice look (backoffice/static/css/app.css), made for customers. */
:root {
  --app-primary: #7a2e5a;
  --app-primary-dark: #5e2245;
  --app-primary-soft: #f3e6ee;
  --app-bg: #f6f2f4;
  --free: #2e9d57;
  --free-dark: #217a42;
  --free-soft: #e3f4e9;
  --discount: #f08a1c;
  --discount-dark: #c96d0c;
  --discount-soft: #fdeedd;
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: 122, 46, 90;
  --bs-link-color: var(--app-primary);
  --bs-link-color-rgb: 122, 46, 90;
  --bs-link-hover-color: var(--app-primary-dark);
  --bs-link-hover-color-rgb: 94, 34, 69;
}

html, body {
  background: var(--app-bg);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark);
  --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: var(--app-primary-dark);
  --bs-btn-active-border-color: var(--app-primary-dark);
  --bs-btn-disabled-bg: var(--app-primary);
  --bs-btn-disabled-border-color: var(--app-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary);
  --bs-btn-hover-border-color: var(--app-primary);
  --bs-btn-active-bg: var(--app-primary-dark);
  --bs-btn-active-border-color: var(--app-primary-dark);
  --bs-btn-disabled-color: var(--app-primary);
  --bs-btn-disabled-border-color: var(--app-primary);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #c08aa9;
  box-shadow: 0 0 0 0.25rem rgba(122, 46, 90, 0.2);
}

.form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.bt-container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
}

/* ---------- Header: the salong's name ---------- */
.bt-header {
  background: linear-gradient(160deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
  color: #fff;
  padding: calc(0.9rem + env(safe-area-inset-top)) 0 0.9rem;
}

.bt-salong {
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.bt-salong:hover {
  color: #fff;
  text-decoration: underline;
}

.bt-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

/* Language switch (salong property Language) */
.bt-languages {
  display: flex;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.bt-languages a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid transparent;
}

.bt-languages a:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.bt-languages a.active {
  color: var(--app-primary);
  background: #fff;
  font-weight: 600;
}

.bt-main {
  padding-top: 1rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

/* ---------- Progress ---------- */
.bt-progress {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.8rem;
}

.bt-progress li {
  flex: 1 1 0;
  counter-increment: step;
  text-align: center;
  color: var(--bs-secondary-color);
  border-top: 4px solid #ddd;
  padding-top: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-progress li::before {
  content: counter(step) ". ";
}

.bt-progress li.done {
  border-top-color: #c08aa9;
  color: var(--bs-body-color);
}

.bt-progress li.current {
  border-top-color: var(--app-primary);
  color: var(--app-primary);
  font-weight: 600;
}

/* ---------- Steps ---------- */
.bt-card {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
}

.bt-card > .card-body,
.bt-step-body {
  padding: 1.1rem;
}

.bt-narrow {
  max-width: 440px;
  margin: 1rem auto;
}

.bt-step {
  scroll-margin-top: 0.75rem;
}

.bt-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1.1rem 0;
}

.bt-step-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bt-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--app-primary);
  color: #fff;
  font-size: 0.95rem;
  flex: none;
}

/* A finished step: a check mark instead of the number */
.bt-step.is-done .bt-step-no {
  background: var(--free);
  font-size: 0;
}

.bt-step.is-done .bt-step-no::after {
  content: "\2713";
  font-size: 0.95rem;
}

.bt-step-summary {
  padding: 0.35rem 1.1rem 0.9rem 3.5rem;
  font-size: 0.95rem;
}

.bt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.bt-loading {
  color: var(--bs-secondary-color);
  padding: 1rem 0;
}

.bt-req {
  color: #b02a37;
}

.bt-captcha-img {
  height: 48px;
  width: auto;
  user-select: none;
}

.bt-captcha-input {
  min-width: 0;
}

.bt-subform {
  border-top: 1px solid var(--bs-border-color-translucent);
  padding-top: 1rem;
}

/* ---------- Treatments ---------- */
.bt-user-fixed {
  font-size: 1.05rem;
}

.bt-groups .accordion-button {
  font-weight: 600;
  gap: 0.5rem;
}

.bt-groups .accordion-button:not(.collapsed) {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  box-shadow: none;
}

.bt-groups .accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(122, 46, 90, 0.2);
}

.bt-group-count {
  background: var(--app-primary);
  color: #fff;
  border-radius: 1rem;
  font-size: 0.75rem;
  padding: 0.05rem 0.5rem;
  margin-left: auto;
  margin-right: 0.5rem;
}

.bt-groups .accordion-body {
  padding: 0.25rem 0.75rem;
}

.bt-treatment {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.bt-treatment:last-child {
  border-bottom: 0;
}

.bt-treatment .form-check {
  margin: 0;
  min-height: 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-left: 0;
}

.bt-treatment .form-check-input {
  width: 1.4rem;
  height: 1.4rem;
  margin: 0.05rem 0 0;
  float: none;
  flex: none;
}

.bt-treatment .form-check-label {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.15rem 0.75rem;
  cursor: pointer;
}

.bt-t-name {
  font-weight: 500;
}

.bt-t-meta {
  color: var(--bs-secondary-color);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bt-not-bookable {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.15rem 0.75rem;
  padding-left: 2rem;
  color: var(--bs-secondary-color);
}

.bt-t-note {
  width: 100%;
  font-size: 0.8rem;
  font-style: italic;
}

.bt-info-btn {
  padding: 0 0 0 2rem;
  font-size: 0.85rem;
}

.bt-info {
  margin: 0.25rem 0 0 2rem;
  padding: 0.5rem 0.75rem;
  background: var(--app-bg);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.bt-addons {
  margin: 0.5rem 0 0 2rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--app-primary);
  background: var(--app-primary-soft);
  border-radius: 0 0.5rem 0.5rem 0;
}

.bt-addons-title {
  color: var(--app-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.bt-addon {
  padding: 0.4rem 0;
}

/* ---------- Summary ---------- */
.bt-summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  background: var(--app-bg);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.bt-summary dt {
  font-weight: normal;
  color: var(--bs-secondary-color);
}

.bt-summary dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Calendar ---------- */
.bt-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bt-week-label {
  text-align: center;
  line-height: 1.2;
}

.bt-week-label span {
  display: block;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.bt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.bt-swatch {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border-radius: 0.2em;
  margin-right: 0.35em;
  vertical-align: -0.1em;
}

.bt-swatch-free { background: var(--free); }
.bt-swatch-discount { background: var(--discount); }

/* Mobile: one row per day */
.bt-week {
  display: grid;
  gap: 0.4rem;
}

.bt-day {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.bt-day-head {
  font-weight: 600;
  font-size: 0.9rem;
  padding-top: 0.35rem;
}

.bt-day.today .bt-day-head {
  color: var(--app-primary);
}

.bt-day.empty .bt-day-head {
  color: var(--bs-secondary-color);
  font-weight: normal;
}

.bt-day-times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bt-time {
  border: 0;
  border-radius: 0.5rem;
  background: var(--free);
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.45rem 0.6rem;
  min-width: 4rem;
  line-height: 1.1;
}

.bt-time:hover,
.bt-time:focus-visible {
  background: var(--free-dark);
}

.bt-time.discount {
  background: var(--discount);
}

.bt-time.discount:hover,
.bt-time.discount:focus-visible {
  background: var(--discount-dark);
}

.bt-time:focus-visible {
  outline: 3px solid rgba(122, 46, 90, 0.5);
  outline-offset: 2px;
}

.bt-time.selected {
  box-shadow: 0 0 0 3px var(--app-primary);
}

.bt-no-times {
  color: var(--bs-secondary-color);
  padding-top: 0.35rem;
}

/* Wider screens: monday to sunday side by side */
@media (min-width: 768px) {
  .bt-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .bt-day {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    background: var(--app-bg);
    border-radius: 0.5rem;
    min-height: 6rem;
  }
  .bt-day-head {
    text-align: center;
    padding: 0.45rem 0.1rem;
    border-bottom: 1px solid #e3d7de;
    font-size: 0.82rem;
  }
  .bt-day.today .bt-day-head {
    box-shadow: inset 0 -3px 0 var(--app-primary);
  }
  .bt-day-times {
    flex-direction: column;
    padding: 0 0.3rem 0.4rem;
  }
  .bt-time {
    width: 100%;
    min-width: 0;
    padding: 0.4rem 0.2rem;
  }
  .bt-no-times {
    text-align: center;
    padding: 0;
  }
}

/* ---------- Confirmation ---------- */
.bt-confirmation-head {
  text-align: center;
  background: var(--free-soft);
  border-radius: 0.75rem;
  padding: 1rem;
}

.bt-check {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  background: var(--free);
  color: #fff;
  font-size: 1.6rem;
  line-height: 3rem;
}

.bt-rich {
  overflow-wrap: anywhere;
}

/* Villkor, under "obligatoriskt fält" */
.bt-terms {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--app-bg);
  border-radius: 0.75rem;
}

.bt-terms .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
}

.bt-terms .form-check-label {
  padding-left: 0.35rem;
}

/* Kontrollfråga above "Bekräfta och boka" */
.bt-book-captcha {
  margin-top: 1rem;
}

.bt-book-captcha [data-captcha] {
  margin-bottom: 0 !important;
}

/* Step 3: återbudslistan */
.bt-waitlist {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px dashed var(--app-primary);
  border-radius: 0.75rem;
  background: var(--app-bg);
}

.bt-waitlist-info p {
  font-size: 0.95rem;
}

/* Bottom link */
.bt-privacy {
  font-style: italic;
  font-size: 0.85rem;
  text-align: center;
  margin: 1.5rem 0 0;
}

/* Honeypot, hidden from people */
.bt-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Print: only the confirmation ---------- */
@media print {
  body.bt-printing * {
    visibility: hidden;
  }
  body.bt-printing .bt-header,
  body.bt-printing .bt-header *,
  body.bt-printing #confirmation,
  body.bt-printing #confirmation * {
    visibility: visible;
  }
  body.bt-printing .bt-no-print,
  body.bt-printing .bt-no-print * {
    display: none !important;
  }
  body.bt-printing #confirmation {
    position: absolute;
    left: 0;
    top: 4rem;
    width: 100%;
  }
  .bt-header {
    background: none !important;
    color: #000 !important;
  }
  .bt-salong {
    color: #000 !important;
  }
}
