/* ═══════════════════════════════════════════════════════════════════
   Paradox Booking Form — iClosed-style multi-step booking widget
   (form-first scheduler: qualify → then the calendar unlocks)

   SOURCE OF TRUTH: shared/landing/booking-form/ — copy both files into
   the lander's assets/ when wiring a site (landers are self-contained).

   Scoped under .pbf. Themes itself from the host page's brand tokens
   via CSS vars with fallbacks — override any --pbf-* on the host to
   restyle. The Continue button reuses the page's own CTA class when
   `buttonClass` is passed to init() (keeps gradient/brand CTAs exact).
   ═══════════════════════════════════════════════════════════════════ */

.pbf {
  --pbf-field-bg: var(--ink, #0B0C10);
  --pbf-text: var(--paper, #F4F1EA);
  --pbf-dim: var(--paper-dim, #A8ABB4);
  --pbf-accent: var(--signal, #4D7CFF);
  --pbf-line: var(--line, #23262F);
  --pbf-warn: var(--warn, #E2574C);
  --pbf-ok: var(--ok, #3ECF8E);
  --pbf-radius: 10px;
  --pbf-font: var(--body, inherit);
  --pbf-mono: var(--mono, ui-monospace, monospace);
  font-family: var(--pbf-font);
  text-align: left;
}

/* ── progress rail ─────────────────────────────────────────────── */
.pbf-rail {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 22px; padding-bottom: 18px;
  border-bottom: 1px solid var(--pbf-line);
}
.pbf-rail-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--pbf-dim);
  transition: color .25s ease; white-space: nowrap;
}
.pbf-rail-step::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--pbf-line); transition: background .25s ease, box-shadow .25s ease;
  flex: 0 0 auto;
}
.pbf-rail-step.active { color: var(--pbf-text); }
.pbf-rail-step.active::before {
  background: var(--pbf-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pbf-accent) 22%, transparent);
}
.pbf-rail-sep { width: 26px; height: 1px; background: var(--pbf-line); flex: 0 0 auto; }

/* ── form fields ───────────────────────────────────────────────── */
.pbf-form { display: grid; gap: 12px; }
.pbf-label {
  font-family: var(--pbf-mono); font-size: 12.5px; letter-spacing: .1em;
  color: var(--pbf-dim); display: block; margin-bottom: 6px; text-transform: uppercase;
}
.pbf-label .pbf-req { color: var(--pbf-warn); margin-left: 2px; }

.pbf-input, .pbf-select {
  width: 100%; background: var(--pbf-field-bg);
  border: 1px solid var(--pbf-line); border-radius: var(--pbf-radius);
  color: var(--pbf-text); font-family: var(--pbf-font); font-size: 16px;
  padding: 14px 15px; outline: none; transition: border-color .2s ease;
  appearance: none; -webkit-appearance: none;
}
.pbf-input:focus, .pbf-select:focus { border-color: var(--pbf-accent); }
.pbf-input.pbf-invalid, .pbf-select.pbf-invalid { border-color: var(--pbf-warn); }
.pbf-input::placeholder { color: color-mix(in srgb, var(--pbf-dim) 70%, transparent); }

.pbf-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A8ABB4' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  padding-right: 38px; cursor: pointer;
}
.pbf-select.pbf-empty { color: color-mix(in srgb, var(--pbf-dim) 80%, transparent); }

/* phone row: country select fused to the number input */
.pbf-phone { display: flex; align-items: stretch; }
.pbf-cc {
  flex: 0 0 auto; width: auto; max-width: 118px;
  border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0;
  font-size: 15px; padding-right: 30px; background-position: right 10px center;
}
.pbf-phone .pbf-input {
  flex: 1 1 auto; border-top-left-radius: 0; border-bottom-left-radius: 0;
}
.pbf-phone:focus-within .pbf-cc,
.pbf-phone:focus-within .pbf-input { border-color: var(--pbf-accent); }

.pbf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .pbf-row2 { grid-template-columns: 1fr; } }

