/* ==========================================================================
   Repair booking wizard — builds on Templates/templates.css
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Layout — wizard beside a sticky live summary
   -------------------------------------------------------------------------- */
.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
  align-items: start;
}

.booking-main {
  padding: clamp(1.35rem, 3vw, 2.35rem);
  overflow: hidden;
}

.summary-rail {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  padding: clamp(1.35rem, 3vw, 1.9rem);
}

@media (max-width: 1000px) {
  .booking-layout { grid-template-columns: 1fr; }
  .summary-rail { position: static; }
}

/* --------------------------------------------------------------------------
   Stepper
   -------------------------------------------------------------------------- */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.stepper li {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
  position: relative;
  min-width: 0;
}

/* Connector line between the dots */
.stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background-color var(--dur) var(--ease);
}

.stepper li.is-done::after { background: var(--brand-500); }

.step-dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: all var(--dur) var(--ease);
}

.step-dot .material-icons { font-size: 18px; }

.stepper li.is-active .step-dot {
  background: linear-gradient(135deg, var(--brand-500), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 5px var(--brand-soft);
}

.stepper li.is-done .step-dot {
  background: var(--brand-soft);
  border-color: var(--brand-500);
  color: var(--brand-300);
}

.step-name {
  font-family: var(--font-primary);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.3;
}

.stepper li.is-active .step-name { color: var(--text); }

@media (max-width: 640px) {
  .step-name { display: none; }
  .stepper li:not(:last-child)::after { left: calc(50% + 18px); right: calc(-50% + 18px); }
}

/* Thin progress bar under the stepper */
.progress-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 1.85rem;
}

.progress-fill {
  height: 100%;
  width: 20%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-400));
  transition: width 0.5s var(--ease);
}

/* --------------------------------------------------------------------------
   Step panels
   -------------------------------------------------------------------------- */
.step-panel { display: none; }

.step-panel.is-active {
  display: block;
  animation: panelIn 0.4s var(--ease) both;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.step-head { margin-bottom: 1.6rem; }

.step-head h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  margin-bottom: 0.35rem;
}

.step-head p {
  font-size: 0.92rem;
  margin: 0;
}

.step-block { margin-bottom: 1.6rem; }
.step-block:last-child { margin-bottom: 0; }

.block-label {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.block-label .opt {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Choice cards (radio) — device category, service method, urgency
   -------------------------------------------------------------------------- */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
}

.choice-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.choice {
  display: block;
  cursor: pointer;
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choice-body {
  display: grid;
  gap: 0.4rem;
  height: 100%;
  padding: 1.05rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.028);
  transition: all var(--dur) var(--ease);
}

.choice-body .material-icons {
  font-size: 26px;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}

.choice-title {
  font-family: var(--font-primary);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.choice-desc {
  font-size: 0.79rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.choice:hover .choice-body {
  border-color: rgba(75, 194, 58, 0.45);
  background: rgba(58, 166, 43, 0.05);
  transform: translateY(-2px);
}

.choice input:checked + .choice-body {
  border-color: var(--brand-400);
  background: rgba(58, 166, 43, 0.12);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.choice input:checked + .choice-body .material-icons { color: var(--brand-300); }

.choice input:focus-visible + .choice-body {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
}

/* Tick badge on the selected card */
.choice input:checked + .choice-body::after {
  content: "check";
  font-family: "Material Icons";
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Chips (checkbox / radio pills) — symptoms, accessories, time slots
   -------------------------------------------------------------------------- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip-body {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.028);
  font-family: var(--font-primary);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--dur) var(--ease);
}

.chip:hover .chip-body {
  border-color: rgba(75, 194, 58, 0.45);
  color: var(--text);
}

.chip input:checked + .chip-body {
  border-color: var(--brand-400);
  background: rgba(58, 166, 43, 0.14);
  color: var(--brand-300);
}

.chip input:checked + .chip-body::before {
  content: "check";
  font-family: "Material Icons";
  font-size: 15px;
}

.chip input:focus-visible + .chip-body {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
}

.chip input:disabled + .chip-body {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Touch targets: 44px minimum so chips and choice cards are comfortable
   to tap rather than merely possible to tap. */
@media (pointer: coarse) {
  .chip-body {
    min-height: 44px;
    padding: 0.7rem 1.1rem;
  }

  .choice-body { padding: 1.2rem 1.1rem; }

  .consent { padding: 1.15rem 1.25rem; }

  .consent input { width: 24px; height: 24px; }

  .review-edit {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-inline: 0.25rem;
  }
}

/* --------------------------------------------------------------------------
   Consent checkbox
   -------------------------------------------------------------------------- */
.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.028);
  cursor: pointer;
}

.consent input {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--dur) var(--ease);
}

.consent input:checked {
  background: var(--brand-500);
  border-color: var(--brand-500);
}

.consent input:checked::after {
  content: "check";
  font-family: "Material Icons";
  font-size: 14px;
  color: #fff;
}

.consent span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Only the <label> variant is clickable as a whole; the <div> variant
   delegates that to the label it contains. */
div.consent { cursor: default; }

/* Text column: the label stays clickable, the privacy link sits beneath it. */
.consent-text {
  display: grid;
  gap: 0.4rem;
}

.consent-text label {
  cursor: pointer;
  font-family: var(--font-secondary);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
}

.consent-text > a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  justify-self: start;
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-300);
}

