/* Public survey page, laid out like the rbot showform: one question per page,
   icon-prefixed inputs, a centred Next button; a Section is one card with its questions. */
:root {
  --sf-accent: #03a9f4;
  --sf-accent-dark: #0288d1;
  --sf-text: #2b2b2b;
  --sf-muted: #6b7280;
  --sf-border: #c8c8c8;
  --sf-icon-bg: #f3f3f3;
  --sf-radius: 5px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--sf-text);
}

* {
  box-sizing: border-box;
}

.sf-page {
  position: relative;
  min-height: 100vh;
  padding: 72px 6% 48px;
  color: var(--sf-text);
}

.sf-restart {
  position: absolute;
  top: 26px;
  right: 5%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
}

.sf-restart:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sf-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1380px;
  margin: 0 auto;
}

.sf-html {
  overflow-wrap: anywhere;
}

.sf-html img {
  max-width: 100%;
}

/* Page transitions (Survey layout → Page transition). */
.sf-stage {
  animation: sf-fade 0.35s ease both;
}

.sf-stage.is-left_to_right {
  animation-name: sf-from-left;
}

.sf-stage.is-right_to_left {
  animation-name: sf-from-right;
}

.sf-stage.is-top_to_bottom {
  animation-name: sf-from-top;
}

.sf-stage.is-bottom_to_top {
  animation-name: sf-from-bottom;
}

@keyframes sf-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sf-from-left {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: none; }
}

@keyframes sf-from-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}

@keyframes sf-from-top {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: none; }
}

@keyframes sf-from-bottom {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

/* ---- Single question page ---- */
.sf-single {
  padding-top: 18vh;
}

.sf-single .sf-label {
  font-size: 32px;
  font-weight: 500;
}

.sf-single .sf-question > :not(.sf-label):not(.sf-error) {
  max-width: 500px;
}

.sf-single .sf-question.is-message .sf-label,
.sf-single .sf-question.is-links .sf-label {
  max-width: 900px;
}

/* ---- Question block ---- */
.sf-question {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sf-label {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  white-space: pre-line;
}

.sf-required {
  margin-left: 8px;
  color: #ef4444;
}

.sf-error {
  min-height: 0;
  margin: -6px 0 0;
  color: #dc2626;
  font-size: 14px;
}

.sf-error:empty {
  display: none;
}

.sf-hint {
  margin: 0;
  color: var(--sf-muted);
  font-size: 14px;
}

.sf-loader {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #fff;
}

.sf-loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid #e8eef5;
  border-top-color: var(--sf-accent);
  border-radius: 50%;
  animation: sf-loader-spin 0.7s linear infinite;
}

.sf-loader-text {
  color: #64748b;
  font-family: Poppins, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
}

@keyframes sf-loader-spin {
  to { transform: rotate(360deg); }
}

.sf-notice {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: #fff;
  text-align: center;
}

.sf-notice-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.sf-notice h1 {
  margin: 0;
  max-width: 420px;
  font-family: Poppins, "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  color: #1e293b;
}

.sf-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Icon box + input, joined like a Bootstrap input group. */
.sf-input-group {
  display: flex;
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  overflow: hidden;
}

.sf-input-group:focus-within {
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 3px rgba(3, 169, 244, 0.15);
}

.sf-input-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 62px;
  border-right: 1px solid var(--sf-border);
  background: var(--sf-icon-bg);
  color: #6b6b6b;
}

.sf-input,
.sf-select,
.sf-area {
  min-width: 0;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--sf-text);
  font: inherit;
  font-size: 17px;
  outline: none;
}

.sf-input {
  flex: 1;
}

.sf-stack > .sf-input,
.sf-captcha .sf-input {
  height: 54px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
}

.sf-inline-select {
  flex: none;
  max-width: 130px;
  border-right: 1px solid var(--sf-border);
  cursor: pointer;
}

.sf-area {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  resize: vertical;
}

.sf-area:focus {
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 3px rgba(3, 169, 244, 0.15);
}

