/*
 * Multi-step qualification form.
 * One question per screen, progress bar, keyboard driven, Onso brand.
 */

.qf {
  --qf-accent: var(--brand-violet, #7c3aed);
  --qf-accent-soft: rgba(124, 58, 237, 0.08);
  --qf-accent-line: rgba(124, 58, 237, 0.35);
  --qf-ink: var(--brand-base, #0f0721);
  --qf-muted: #6b6480;

  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: var(--font-ui, Inter, sans-serif);
  color: var(--qf-ink);
}

/* ------------------------------------------------------------- progress */

.qf__progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--qf-accent-soft);
  z-index: 2;
}

.qf__progressBar {
  height: 100%;
  width: 0;
  background: var(--qf-accent);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------- layout */

/*
 * align-items:center would clip the top of any step taller than the viewport
 * and make it unreachable by scrolling. `margin:auto` on the child centres it
 * when there is room and overflows correctly when there is not.
 */
.qf__viewport {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  padding: 54px clamp(20px, 6vw, 64px) 34px;
}

.qf__step {
  width: 100%;
  max-width: 620px;
  margin: auto;
  animation: qfIn 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/*
 * Choice steps have no field to focus, so the step itself takes focus to arm the
 * A/B/C/D shortcuts. That is a programmatic focus the visitor never asked for,
 * so it should not draw a ring around the whole panel. The buttons inside keep
 * their own focus styles.
 */
.qf__step:focus { outline: none; }

/* the Cal month view needs the full panel width to breathe */
.qf__step--wide { max-width: 100%; }

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

@media (prefers-reduced-motion: reduce) {
  .qf__step { animation: none; }
  .qf__progressBar { transition: none; }
}

/* ----------------------------------------------------------- step chrome */

.qf__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 20px;
  color: var(--qf-accent);
  font: 600 14px/1 inherit;
  cursor: pointer;
}

.qf__back:hover { text-decoration: underline; }

.qf__question {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.qf__required { color: var(--qf-accent); margin-left: 2px; }

.qf__hint {
  font-size: 14.5px;
  color: var(--qf-muted);
  margin: 0 0 22px;
  line-height: 1.55;
}

.qf__question + .qf__fields,
.qf__hint + .qf__fields { margin-top: 24px; }

/* --------------------------------------------------------------- inputs */

.qf__fields { display: grid; gap: 16px; }
.qf__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.qf__input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--qf-accent-line);
  background: transparent;
  padding: 10px 2px;
  font: 400 clamp(18px, 2.4vw, 24px)/1.4 inherit;
  color: var(--qf-ink);
  outline: none;
  border-radius: 0;
}

.qf__input::placeholder { color: #b3adc4; }

/*
 * background-COLOR, never the `background` shorthand. The shorthand resets
 * background-size and background-position, which made the select arrow below
 * scale up to fill the whole control on focus.
 */
.qf__input:focus {
  border-bottom-color: var(--qf-accent);
  background-color: var(--qf-accent-soft);
}

/* A single SVG chevron. Sized and positioned in longhand so nothing can
   accidentally stretch it. */
select.qf__input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2.5' 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 6px center;
  background-size: 17px 17px;
}

/* phone: country code beside the number */
.qf__phone { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: end; }
.qf__phone select.qf__input { font-size: clamp(15px, 2vw, 18px); width: auto; min-width: 116px; }

/* --------------------------------------------------------------- choices */

.qf__choices { display: grid; gap: 10px; }

.qf__choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  border: 1.5px solid var(--qf-accent-line);
  border-radius: 10px;
  background: var(--qf-accent-soft);
  color: var(--qf-ink);
  font: 500 clamp(15px, 2vw, 17px)/1.35 inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.qf__choice:hover {
  background: rgba(124, 58, 237, 0.14);
  border-color: var(--qf-accent);
}

.qf__choice:active { transform: scale(0.995); }

.qf__choice--selected {
  background: var(--qf-accent);
  border-color: var(--qf-accent);
  color: #fff;
}

.qf__key {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 1.5px solid var(--qf-accent-line);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--qf-accent);
  background: #fff;
}

