:root {
  --demo-ink: #102c57;
  --demo-subtle: #5572a2;
  --demo-border: #d7e6fb;
  --demo-border-strong: #a6c3ef;
  --demo-bg: #f4f9ff;
  --demo-accent: #1d66ee;
  --demo-accent-deep: #0f4fc8;
  --demo-card: #ffffff;
}

body.public-demo-page {
  background: radial-gradient(circle at 8% 0%, #eef6ff 0%, transparent 42%), var(--demo-bg);
  color: var(--demo-ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.demo-page-wrap {
  min-height: 100vh;
  padding: 22px clamp(18px, 3vw, 42px) 46px;
}

.demo-topbar {
  max-width: 1180px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.demo-logo {
  display: inline-flex;
  align-items: center;
}

.demo-logo img {
  width: auto;
  max-width: clamp(150px, 22vw, 260px);
  height: 46px;
  object-fit: contain;
}

.demo-exit {
  color: #174588;
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
  border: 1px solid #c8dcfb;
  border-radius: 999px;
  padding: .44rem .84rem;
  background: #f7fbff;
}

.demo-exit:hover {
  border-color: #93bbf5;
  color: #12366d;
}

.demo-alert {
  max-width: 980px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  border: 1px solid;
  padding: .88rem 1rem;
  font-size: .95rem;
}

.demo-alert-success {
  border-color: #95cead;
  background: #eefaf2;
  color: #225438;
}

.demo-alert-error {
  border-color: #e8b5b2;
  background: #fff2f1;
  color: #7a2c2a;
}

.demo-stage {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--demo-border);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 24px 44px rgba(16, 53, 108, 0.1);
  padding: clamp(20px, 3.6vw, 40px);
}

.demo-typeform {
  display: flex;
  flex-direction: column;
}

.demo-success-card {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: .9rem;
  padding: clamp(20px, 5vw, 42px);
}

.demo-success-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #159047;
  background: radial-gradient(circle at 30% 20%, #effff4 0%, #d8f7e3 100%);
  border: 1px solid #aae7c0;
  box-shadow: 0 14px 24px rgba(21, 144, 71, 0.2);
}

.demo-success-icon svg {
  width: 34px;
  height: 34px;
}

.demo-success-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
  color: #10305f;
}

.demo-success-subtext {
  margin: 0;
  color: #4f6f9f;
  font-size: 1.05rem;
}

.demo-success-loader {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #d7e9ff;
  border-top-color: #1d66ee;
  animation: demoSpin 1s linear infinite;
}

.demo-success-countdown {
  margin: .2rem 0 .4rem;
  color: #345d98;
  font-size: .96rem;
}

.demo-success-countdown strong {
  color: #0f4fc8;
}

@keyframes demoSpin {
  to {
    transform: rotate(360deg);
  }
}

.demo-progress {
  border-bottom: 1px solid #dceafb;
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
}

.demo-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .72rem;
}

.demo-progress-meta p {
  font-size: .86rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #385b92;
  font-weight: 700;
}

.demo-progress-meta span {
  font-size: .82rem;
  color: #254c84;
  font-weight: 600;
}

.demo-progress-track {
  height: 6px;
  background: #deebff;
  border-radius: 999px;
  overflow: hidden;
}

.demo-progress-bar {
  display: block;
  width: 12.5%;
  height: 100%;
  border-radius: 999px;
  transition: width .24s ease;
  background: linear-gradient(90deg, var(--demo-accent) 0%, var(--demo-accent-deep) 100%);
}

.demo-step-pills {
  margin-top: .76rem;
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
}

.demo-step-pill {
  border: 1px solid #d5e6ff;
  border-radius: 999px;
  padding: .2rem .58rem;
  color: #5372a4;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.demo-step-pill.is-active {
  border-color: #8cb6f5;
  color: #10428c;
  background: #e9f2ff;
}

.demo-step {
  display: none;
  animation: demoFade .2s ease;
  flex: 0 0 auto;
}

.demo-step.is-active {
  display: block;
}

@keyframes demoFade {
  from {
    opacity: .85;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.demo-question-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--demo-accent), var(--demo-accent-deep));
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  margin-bottom: .9rem;
}

.demo-question {
  margin: 0 0 .7rem;
  font-size: clamp(1.48rem, 2.85vw, 2.08rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0d2f5f;
}

.demo-helper {
  color: #5a76a5;
  max-width: 72ch;
  margin-bottom: 1rem;
}

.demo-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .95rem 1rem;
}

.demo-field {
  display: grid;
  gap: .35rem;
}

.demo-field span {
  font-size: .88rem;
  font-weight: 700;
  color: #1d4276;
}

.demo-field input,
.demo-field select,
.demo-field textarea {
  border: 1px solid #d2e3fb;
  border-radius: 12px;
  background: #fbfdff;
  color: #10305f;
  min-height: 52px;
  padding: .78rem .9rem;
  box-shadow: none;
}