/* ── progressive reveal (grid-rows trick, no JS height math) ───── */
.pbf-more {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  transition: grid-template-rows .45s cubic-bezier(.22, .8, .3, 1);
}
.pbf.pbf-expanded .pbf-more { grid-template-rows: 1fr; }
.pbf-more-inner { min-height: 0; display: grid; gap: 12px; }
.pbf-more-inner > :first-child { margin-top: 2px; }

.pbf-consent { font-size: 12.5px; color: var(--pbf-dim); line-height: 1.55; margin-top: 2px; }
.pbf-consent a { color: var(--pbf-text); text-decoration: underline; }

.pbf-error { display: none; color: var(--pbf-warn); font-size: 13.5px; }
.pbf-error.pbf-show { display: block; }

.pbf-submit { width: 100%; margin-top: 6px; cursor: pointer; }
/* fallback look when no buttonClass is passed */
.pbf-submit.pbf-btn-default {
  background: var(--pbf-accent); color: #fff; border: 0;
  border-radius: var(--pbf-radius); font-family: var(--pbf-font);
  font-size: 16.5px; font-weight: 600; padding: 15px 22px;
  transition: filter .2s ease;
}
.pbf-submit.pbf-btn-default:hover { filter: brightness(1.08); }
.pbf-submit:disabled { opacity: .65; cursor: default; }

/* ── ghost calendar (locked preview — the "unlock me" hook) ────── */
.pbf-ghost { position: relative; margin-top: 20px; user-select: none; }
.pbf-ghost-cal {
  border: 1px solid var(--pbf-line); border-radius: var(--pbf-radius);
  padding: 18px 16px 14px; opacity: .5; cursor: not-allowed;
  transition: opacity .25s ease;
}
.pbf-ghost:hover .pbf-ghost-cal { opacity: .62; }
.pbf-ghost-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 2px;
}
.pbf-ghost-month { font-size: 15.5px; font-weight: 600; color: var(--pbf-dim); }
.pbf-ghost-nav { display: flex; gap: 6px; }
.pbf-ghost-nav span {
  width: 30px; height: 30px; border: 1px solid var(--pbf-line); border-radius: 8px;
  display: grid; place-items: center; color: var(--pbf-dim); font-size: 13px;
}
.pbf-ghost-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center;
}
.pbf-ghost-grid .pbf-dow {
  font-family: var(--pbf-mono); font-size: 10.5px; letter-spacing: .08em;
  color: var(--pbf-dim); padding: 6px 0; text-transform: uppercase;
}
.pbf-ghost-grid .pbf-day {
  font-size: 13.5px; color: var(--pbf-dim); padding: 8px 0; border-radius: 8px;
  position: relative;
}
.pbf-ghost-grid .pbf-day.pbf-avail {
  background: color-mix(in srgb, var(--pbf-accent) 16%, transparent);
  color: var(--pbf-text); font-weight: 600;
}
.pbf-ghost-grid .pbf-day.pbf-today::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--pbf-accent);
}

/* lock tooltip — shown over the ghost calendar on hover/tap */
.pbf-ghost-tip {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: var(--pbf-field-bg); border: 1px solid var(--pbf-line);
  border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  padding: 13px 18px; font-size: 14px; color: var(--pbf-text);
  max-width: 88%; text-align: center; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
  z-index: 2;
}
.pbf-ghost:hover .pbf-ghost-tip, .pbf-ghost.pbf-tapped .pbf-ghost-tip { opacity: 1; }

/* ── step 2: real calendar ─────────────────────────────────────── */
.pbf-calendar { display: none; }
.pbf-calendar.pbf-show { display: block; margin: 4px -14px 0; }
.pbf-calendar iframe {
  width: 100%; min-height: 640px; border: 0;
  border-radius: var(--pbf-radius); background: #fff;
}
.pbf-cal-fallback { font-size: 13px; color: var(--pbf-dim); text-align: center; margin-top: 10px; }
@media (max-width: 720px) { .pbf-calendar.pbf-show { margin: 4px -8px 0; } }
