/* =====================================================================
   Booking widget — self-hosted replica of the iClosed two-pane booker.
   Left pane: progressive qualifying form. Right pane: calendar (locked
   until the form is submitted). Scoped under .bw.
   ===================================================================== */

.bw{
  --bw-ink:        #16143a;
  --bw-ink-soft:   #4a4f5c;
  --bw-muted:      #9aa0ab;
  --bw-faint:      #c3c8d1;
  --bw-line:       #e8eaee;
  --bw-field-line: #d5d9e0;
  --bw-blue:       #2f6fed;
  --bw-blue-dark:  #0a2a6e;
  --bw-red:        #e5484d;
  --bw-radius:     6px;

  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 90px -40px rgba(0,0,0,.9);
  color: var(--bw-ink);
  font-family: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: left;
}
.bw *, .bw *::before, .bw *::after{ box-sizing: border-box; }

/* ── Step tabs ──────────────────────────────────────────────────────── */
.bw-steps{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bw-line);
}
.bw-step{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--bw-muted);
}
.bw-step::before{
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9ced6;
}
.bw-step--active{ color: var(--bw-ink); font-weight: 600; }
.bw-step--active::before{ background: var(--bw-ink); }

/* ── Two-pane body ──────────────────────────────────────────────────── */
.bw-body{
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 470px;
}
.bw-pane{ padding: 26px 28px 28px; }
.bw-pane--cal{ border-left: 1px solid var(--bw-line); position: relative; }

.bw-title{
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--bw-ink);
}

/* ── Fields ─────────────────────────────────────────────────────────── */
.bw-field{ margin-bottom: 14px; }
.bw-label{
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--bw-ink);
}
.bw-req{ color: var(--bw-red); }

.bw-input,
.bw-select{
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--bw-field-line);
  border-radius: var(--bw-radius);
  background: #fff;
  color: var(--bw-ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bw-input::placeholder{ color: var(--bw-muted); }
.bw-input:focus,
.bw-select:focus{
  border-color: var(--bw-blue);
  box-shadow: 0 0 0 3px rgba(47,111,237,.15);
}
.bw-select{
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  color: var(--bw-muted);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0ab' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px 16px;
  cursor: pointer;
}
.bw-select[data-filled="1"]{ color: var(--bw-ink); }

/* Phone row: country picker + number share one line */
.bw-phone-row{ display: flex; gap: 8px; height: 44px; border-radius: var(--bw-radius); }
.bw-phone-row .pdd-container{ width: 96px; }
.bw-phone-row .bw-input{ flex: 1; height: 44px; }

/* Attract loop: keeps flashing while they focus and type, so the one required
   field on screen never stops asking for attention. Tight ring, no big bloom. */
@keyframes bw-phone-pulse{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(193,8,20,.5); }
  50%     { box-shadow: 0 0 0 3px rgba(193,8,20,.2); }
}
.bw-phone-row{ animation: bw-phone-pulse 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce){
  .bw-phone-row{ animation: none !important; }
}

.bw-input--error,
.bw-select--error{ border-color: var(--bw-red); }
.bw-error{
  display: none;
  margin-top: 5px;
  font-size: 12px;
  color: var(--bw-red);
}
.bw-field--invalid .bw-error{ display: block; }

/* Everything past the name field stays collapsed until they start typing */
.bw-more{
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .35s ease, opacity .25s ease;
}
.bw-more > div{ overflow: hidden; }
.bw[data-expanded="1"] .bw-more{ grid-template-rows: 1fr; opacity: 1; }

.bw-consent{
  margin: 16px 0 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #5566c4;
}
.bw-consent a{ color: var(--bw-ink); font-weight: 600; text-decoration: underline; }

.bw-submit{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: var(--bw-radius);
  background: linear-gradient(90deg, var(--bw-blue-dark), #1f5fd0);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .2s ease;
}
.bw-submit:hover{ filter: brightness(1.1); }
.bw-submit:disabled{ opacity: .65; cursor: not-allowed; }
.bw-submit svg{ width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2.5; }

.bw-spin{
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: bw-spin .7s linear infinite;
}
@keyframes bw-spin{ to{ transform: rotate(360deg); } }

/* ── Calendar ───────────────────────────────────────────────────────── */
.bw-cal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.bw-cal-month{ font-size: 15px; color: var(--bw-muted); }
.bw-cal-nav{ display: flex; gap: 6px; }
.bw-cal-nav button{
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e3e6eb;
  border-radius: var(--bw-radius);
  background: #fff;
  cursor: pointer;
}
.bw-cal-nav button:disabled{ opacity: .4; cursor: not-allowed; }
.bw-cal-nav svg{ width: 12px; height: 12px; stroke: #b6bcc6; fill: none; stroke-width: 2.5; }

.bw-cal-dow,
.bw-cal-grid{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.bw-cal-dow{ margin-bottom: 6px; }
.bw-cal-dow span{
  text-align: center;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: #a8aeb8;
}
.bw-day{
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: var(--bw-radius);
  background: transparent;
  color: var(--bw-faint);
  font-family: inherit;
  font-size: 14px;
  cursor: default;
}
.bw-day--pad{ visibility: hidden; }
.bw-day--open{ background: #eef1f8; color: #6b7280; }
.bw-day--open::after{
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8b9bf5;
}
/* Unlocked: days become clickable */
.bw[data-step="2"] .bw-day--open{ cursor: pointer; color: var(--bw-blue-dark); }
.bw[data-step="2"] .bw-day--open:hover{ background: #e2e8f7; }

.bw-cal-tip{
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 230px;
  padding: 14px 18px;
  border: 1px solid var(--bw-line);
  border-radius: var(--bw-radius);
  background: #fff;
  box-shadow: 0 8px 28px rgba(16,20,40,.16);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--bw-ink);
  pointer-events: none;
}

/* Calendly takes over the right pane once the form is accepted */
.bw-cal-live{ display: none; }
.bw[data-step="2"] .bw-cal-static{ display: none; }
.bw[data-step="2"] .bw-cal-live{ display: block; }
.bw[data-step="2"] .bw-pane--cal{ padding: 0; }
.bw[data-step="2"] .bw-pane--form{ display: none; }
.bw[data-step="2"] .bw-body{ grid-template-columns: 1fr; }
.bw[data-step="2"] .bw-pane--cal{ border-left: 0; }

.bw-booked{
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 470px;
  padding: 32px;
  text-align: center;
}
.bw[data-step="3"] .bw-body{ display: none; }
.bw[data-step="3"] .bw-booked{ display: flex; }
.bw-booked-tick{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #e7f7ee;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bw-booked-tick svg{ width: 22px; height: 22px; stroke: #17a35b; fill: none; stroke-width: 3; }
.bw-booked h4{ margin: 0; font-size: 19px; font-weight: 700; }
.bw-booked p{ margin: 0; font-size: 14px; color: var(--bw-ink-soft); }

/* ── Footer ─────────────────────────────────────────────────────────── */
.bw-foot{
  padding: 10px 16px;
  border-top: 1px solid var(--bw-line);
  text-align: center;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--bw-muted);
}
.bw-foot b{ color: var(--bw-ink-soft); font-weight: 600; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 860px){
  .bw-body{ grid-template-columns: 1fr; min-height: 0; }
  .bw-pane--cal{ border-left: 0; border-top: 1px solid var(--bw-line); min-height: 400px; }
  .bw-pane{ padding: 22px 20px 24px; }
  .bw-steps{ gap: 18px; }
  .bw-step{ font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce){
  .bw *, .bw *::before, .bw *::after{ animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