.demo-field input:-webkit-autofill,
.demo-field input:-webkit-autofill:hover,
.demo-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #10305f;
  -webkit-box-shadow: 0 0 0 1000px #fbfdff inset;
  transition: background-color 9999s ease-out 0s;
}

.demo-field textarea {
  min-height: 120px;
  resize: vertical;
}

.demo-field input:focus,
.demo-field select:focus,
.demo-field textarea:focus {
  outline: none;
  border-color: #7fb1fb;
  box-shadow: 0 0 0 .18rem rgba(29, 102, 238, 0.16);
}

.demo-field-full {
  grid-column: 1 / -1;
}

.demo-choice-stack {
  display: grid;
  gap: .62rem;
  max-width: 740px;
}

.demo-choice {
  display: block;
  cursor: pointer;
}

.demo-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.demo-choice-body {
  border: 1px solid #d5e6ff;
  border-radius: 10px;
  background: #f8fbff;
  padding: .7rem .88rem;
  display: flex;
  align-items: center;
  gap: .72rem;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.demo-choice:hover .demo-choice-body {
  transform: translateY(-1px);
  border-color: #9fc2f6;
}

.demo-choice-key {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid #cadefb;
  background: #fff;
  color: #4a6999;
  font-size: .75rem;
  font-weight: 700;
}

.demo-choice-text {
  color: #13396f;
  font-weight: 600;
  line-height: 1.35;
}

.demo-choice input:checked ~ .demo-choice-body {
  border-color: #75aaf8;
  background: #ebf3ff;
}

.demo-choice input:checked ~ .demo-choice-body .demo-choice-key {
  border-color: #75aaf8;
  color: #0f4aa8;
}

.demo-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .58rem;
}

.demo-chip {
  position: relative;
  cursor: pointer;
}

.demo-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.demo-chip span {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  border-radius: 999px;
  border: 1px solid #d5e6ff;
  background: #f8fbff;
  color: #244a83;
  padding: .44rem .78rem;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.demo-chip span::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.5px solid #94b7ee;
  background: #fff;
  flex: 0 0 auto;
}

.demo-chip input:checked ~ span {
  border-color: #2f7ef7;
  background: #e7f1ff;
  color: #0f3f82;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(30, 97, 209, 0.16);
}

.demo-chip input:checked ~ span::before {
  content: '✓';
  display: grid;
  place-items: center;
  font-size: .68rem;
  line-height: 1;
  color: #fff;
  border-color: #2f7ef7;
  background: #2f7ef7;
}

.demo-chip input:focus-visible ~ span {
  outline: 2px solid #4f8df4;
  outline-offset: 2px;
}

.demo-inline-error {
  display: none;
  margin-top: .45rem;
  color: #8f2d2d;
  font-size: .84rem;
  font-weight: 700;
}

.demo-chip-grid.is-invalid-group + .demo-inline-error {
  display: block;
}

.demo-actions {
  border-top: 1px solid #dceafb;
  margin-top: 1rem;
  padding-top: .95rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}

.demo-btn {
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: .62rem 1.15rem;
  font-weight: 700;
  letter-spacing: .01em;
  transition: background .2s ease, opacity .2s ease, transform .2s ease;
  min-width: 132px;
}

.demo-btn-ghost {
  color: #24528f;
  background: #eaf3ff;
}

.demo-btn-ghost:hover {
  background: #dcecff;
}

.demo-btn-primary {
  background: linear-gradient(135deg, var(--demo-accent), var(--demo-accent-deep));
  color: #fff;
}

.demo-btn-primary:hover {
  background: linear-gradient(135deg, #1a5fde, #0d46b8);
}

.demo-btn:focus-visible,
.demo-exit:focus-visible {
  outline: 2px solid #4f8df4;
  outline-offset: 2px;
}

.demo-btn:disabled {
  opacity: .62;
  cursor: not-allowed;
  transform: none;
}

.demo-btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: .78;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.demo-btn.is-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: demoBtnSpin .8s linear infinite;
}

@keyframes demoBtnSpin {
  to {
    transform: rotate(360deg);
  }
}

.demo-typeform .is-invalid {
  border-color: #d17878;
  box-shadow: 0 0 0 .16rem rgba(209, 120, 120, 0.16);
}

@media (max-width: 992px) {
  .demo-page-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .demo-topbar {
    margin-bottom: 14px;
  }

  .demo-stage {
    border-radius: 16px;
    padding: 18px 14px;
  }

  .demo-input-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .demo-logo img {
    height: 38px;
  }

  .demo-progress-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-step-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: .2rem;
    scrollbar-width: thin;
  }

  .demo-btn {
    width: 100%;
    justify-content: center;
  }

  .demo-actions {
    display: grid;
  }
}