/* Choice pills (multi choice, multi select, slots, yes/no). */
.sf-choices,
.sf-yesno {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sf-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 20px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  color: var(--sf-text);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sf-choice:hover:not(:disabled) {
  border-color: var(--sf-accent);
}

.sf-choice.is-selected {
  border-color: #1f91f3;
  background: #1f91f3;
  color: #fff;
}

.sf-choice-box {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex: none;
}

.sf-choice-box.is-on {
  border-color: #fff;
  color: #1f91f3;
}

.sf-choice:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sf-choice.has-image {
  flex-direction: column;
  padding: 8px;
}

.sf-choice img {
  width: 120px;
  height: 90px;
  border-radius: 4px;
  object-fit: cover;
}

.sf-yesno-btn {
  min-width: 140px;
  justify-content: center;
}

.sf-pictures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.sf-pictures .sf-choice {
  flex-direction: column;
  padding: 10px;
}

.sf-pictures .sf-choice img {
  width: 100%;
  height: 130px;
}

.sf-pictures.is-compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.sf-pictures.is-compact .sf-choice img {
  height: 80px;
}

/* Rating, opinion scale, range. */
.sf-stars {
  display: flex;
  gap: 6px;
}

.sf-star {
  padding: 0;
  border: 0;
  background: none;
  color: #d1d5db;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}

.sf-star.is-on {
  color: #fbbf24;
}

.sf-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 6px;
}

.sf-scale-btn {
  height: 46px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sf-scale-btn.is-on {
  border-color: #1f91f3;
  background: #1f91f3;
  color: #fff;
}

.sf-scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--sf-muted);
  font-size: 13px;
}

.sf-range input[type='range'] {
  width: 100%;
  accent-color: var(--sf-accent);
}

.sf-range-value {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--sf-accent-dark);
  font-size: 22px;
  font-weight: 600;
}

/* Agreement, file, voice, captcha, matrix, links. */
.sf-terms {
  max-height: 180px;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: var(--sf-radius);
  background: #fafafa;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.sf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  cursor: pointer;
}

.sf-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--sf-accent);
}

.sf-check.is-correct {
  color: #15803d;
}

.sf-check.is-wrong {
  color: #dc2626;
}

.sf-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 90px;
  padding: 18px 20px;
  border: 1px dashed var(--sf-border);
  border-radius: var(--sf-radius);
  background: #fafafa;
  color: var(--sf-muted);
  cursor: pointer;
}

.sf-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.sf-voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.sf-voice-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: var(--sf-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(3, 169, 244, 0.35);
}

.sf-voice-btn.is-recording {
  background: #dc2626;
  animation: sf-pulse 1.2s ease infinite;
}

@keyframes sf-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
}

.sf-captcha {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sf-captcha-sum {
  padding: 12px 18px;
  border-radius: var(--sf-radius);
  background: var(--sf-icon-bg);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  user-select: none;
}

.sf-captcha .sf-input {
  width: 120px;
  flex: none;
}

.sf-icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--sf-border);
  border-radius: 999px;
  background: #fff;
  color: #6b6b6b;
  cursor: pointer;
}

.sf-matrix-wrap {
  overflow-x: auto;
}

.sf-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.sf-matrix th,
.sf-matrix td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.sf-matrix th.sf-matrix-row {
  font-weight: 500;
  text-align: left;
}

.sf-matrix input {
  width: 18px;
  height: 18px;
  accent-color: var(--sf-accent);
}

.sf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  color: var(--sf-text);
  text-decoration: none;
}

.sf-link:hover {
  border-color: var(--sf-accent);
  color: var(--sf-accent-dark);
}

.sf-link-btn {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sf-accent-dark);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* Spin wheel: RBot look - gold rim, gold pointer, blue SPIN hub (the hub spins it). */
.sf-spin {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  gap: 22px;
  width: min(100%, 420px);
  margin: 0 auto;
}

