/* SORAIN – "Book a call" dialog (js/booking.js)
   Same look as the contact form: card, fields (.ct-field / .ct-input / .ct-err) and chips from contact.css.
   Tablet & mobile (≤1000px) adjustments live in mobile.css, section 6.
   Secciones: diálogo · encabezado · estado · pasos · calendario y horarios · datos · confirmación */

/* ---------- diálogo ---------- */
html.bk-open {
  overflow: hidden;
}
.bk {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  overflow: visible;
}
.bk::backdrop {
  background: rgba(4, 4, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.bk-panel {
  position: relative;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 32px;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(106, 59, 214, 0.18), transparent 70%), var(--ct-card, #121132);
  border: 1px solid rgba(185, 150, 245, 0.22);
  border-radius: 16px;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 40px -10px rgba(123, 66, 210, 0.35);
}
.bk[open] .bk-panel {
  animation: bkIn 0.35s var(--ct-ease, ease) both;
}
@keyframes bkIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bk[open] .bk-panel {
    animation: none;
  }
}
.bk-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.bk-x:hover {
  color: #fff;
  border-color: rgba(185, 150, 245, 0.45);
  background: rgba(123, 66, 210, 0.16);
}

/* ---------- encabezado ---------- */
.bk-head {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 0 56px 22px 0;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.bk-head h2 {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.bk-head p {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--mute);
}
.bk-head p b {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- estado (aria-live) ---------- */
.bk-status {
  font-size: 14px;
  color: var(--muted);
}
.bk-status:empty {
  display: none;
}
.bk-status:not(:empty) {
  margin-bottom: 18px;
}
.bk-status.is-error {
  color: #ff8fab;
}
.bk-status a {
  color: var(--lilac);
}

/* los pasos ocultos nunca se muestran, aunque su clase defina display */
.bk [hidden] {
  display: none !important;
}

/* ---------- indicador de pasos ---------- */
.bk-progress,
.bk-facts,
.bk-times {
  padding: 0;
  margin: 0;
}
.bk-progress {
  display: flex;
  gap: 18px;
  margin-left: auto;
  list-style: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--mute);
  white-space: nowrap;
}
.bk-progress li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bk-progress .n {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--mute);
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.bk-progress li[aria-current='step'] {
  color: #fff;
}
.bk-progress li[aria-current='step'] .n {
  background: linear-gradient(135deg, #7b42d2, #475fd2);
  border-color: transparent;
  color: #fff;
}
.bk-progress li.is-done .n {
  background: rgba(123, 66, 210, 0.25);
  border-color: var(--lilac);
  color: var(--lilac);
}
.bk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- paso 1: calendario + horarios ---------- */
.bk-pick {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border: 1px solid rgba(185, 150, 245, 0.18);
  border-radius: 14px;
  overflow: hidden;
}
.bk-cal {
  padding: 26px 24px 24px;
  background:
    radial-gradient(80% 60% at 20% 0%, rgba(123, 66, 210, 0.28), transparent 70%),
    radial-gradient(70% 50% at 100% 100%, rgba(71, 95, 210, 0.22), transparent 70%), #0a0922;
}
.bk-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.bk-cal-head h3 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}
.bk-cal-nav {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    opacity 0.2s;
}
.bk-cal-nav:hover:not([disabled]) {
  background: rgba(123, 66, 210, 0.2);
  border-color: rgba(185, 150, 245, 0.45);
}
.bk-cal-nav[disabled] {
  opacity: 0.25;
  cursor: default;
}
.bk-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.bk-grid th {
  padding-bottom: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bk-grid td {
  padding: 3px 0;
  text-align: center;
}
.bk-date {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}
/* punto: el día tiene horarios */
.bk-date:not([disabled])::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--lilac);
}
.bk-date:not([disabled]) {
  background: rgba(123, 66, 210, 0.16);
}
.bk-date:hover:not([disabled]) {
  background: rgba(123, 66, 210, 0.38);
}
.bk-date[aria-pressed='true'] {
  background: #fff;
  color: #452d8b;
  box-shadow: 0 0 22px -4px rgba(185, 150, 245, 0.9);
}
.bk-date[aria-pressed='true']::after {
  background: #7b42d2;
}
.bk-date[disabled] {
  color: rgba(255, 255, 255, 0.22);
  font-weight: 400;
  cursor: default;
}
.bk-date:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}