.consent-text > a .material-icons { font-size: 0.95rem; }

.field.has-error .consent { border-color: var(--danger); background: var(--danger-soft); }

/* --------------------------------------------------------------------------
   Conditional blocks (collection address)
   -------------------------------------------------------------------------- */
.conditional { display: none; }
.conditional.is-shown { display: block; animation: panelIn 0.35s var(--ease) both; }

/* --------------------------------------------------------------------------
   Review step
   -------------------------------------------------------------------------- */
.review-group {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.022);
  padding: 1.15rem 1.3rem;
  margin-bottom: 1rem;
}

.review-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.review-group-head h3 {
  font-size: 0.9rem;
  margin: 0;
  color: var(--brand-300);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-edit {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

.review-edit:hover { color: var(--brand-300); }

.review-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.review-list div {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 0.75rem;
  font-size: 0.87rem;
}

.review-list dt { color: var(--text-dim); }
.review-list dd { margin: 0; color: var(--text); word-break: break-word; }

@media (max-width: 520px) {
  .review-list div { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* --------------------------------------------------------------------------
   Wizard footer navigation
   -------------------------------------------------------------------------- */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.wizard-nav .spacer { flex: 1; }

@media (max-width: 520px) {
  .wizard-nav { flex-direction: column-reverse; }
  .wizard-nav .btn { width: 100%; }
  .wizard-nav .spacer { display: none; }
}

/* --------------------------------------------------------------------------
   Live summary rail
   -------------------------------------------------------------------------- */
.summary-rail h3 {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: 1.2rem;
}

.summary-list {
  display: grid;
  gap: 0.9rem;
  margin: 0 0 1.4rem;
}

.summary-list div {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.summary-list div:last-child { border-bottom: 0; padding-bottom: 0; }

.summary-list dt {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.summary-list dd {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.summary-list dd.is-empty {
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
}

.summary-note {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  border: 1px solid rgba(75, 194, 58, 0.22);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.summary-note .material-icons {
  font-size: 1.05rem;
  color: var(--brand-300);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* --------------------------------------------------------------------------
   Success screen
   -------------------------------------------------------------------------- */
.booking-success {
  display: none;
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem);
}

.booking-success.is-shown { display: block; animation: panelIn 0.5s var(--ease) both; }

.success-mark {
  display: inline-grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  background: var(--brand-soft);
  border: 1px solid rgba(75, 194, 58, 0.35);
  color: var(--brand-300);
  animation: markPop 0.55s var(--ease) both 0.15s;
}

.success-mark .material-icons { font-size: 42px; }

@keyframes markPop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.35rem;
  margin-bottom: 1.5rem;
  border-radius: var(--r-pill);
  border: 1px dashed rgba(75, 194, 58, 0.45);
  background: rgba(58, 166, 43, 0.08);
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brand-300);
}

.ref-badge small {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Supporting info band
   -------------------------------------------------------------------------- */
.info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.info-item .material-icons {
  color: var(--brand-400);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.info-item h3 { font-size: 0.98rem; margin-bottom: 0.25rem; }

.info-item p { font-size: 0.87rem; margin: 0; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.022);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}

.faq-item[open] { border-color: rgba(75, 194, 58, 0.32); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "add";
  font-family: "Material Icons";
  font-size: 1.2rem;
  color: var(--brand-300);
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease);
}

.faq-item[open] summary::after {
  content: "remove";
  transform: rotate(180deg);
}

.faq-item .faq-body {
  padding: 0 1.25rem 1.2rem;
  font-size: 0.89rem;
  color: var(--text-muted);
}

.faq-item .faq-body p:last-child { margin-bottom: 0; }