.sf-spin-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-top: 14px;
  border-radius: 50%;
  background: linear-gradient(3.22deg, #b14d01 6.25%, #feca01 27.4%, #feca01 50.48%, #feca01 70.19%, #b14d01 97.12%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.sf-spin-wheel,
.sf-spin-shade {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
}

.sf-spin-wheel {
  overflow: hidden;
  transition: transform 3s cubic-bezier(0.17, 0.67, 0.21, 1);
}

/* The darker band just inside the rim. It does not turn with the wheel. */
.sf-spin-shade {
  z-index: 1;
  background: radial-gradient(circle closest-side, transparent 93%, rgba(0, 0, 0, 0.15) 93%);
  pointer-events: none;
}

.sf-spin-divider,
.sf-spin-arm {
  position: absolute;
  top: 0;
  left: 50%;
  height: 50%;
  transform-origin: 50% 100%;
  pointer-events: none;
}

.sf-spin-divider {
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.3);
}

.sf-spin-arm {
  width: 0;
}

/* Sits at 65% of the radius and runs along its slice, as on RBot. */
.sf-spin-label {
  position: absolute;
  top: 35%;
  left: 0;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
}

.sf-spin-pointer {
  position: absolute;
  top: -3%;
  left: 50%;
  z-index: 3;
  width: 12%;
  max-width: 66px;
  transform: translateX(-50%);
  pointer-events: none;
}

.sf-spin-pointer svg {
  display: block;
  width: 100%;
  height: auto;
}

.sf-spin-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 28%;
  height: 28%;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(3.22deg, #b14d01 6.25%, #feca01 27.4%, #feca01 50.48%, #feca01 70.19%, #b14d01 97.12%);
  transform: translate(-50%, -50%);
}

.sf-spin-hub-btn {
  position: relative;
  width: 86%;
  height: 86%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4464f6, #2c3eb5);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.sf-spin-hub-btn::after {
  position: absolute;
  inset: 1%;
  border: 8px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

/* The SPIN hub is the only way to spin. */
.sf-spin-hub-btn:not(:disabled):hover {
  filter: brightness(1.12);
}

.sf-spin-hub-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.sf-spin-hub-btn:disabled {
  cursor: default;
}

@media (max-width: 480px) {
  .sf-spin-label {
    font-size: 13px;
  }

  .sf-spin-hub-btn {
    font-size: 16px;
  }

  .sf-spin-hub-btn::after {
    border-width: 5px;
  }
}

/* Questionnaire. */
.sf-quiz {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sf-quiz.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.sf-quiz-q {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sf-quiz-title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
}

.sf-timer {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

/* ---- Buttons ---- */
.sf-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.sf-actions.is-section {
  margin-top: 0;
}

.sf-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 134px;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 4px;
  background: var(--sf-accent);
  color: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(3, 169, 244, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.sf-next:hover:not(:disabled) {
  background: var(--sf-accent-dark);
}

.sf-next:active:not(:disabled) {
  transform: translateY(1px);
}

.sf-next:disabled {
  opacity: 0.6;
  cursor: default;
}

.sf-next.sf-secondary {
  background: #fff;
  color: #4b5563;
  box-shadow: none;
  border: 1px solid var(--sf-border);
}

.sf-next.sf-secondary:hover {
  background: #f3f4f6;
}

/* ---- Section card ---- */
.sf-section {
  max-width: 1380px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
}

.sf-section-head {
  padding: 46px 62px 40px;
  border-bottom: 1px solid #e8e8e8;
}

.sf-section-head h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
}

.sf-section-head p {
  margin: 10px 0 0;
  color: var(--sf-muted);
  font-size: 16px;
}

.sf-section-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 36px 68px 30px;
}

.sf-section-body .sf-question.is-message .sf-label {
  font-size: 24px;
}

.sf-question.is-date .sf-input-group {
  max-width: 434px;
}

.sf-section-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
  border-top: 1px solid #e8e8e8;
}

/* ---- Finished ---- */
.sf-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18vh 0 40px;
  text-align: center;
}

.sf-done h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
}

.sf-done-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 34px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .sf-page {
    padding: 64px 16px 32px;
  }

  .sf-single {
    padding-top: 8vh;
  }

  .sf-single .sf-label {
    font-size: 24px;
  }

  .sf-label {
    font-size: 20px;
  }

  .sf-section-head {
    padding: 26px 20px;
  }

  .sf-section-head h2 {
    font-size: 24px;
  }

  .sf-section-body {
    gap: 28px;
    padding: 24px 20px;
  }

  .sf-scale {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .sf-input-icon {
    width: 48px;
  }
}
