:root {
  --bg: #ffffff;
  --q: #1d1d1f;
  --a: #0b5cd5;
  --btn: #0b5cd5;
  --btn-text: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --a-soft: color-mix(in srgb, var(--a) 10%, transparent);
  --a-mid: color-mix(in srgb, var(--a) 30%, transparent);
  --a-line: color-mix(in srgb, var(--a) 60%, transparent);
  --q-soft: color-mix(in srgb, var(--q) 70%, transparent);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  background-size: cover;
  background-position: center;
  color: var(--q);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

#root { height: 100%; position: relative; }
.loading, .message {
  height: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; font-size: 20px; color: var(--q-soft);
}
.message h1 { font-size: 26px; color: var(--q); margin: 0 0 8px; font-weight: 600; }
.message p { margin: 0; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--a-soft); z-index: 5; }
.progress > div { height: 100%; background: var(--a); width: 0; transition: width .4s ease; }

.stage {
  position: absolute; inset: 0;
  overflow-y: auto;
  display: flex;
  padding: 72px 24px 96px;
}
.slide {
  margin: auto;
  width: 100%;
  max-width: 720px;
  animation: in-next .45s cubic-bezier(.2,.8,.2,1);
}
.slide.from-prev { animation-name: in-prev; }
.slide.still { animation: none; }
@keyframes in-next { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes in-prev { from { opacity: 0; transform: translateY(-60px); } to { opacity: 1; transform: none; } }

.q-head { display: flex; gap: 10px; align-items: baseline; }
.q-num { color: var(--a); font-size: 16px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none; }
.q-title { font-size: var(--t, 24px); line-height: 1.3; font-weight: 400; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-title strong, .q-desc strong { font-weight: 700; }
.q-title a, .q-desc a { color: var(--a); text-decoration: underline; text-underline-offset: 2px; }
.recall-missing { opacity: .55; font-style: italic; }
.q-image { display: block; max-width: 100%; max-height: 280px; border-radius: 10px; margin: 0 0 20px; object-fit: contain; }
.q-title .req { color: var(--a); margin-left: 2px; }
.q-title.empty { opacity: .45; }
.welcome .q-title, .ending .q-title { text-align: center; }
.welcome .q-image, .ending .q-image { margin-left: auto; margin-right: auto; }
.welcome, .ending { text-align: center; }
.q-desc { font-size: var(--d, 18px); line-height: 1.5; color: var(--q-soft); margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-body { margin-top: 28px; }
.q-head + .q-desc, .q-desc { padding-left: 0; }
.has-num .q-desc, .has-num .q-body, .has-num .q-actions, .has-num .q-error { margin-left: 34px; }

.text-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--a-line);
  color: var(--a);
  font-size: 26px;
  padding: 6px 0 8px;
  outline: none;
  border-radius: 0;
}
.text-input::placeholder { color: var(--a-mid); }
.text-input:focus { border-bottom: 2px solid var(--a); padding-bottom: 7px; }
textarea.text-input { resize: none; overflow: hidden; line-height: 1.4; min-height: 50px; }
input[type="date"].text-input { max-width: 320px; color-scheme: light dark; }

.choices { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.choices.wide { max-width: none; flex-direction: row; flex-wrap: wrap; }
.choice {
  display: flex; align-items: center; gap: 10px;
  text-align: left;
  background: var(--a-soft);
  border: 1px solid var(--a-line);
  color: var(--a);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 18px;
  min-height: 44px;
  transition: background .15s;
}
.choice:hover { background: var(--a-mid); }
.choice[aria-pressed="true"] { background: var(--a-mid); border-width: 2px; padding: 7px 9px; }
.choice.flash { animation: flash .35s 2; }
@keyframes flash { 50% { background: var(--a-soft); } }
.choice .key {
  flex: none;
  min-width: 24px; height: 24px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--a-line); border-radius: 3px;
  font-size: 12px; font-weight: 700;
  background: var(--bg);
}
.choice[aria-pressed="true"] .key { background: var(--a); color: var(--bg); border-color: var(--a); }
.choice .label { flex: 1; overflow-wrap: anywhere; }
.choice .tick { flex: none; opacity: 0; }
.choice[aria-pressed="true"] .tick { opacity: 1; }
.choice-other-input { background: transparent; border: 0; border-bottom: 1px solid var(--a-line); color: var(--a); font-size: 18px; outline: none; flex: 1; min-width: 0; }
.multi-hint { font-size: 14px; color: var(--q-soft); margin: -12px 0 12px; }

.dropdown { position: relative; max-width: 520px; }
.dropdown-list {
  margin-top: 8px; max-height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.dropdown-list .choice.active { outline: 2px solid var(--a); outline-offset: 1px; }
.dropdown-empty { color: var(--q-soft); font-size: 16px; padding: 8px 0; }

.scale { display: flex; gap: 6px; flex-wrap: nowrap; }
.scale .choice { flex: 1; justify-content: center; padding: 0; height: 56px; font-size: 18px; min-width: 0; }
.scale .choice[aria-pressed="true"] { padding: 0; }
.scale .choice .label { flex: none; text-align: center; }
.scale .choice .tick { display: none; }
.scale-labels { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: var(--q-soft); gap: 12px; }
.scale-labels span:last-child { text-align: right; }

.rating { display: flex; gap: 6px; flex-wrap: wrap; }
.star {
  background: none; border: 0; padding: 4px; color: var(--a);
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px;
}
.star svg { width: 44px; height: 44px; }
.star svg path { fill: transparent; stroke: var(--a); stroke-width: 1.4; transition: fill .1s; }
.star.on svg path { fill: var(--a); }

.q-error {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 4px 10px; border-radius: 4px;
  background: #fde8e8; color: #b42318; font-size: 15px;
}
.q-error:empty { display: none; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.q-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.welcome .q-actions, .ending .q-actions { justify-content: center; margin-top: 32px; }
.btn {
  background: var(--btn); color: var(--btn-text);
  border: 0; border-radius: 6px;
  padding: 10px 18px; font-size: 18px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.hint { font-size: 13px; color: var(--q-soft); }
.hint b { font-weight: 700; }

.nav { position: fixed; right: 16px; bottom: 16px; display: flex; gap: 2px; z-index: 5; }
.nav button {
  background: var(--btn); color: var(--btn-text); border: 0;
  width: 40px; height: 36px; display: flex; align-items: center; justify-content: center;
}
.nav button:first-child { border-radius: 6px 0 0 6px; }
.nav button:last-child { border-radius: 0 6px 6px 0; }
.nav button:disabled { opacity: .45; cursor: default; }

.preview-bar {
  position: fixed; left: 12px; bottom: 16px; z-index: 6;
  display: flex; gap: 6px; align-items: center;
  font: 12px/1 -apple-system, BlinkMacSystemFont, sans-serif;
}
.preview-bar span, .preview-bar button {
  background: rgba(0,0,0,.65); color: #fff; border: 0; border-radius: 99px; padding: 6px 10px;
  display: inline-flex; align-items: center; gap: 4px;
}

.toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  background: #b42318; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 15px; z-index: 10;
  max-width: calc(100% - 32px);
}

@media (max-width: 600px) {
  .stage { padding: 56px 18px 88px; }
  .q-title { font-size: calc(var(--t, 24px) * 0.84); }
  .q-desc { font-size: calc(var(--d, 18px) * 0.9); }
  .q-image { max-height: 200px; }
  .text-input { font-size: 22px; }
  .has-num .q-desc, .has-num .q-body, .has-num .q-actions, .has-num .q-error { margin-left: 0; }
  .q-num { font-size: 14px; }
  .scale { flex-wrap: wrap; }
  .scale .choice { flex: 0 0 calc((100% - 30px) / 6); height: 48px; }
  .star svg { width: 34px; height: 34px; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .slide, .choice.flash, .shake { animation: none !important; }
}

/* "Contact info" question */
.contact { display: flex; flex-direction: column; gap: 22px; max-width: 560px; }
.contact-label { display: block; font-size: 17px; color: var(--q); margin-bottom: 4px; }
.contact-label .req { color: var(--a); margin-left: 2px; }
.contact .text-input { font-size: 22px; }
.phone-row { display: flex; gap: 12px; align-items: flex-end; }
.phone-row .text-input { flex: 1; min-width: 0; }
.country {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 6px;
  color: var(--a); font-size: 20px;
  border-bottom: 1px solid var(--a-line);
  padding: 6px 2px 8px 0;
}
.country .flag { font-size: 24px; line-height: 1; }
.country .dial { font-size: 18px; }
.country-select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.country:focus-within { border-bottom: 2px solid var(--a); padding-bottom: 7px; }
@media (max-width: 600px) {
  .contact { gap: 18px; }
  .contact .text-input { font-size: 20px; }
}

/* "Schedule a call" question */
.booking-btn {
  width: 100%; max-width: 560px;
  background: transparent; color: var(--q);
  border: 1px solid color-mix(in srgb, var(--q) 30%, transparent); border-radius: 8px;
  padding: 14px 18px; font-size: 20px; font-weight: 500;
}
.booking-btn:hover { background: color-mix(in srgb, var(--q) 6%, transparent); }
.booking-done { display: inline-flex; align-items: center; gap: 8px; color: var(--a); font-size: 18px; font-weight: 600; }
.booking-overlay { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; }
.booking-head {
  flex: none; height: 52px; padding: 0 8px 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid #e4e4e8; color: #1d1d1f; font: 15px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.booking-close { background: none; border: 0; color: #1d1d1f; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.booking-close:hover { background: #f0f0f3; }
.booking-frame { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.booking-frame > * { height: 100%; }
.booking-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.booking-loading { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px; text-align: center; color: #6b6b72; font: 16px/1.5 -apple-system, BlinkMacSystemFont, sans-serif; }
.booking-loading a { color: #2f5bea; margin-left: 4px; }

/* Centered text (Design tab → Text alignment) */
.align-center .slide { text-align: center; }
.align-center .q-head { flex-direction: column; align-items: center; gap: 6px; }
.align-center .q-image { margin-left: auto; margin-right: auto; }
.align-center .has-num .q-desc, .align-center .has-num .q-body, .align-center .has-num .q-actions, .align-center .has-num .q-error { margin-left: 0; }
.align-center .q-actions { justify-content: center; }
.align-center .q-body > * { margin-left: auto; margin-right: auto; }
.align-center .choices, .align-center .contact, .align-center .dropdown { margin-left: auto; margin-right: auto; text-align: left; }
.align-center .rating, .align-center .scale { justify-content: center; }
.align-center .text-input { text-align: center; }
.align-center .contact .text-input { text-align: left; }

.q-num.bold { font-weight: 700; }
.q-num.bold svg path { stroke-width: 3; }
