/* =========================================================
   Key Briana Cleaning Services
   booking.css — Formulario de citas en 4 pasos
   Usa los tokens definidos en style.css
   ========================================================= */

.booking {
  background: var(--gray-light);
}

.bk {
  max-width: 900px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 48px 40px;
}

/* ---------- Barra de progreso ---------- */
.bk__steps {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  counter-reset: bkstep;
}

.bk__step {
  flex: 1;
  position: relative;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding-top: 44px;
  transition: color 0.3s var(--ease);
}

.bk__step::before {
  counter-increment: bkstep;
  content: counter(bkstep);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid #dde3ed;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease);
  z-index: 2;
}

/* Línea que une los pasos */
.bk__step::after {
  content: "";
  position: absolute;
  top: 17px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #dde3ed;
  z-index: 1;
  transition: background 0.3s var(--ease);
}

.bk__step:first-child::after {
  display: none;
}

.bk__step.is-active {
  color: var(--blue);
}

.bk__step.is-active::before {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  box-shadow: 0 0 0 5px rgba(14, 74, 146, 0.12);
}

.bk__step.is-done {
  color: var(--blue-dark);
  cursor: pointer;
}

.bk__step.is-done::before {
  content: "✓";
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--white);
}

.bk__step.is-done::after,
.bk__step.is-active::after {
  background: var(--blue);
}

/* ---------- Paneles ---------- */
.bk__panel {
  display: none;
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}

.bk__panel.is-active {
  display: block;
  animation: bkFade 0.35s var(--ease);
}

@keyframes bkFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bk__legend {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 6px;
  padding: 0;
}

.bk__hint {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 22px;
}

/* ---------- Tarjetas de servicio ---------- */
.bk__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0 28px;
}

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

.bk__card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bk__card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px 12px;
  border: 2px solid #e6ebf3;
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: all 0.25s var(--ease);
  height: 100%;
}

.bk__card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease);
}

.bk__card-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--blue);
  transition: fill 0.25s var(--ease);
}

.bk__card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.bk__card:hover .bk__card-inner {
  border-color: var(--blue-light);
  transform: translateY(-2px);
}

.bk__card input:checked + .bk__card-inner {
  border-color: var(--blue);
  background: rgba(14, 74, 146, 0.04);
  box-shadow: 0 8px 24px rgba(14, 74, 146, 0.12);
}

.bk__card input:checked + .bk__card-inner .bk__card-icon {
  background: var(--blue);
}

.bk__card input:checked + .bk__card-inner .bk__card-icon svg {
  fill: var(--white);
}

.bk__card input:focus-visible + .bk__card-inner {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
}

/* ---------- Píldoras (frecuencia / horario) ---------- */
.bk__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 8px;
}

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

.bk__pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bk__pill span {
  display: inline-block;
  padding: 11px 20px;
  border: 2px solid #e6ebf3;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}

.bk__pill:hover span {
  border-color: var(--blue-light);
  color: var(--blue);
}

.bk__pill input:checked + span {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.bk__pill input:focus-visible + span {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
}

/* ---------- Campos ---------- */
.bk__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0 8px;
}

.bk__field--full {
  grid-column: 1 / -1;
}

.bk__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.bk__req {
  color: #d94141;
}

.bk__opt {
  font-weight: 500;
  color: var(--text-soft);
}

.bk__input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #dde3ed;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.bk__input::placeholder {
  color: #a3acbb;
}

.bk__input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(14, 74, 146, 0.12);
}

.bk__input.has-error {
  border-color: #d94141;
  background: #fffafa;
}

.bk__input.has-error:focus {
  box-shadow: 0 0 0 3px rgba(217, 65, 65, 0.14);
}

textarea.bk__input {
  resize: vertical;
  min-height: 92px;
}

select.bk__input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235b6472'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

.bk__error {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d94141;
}

/* ---------- Trampa anti-spam ---------- */
.bk__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Aviso legal ---------- */
.bk__legal {
  font-size: 12.5px;
  color: var(--text-soft);
  margin: 16px 0 0;
  line-height: 1.5;
}

/* ---------- Alerta de error general ---------- */
.bk__alert {
  background: #fdecec;
  border-left: 4px solid #d94141;
  color: #a02020;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin: 18px 0 0;
}

/* ---------- Navegación ---------- */
.bk__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #eef1f6;
}

.bk__submit {
  position: relative;
}

.bk__spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: bkSpin 0.7s linear infinite;
  margin-left: 10px;
}

.is-sending .bk__spinner {
  display: inline-block;
}

.is-sending .bk__submit {
  opacity: 0.75;
  pointer-events: none;
}

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

/* ---------- Pantalla de éxito ---------- */
.bk__success {
  text-align: center;
  padding: 26px 10px 14px;
  animation: bkFade 0.4s var(--ease);
}

.bk__success-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: rgba(46, 170, 106, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bk__success-icon svg {
  width: 38px;
  height: 38px;
  fill: #2eaa6a;
}

.bk__success h3 {
  font-family: var(--font-head);
  font-size: 26px;
  color: var(--blue-dark);
  margin-bottom: 12px;
}

.bk__success-text {
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto 18px;
  line-height: 1.65;
}

.bk__folio {
  display: inline-block;
  background: var(--gray-light);
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 26px;
}

.bk__folio strong {
  color: var(--blue-dark);
  letter-spacing: 0.04em;
}

.bk__success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  .bk__panel.is-active,
  .bk__success {
    animation: none;
  }
  .bk__card-inner,
  .bk__pill span,
  .bk__input {
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .bk { padding: 36px 32px 32px; }
  .bk__cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .bk {
    padding: 28px 20px 26px;
    border-radius: var(--radius);
  }

  .bk__steps { margin-bottom: 28px; }

  .bk__step {
    font-size: 0;
    padding-top: 38px;
  }

  .bk__step::before {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .bk__step::after { top: 15px; }

  .bk__step.is-active {
    font-size: 12px;
  }

  .bk__legend { font-size: 19px; }

  .bk__cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .bk__card-inner { padding: 16px 8px; }
  .bk__card-title { font-size: 13px; }

  .bk__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .bk__pills { gap: 8px; }
  .bk__pill span {
    padding: 10px 16px;
    font-size: 13px;
  }

  .bk__nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .bk__nav .btn { width: 100%; justify-content: center; }
  .bk__nav > span { display: none; }

  .bk__success-actions { flex-direction: column; }
  .bk__success-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .bk__cards { grid-template-columns: 1fr; }
  .bk__card-inner {
    flex-direction: row;
    text-align: left;
    padding: 13px 14px;
  }
}

/* ---------- Aviso de zona de servicio ---------- */
.bk__zona {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(14, 74, 146, 0.06);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  margin-bottom: 20px;
  color: var(--blue-dark);
  font-weight: 600;
}

.bk__zona svg {
  width: 18px;
  height: 18px;
  fill: var(--blue);
  flex-shrink: 0;
}