.bk-side {
  display: flex;
  flex-direction: column;
  padding: 24px;
  min-width: 0;
}
.bk-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 14px;
  color: var(--muted);
}
.bk-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bk-facts .material-symbols-outlined {
  font-size: 20px;
  color: var(--lilac);
}
.bk-q {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}
.bk-for {
  margin: 4px 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.bk-for b {
  color: #fff;
  font-weight: 600;
}
.bk-tz {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.bk-tz .material-symbols-outlined {
  position: absolute;
  left: 12px;
  font-size: 18px;
  color: var(--lilac);
  pointer-events: none;
}
.bk-tz select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 36px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ct-field, #0b0a24)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b996f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lilac);
  text-overflow: ellipsis;
  cursor: pointer;
}
.bk-tz select:hover {
  border-color: rgba(185, 150, 245, 0.4);
}
.bk-tz select:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}
.bk-tz option {
  background: #121132;
  color: var(--ink);
}
.bk-times {
  display: grid;
  gap: 8px;
  list-style: none;
  max-height: 268px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  margin: 0 -4px 14px -2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 150, 245, 0.3) transparent;
}
.bk-time {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(185, 150, 245, 0.3);
  border-radius: 10px;
  background: var(--ct-field, #0b0a24);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.bk-time:hover,
.bk-time.is-chosen {
  background: linear-gradient(90deg, #8b3dd9, #466bdb);
  border-color: transparent;
  box-shadow: 0 8px 18px -6px rgba(123, 66, 210, 0.7);
}
.bk-time:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}
.bk-side .bk-note {
  margin-top: auto;
}

/* esqueleto mientras carga */
.bk.is-loading .bk-days,
.bk.is-loading .bk-times:empty::before {
  opacity: 0.35;
}
.bk.is-loading .bk-times:empty::before {
  content: '';
  display: block;
  height: 132px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(185, 150, 245, 0.12), rgba(255, 255, 255, 0.03));
  background-size: 200% 100%;
  animation: bkShimmer 1.2s linear infinite;
}
@keyframes bkShimmer {
  to {
    background-position: -200% 0;
  }
}

.bk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px 24px;
  margin-top: 8px;
}
.bk .btn {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.bk .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}
.bk-note {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--mute);
}

/* ---------- paso 2: datos ---------- */
.bk-picked {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(123, 66, 210, 0.14);
  border: 1px solid rgba(185, 150, 245, 0.28);
  font-size: 15px;
  color: #fff;
}
.bk-picked .material-symbols-outlined {
  color: var(--lilac);
}
.bk-picked [data-bk-picked] {
  flex: 1;
  min-width: 0;
}
.bk-picked [data-bk-picked]::first-letter {
  text-transform: uppercase;
}
.bk-link {
  border: 0;
  background: none;
  padding: 4px 2px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--lilac);
  cursor: pointer;
}
.bk-link:hover {
  text-decoration: underline;
}
.bk .ct-field {
  margin-bottom: 18px;
}
.bk textarea.ct-input {
  min-height: 96px;
}
.bk .opt {
  font-weight: 400;
  color: var(--mute);
}
.bk-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.bk-turnstile {
  min-height: 65px;
}

/* ---------- paso 3: confirmación ---------- */
.bk-done {
  text-align: center;
  padding: 12px 0 4px;
}
.bk-done .ct-ic {
  margin: 0 auto 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
.bk-done .ct-ic .material-symbols-outlined {
  font-size: 32px;
}
.bk-done h3 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
  outline: none;
}
.bk-done p {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto 8px;
}
.bk-done [data-bk-done-when] {
  color: #fff;
  font-size: 17px;
  font-weight: 500;
}
.bk-done [data-bk-done-when]::first-letter {
  text-transform: uppercase;
}
.bk-done .btn {
  margin-top: 22px;
}
.bk[data-step='done'] .bk-panel {
  animation: none;
}
.bk[data-step='done'] .bk-done {
  animation: bkIn 0.5s var(--ct-ease, ease) both;
}