.qf__choice--selected .qf__key { border-color: #fff; color: var(--qf-accent); }

/* ---------------------------------------------------------------- footer */

.qf__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.qf__submit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 9px;
  background: var(--qf-accent);
  color: #fff;
  padding: 13px 26px;
  font: 600 16px/1 inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.qf__submit:hover { background: var(--brand-violet-dark, #6528d6); transform: translateY(-1px); }
.qf__submit:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.qf__enterHint { font-size: 13px; color: var(--qf-muted); }
.qf__enterHint kbd {
  font: inherit;
  font-weight: 600;
  color: var(--qf-accent);
}

.qf__error {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #c0342a;
}

/*
 * The corrected address offered when the checker spots a typo'd domain.
 * Styled as the thing to press rather than as part of the warning: a
 * suggestion they can accept in one tap is repaired far more often than a
 * sentence telling them to look again at what they just typed.
 */
.qf__suggest {
  font: inherit;
  font-weight: 700;
  color: var(--brand-violet);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0;
  cursor: pointer;
}

.qf__suggest:hover { opacity: 0.75; }

.qf__consent {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--qf-muted);
  margin: 0 0 20px;
}

/* -------------------------------------------------------------- booking */

.qf__bookHead { margin-bottom: 16px; }

.qf__dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.qf__date {
  padding: 13px 8px;
  border: 1.5px solid var(--qf-accent-line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: var(--qf-ink);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.qf__date:hover { background: var(--qf-accent-soft); border-color: var(--qf-accent); }

.qf__date--selected {
  background: var(--qf-accent-soft);
  border-color: var(--qf-accent);
  border-width: 2px;
}

.qf__dateDow  { font-size: 12.5px; color: var(--qf-muted); }
.qf__dateNum  { font-size: 23px; font-weight: 700; color: var(--qf-accent); line-height: 1.25; }
.qf__dateMon  { font-size: 12.5px; color: var(--qf-muted); }

.qf__slotHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.qf__tz { color: var(--qf-accent); font-weight: 500; font-size: 13.5px; }

.qf__slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
}

.qf__slot {
  padding: 13px 10px;
  border: 1.5px solid var(--qf-accent-line);
  border-radius: 9px;
  background: #fff;
  color: var(--qf-ink);
  font: 500 15px/1 inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.qf__slot:hover { background: var(--qf-accent-soft); border-color: var(--qf-accent); }
.qf__slot--selected { background: var(--qf-accent); border-color: var(--qf-accent); color: #fff; }

/* --------------------------------------------------------- Cal.com embed */

/* Cal auto-resizes its own iframe, so let it size naturally and let the
   viewport handle any scrolling rather than nesting two scroll areas. */
.qf__cal {
  width: 100%;
  min-height: 560px;
}

.qf__cal iframe { display: block; width: 100%; }

/* Cal supplies its own generous padding, so pull the step's own back */
.qf__viewport:has(.qf__cal) { padding: 40px clamp(2px, 2.5vw, 24px) 16px; }

/* ---------------------------------------------------------- idle nudge */

/*
 * Shown if the visitor parks on the booking step without picking a slot.
 * It covers the form so the only way forward is to re-engage with booking.
 */
.qf__nudge {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: qfIn 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.qf__nudgeCard {
  width: 100%;
  max-width: 540px;
  text-align: center;
  border: 1.5px solid rgba(124, 58, 237, 0.25);
  border-radius: 14px;
  padding: 34px clamp(20px, 5vw, 44px);
  background: #fff;
  box-shadow: 0 10px 34px rgba(15, 7, 33, 0.07);
}

.qf__nudgeTitle {
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--qf-accent);
  margin: 0 0 14px;
}

.qf__nudgeBody {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--qf-muted);
  margin: 0 0 24px;
}

/* ------------------------------------------------------------- complete */

.qf__done { text-align: center; padding: 10px 0; }

.qf__doneMark {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--qf-accent);
  color: #fff;
  display: grid;
  place-items: center;
}

.qf__doneMark svg { width: 30px; height: 30px; fill: currentColor; }

.qf__doneTitle { font-size: clamp(21px, 3vw, 27px); font-weight: 700; margin: 0 0 8px; }
.qf__doneBody  { font-size: 15.5px; color: var(--qf-muted); line-height: 1.6; margin: 0 auto; max-width: 430px; }

.qf__summary {
  margin: 22px auto 0;
  max-width: 400px;
  text-align: left;
  border: 1.5px solid var(--qf-accent-line);
  border-radius: 11px;
  padding: 16px 18px;
  background: var(--qf-accent-soft);
  font-size: 14.5px;
  line-height: 1.7;
}

.qf__summary strong { color: var(--qf-ink); }

/* ----------------------------------------------------------- responsive */

/*
 * On a phone the Cal booker needs every pixel of width it can get. Starved of
 * it, Cal's month grid compresses until the month label ("SEP") collides with
 * the date sitting under it. Strip the chrome around it and give it the frame.
 */
@media (max-width: 640px) {
  .modal { padding: 6px; }
  .modal__panel { height: min(95vh, 900px); border-radius: 10px; }
  .qf__viewport:has(.qf__cal) { padding: 34px 0 6px; }
  .qf__cal { min-height: 620px; }
  .qf__step--wide { max-width: 100%; }
}

@media (max-width: 620px) {
  .qf__viewport { padding: 46px 20px 26px; }
  .qf__row { grid-template-columns: 1fr; }
  .qf__phone { grid-template-columns: 1fr; }
  .qf__phone select.qf__input { width: 100%; }
  .qf__actions { gap: 10px; }
  .qf__enterHint { display: none; }
}
