.dynamic-funnel-wrapper {
  --primary: #ed002f;
  --primary-dark: #990000;
  --bg: #f5f3ff;
  --card-bg: #ffffff;
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --accent: #f97316;
  --accent-soft: #fff7ed;
  scroll-margin-top: 95px; /* header height */
}

@media (min-width: 991px) {
  .dynamic-funnel-wrapper {
    scroll-margin-top: 118px; /* header height */
  }
}

.page-node-type-blog .dynamic-funnel-wrapper {
  padding: 0 20px;
  border-radius: 20px;
}

.page-node-type-blog .dynamic-funnel-lead-form h3 {
  margin-top: 2rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .page-node-type-blog .dynamic-funnel-wrapper {
    padding: 0 10px;
  }
}

.page-node-type-blog .dynamic-funnel-hero {
  padding-top: 0;
}
/* Grundknapp */
.dynamic-funnel-options button {
  border: 2px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Vald radio */
.dynamic-funnel-options button[aria-checked="true"] {
  border-color: #2563eb;
  background: #eff6ff;
}

/* Hover (mus – valfritt) */
.dynamic-funnel-options button:hover {
  border-color: rgba(237,0,47,.25);
}

#dynamic-funnel-nextBtn.is-disabled,
#dynamic-funnel-nextBtn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

#dynamic-funnel-nextBtn:not(.is-disabled),
#dynamic-funnel-nextBtn[aria-disabled="false"] {
  opacity: 1;
}


.dynamic-funnel-shake {
  animation: dynamic-funnel-shake 0.45s;
}

.dynamic-funnel-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@keyframes dynamic-funnel-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}


.dynamic-funnel-wrapper {
  background: var(--bg);
}

.dynamic-funnel-wrapper button:focus {
  outline: none !important;
}

/* HERO */
.dynamic-funnel-hero {
  max-width: 940px;
  margin: 0 auto 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  text-align: left;
}

.dynamic-funnel-hero-main {
  flex: 1 1 320px;
  max-width: 540px;
}

.dynamic-funnel-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #7f1d1d;
  background: rgba(248, 113, 113, 0.16);
  height: 36px;
}

.dynamic-funnel-hero h1 {
  font-size: 32px !important;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  line-height: 1.2;
  text-align: left !important;
  font-weight: 600 !important;
}

.dynamic-funnel-hero p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dynamic-funnel-hero-points {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.dynamic-funnel-hero-points li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  line-height: 1.8;
}

.dynamic-funnel-hero-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.dynamic-funnel-hero-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.dynamic-funnel-hero-visual {
  flex: 0 1 260px;
  max-width: 280px;
  background: linear-gradient(145deg, #ffffff, #fee2e2);
  border-radius: 24px;
  padding: 18px 16px 16px;
  box-shadow: 0 18px 40px rgba(127, 29, 29, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dynamic-funnel-hero-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7f1d1d;
}

.dynamic-funnel-hero-score-preview {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
}

.dynamic-funnel-hero-score-preview span {
  font-size: 18px;
  color: #6b7280;
  margin-left: 2px;
}

.dynamic-funnel-hero-bubbles {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.dynamic-funnel-hero-bubble {
  flex: 1;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 0 12px;
  text-align: center;
  border: 1px solid rgba(248, 113, 113, 0.4);
  box-shadow: 0 6px 16px rgba(248, 113, 113, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.dynamic-funnel-hero-bubble span:first-of-type {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.dynamic-funnel-hero-bubble span:last-of-type {
  font-size: 11px;
  color: #7f1d1d;
  line-height: 1;
}

.dynamic-funnel-hero-mini-copy {
  font-size: 11px;
  color: #7f1d1d;
  margin-top: 4px;
  line-height: 1.5;
}

/* CTA */
.dynamic-funnel-cta {
  margin-bottom: 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  padding: 8px 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 1.8;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.35);
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.dynamic-funnel-cta::after { content: "→"; }

.dynamic-funnel-cta:hover {
  background: var(--primary-dark);
  /*transform: translateY(-1px);*/
}

/* CONTAINER / QUIZ */
.dynamic-funnel-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: radial-gradient(circle at top, #ffffff 0, #f9fafb 55%, #eef2ff 100%);
  padding: 26px 24px 22px;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.dynamic-funnel-hidden { display: none; }

.dynamic-funnel-progress-wrap { margin-bottom: 18px; }

.dynamic-funnel-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1;
  font-weight: 300;
  margin-bottom: .65rem;
}

.dynamic-funnel-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.dynamic-funnel-progress-bar-fill {
  height: 100%;
  width: 14%;
  background: var(--primary);
  transition: width 0.25s ease;
}

.dynamic-funnel-question { margin-bottom: 24px; }

.dynamic-funnel-question h2 {
  font-size: 1.7rem;
  line-height: 1.4;
  font-weight: 400;
    margin-bottom: .75rem;
}

@media (max-width: 576px) {
  .dynamic-funnel-question h2 {
    font-size: 1.25rem;
  }
  
  .dynamic-funnel-question h2:not(:first-of-type) {
    font-size: 1rem !important;
    margin-bottom: 8px !important;
  }
}
.dynamic-funnel-question > p {
  display:block; font-size:13px; color:#6b7280; margin-bottom:10px;
}

.dynamic-funnel-question > span {
  font-size: 12px;
  font-weight: 400;
  display: block;
  line-height: 1.6;
  margin-bottom: .75rem;
}

.dynamic-funnel-question > input {
  margin: 8px 0;
}

.dynamic-funnel-options button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  cursor: pointer;
  font-size: 15px;
  text-align: left;
}

.dynamic-funnel-options button.selected {
  background: var(--primary);
  color: #fff;
}


  .dynamic-funnel-nav-buttons {
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding-top: 16px;
    margin-top: 8px;
    display:flex;
    justify-content:space-between;
    gap: 12px;
  }

  .dynamic-funnel-nav-buttons #dynamic-funnel-prevBtn,
  .dynamic-funnel-nav-buttons #dynamic-funnel-submitPrevBtn {
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-main);
    cursor:pointer;
    font-size: 14px;
    line-height: 1;
    height: 40px;
  }

  .dynamic-funnel-nav-buttons #dynamic-funnel-nextBtn {
    padding: 0 22px;
    border-radius: 999px;
    border: none;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 10px 26px rgba(31, 79, 214, 0.3);
    cursor:pointer;
    font-size: 14px;
    line-height: 1;
    height: 40px;
  }
  
  .dynamic-funnel-nav-buttons div {
    display: flex;
    align-items: center;
  }
  
  .dynamic-funnel-nav-buttons div span {
    font-size: 14px;
    margin-right: 10px;
  }

  .dynamic-funnel-nav-buttons #dynamic-funnel-nextBtn:hover {
    background: var(--primary-dark);
  }


/* RESULT */
.dynamic-funnel-result-box {
  text-align: center;
  padding: 36px 50px 36px;
}

.dynamic-funnel-score {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.4;
}

.dynamic-funnel-score-label {
  font-size: 18px;
  color: var(--text-muted);
}

#dynamic-funnel-resultText {
  text-align: left;
  font-size: 18px !important;
  font-weight: 500;
}

#dynamic-funnel-scoreReasons {
  max-width: 100% !important;
}

.dynamic-funnel-indicator-wrap {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 22px;
}

.dynamic-funnel-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 80px;
}

.dynamic-funnel-indicator-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  margin-bottom: 6px;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease, transform 0.08s ease;
}

.dynamic-funnel-indicator-label {
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.dynamic-funnel-indicator-status {
  width: 100%;
  max-width: 120px;
  margin-top: 4px;
}

.dynamic-funnel-indicator-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.dynamic-funnel-indicator-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.dynamic-funnel-indicator-bar-label {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  /*line-height: 2.5;*/
}

.dynamic-funnel-lead-form {
  margin-top: 32px;
  text-align: left;
  border-top: 1px solid #dcddde;
}

.dynamic-funnel-lead-form .dynamic-funnel-nav-buttons {
  border-top: none;
}

.dynamic-funnel-lead-form h3 {
  text-align: left;
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 400;
}

.dynamic-funnel-lead-form p {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
}

@media (max-width: 576px) {
  .dynamic-funnel-lead-form h3 {

    font-size: 18px;
  }

.dynamic-funnel-lead-form p {
    font-size: 14px;
    line-height: 1.6;
  }
  
  .dynamic-funnel-nav-buttons div {
    position: relative;
  }
  
  .dynamic-funnel-nav-buttons {
    padding-top: 35px;
  }
  
  #dynamic-funnel-error,
  #dynamic-funnel-submit-error {
    display: block;
    position: absolute;
    width: 300px;
    right: 0;
    text-align: right;
    top: -30px;
    margin-right: 0;
    font-size: 12px;
    line-height: 2.4;
  }
}

.dynamic-funnel-lead-form input {
  width: 100% !important;
  padding: 11px 12px !important;
  margin: 6px 0 10px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-subtle) !important;
  font-size: 14px !important;
  box-shadow: none !important;
  color: inherit !important;
}

.dynamic-funnel-lead-form button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(31, 79, 214, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dynamic-funnel-lead-form button#dynamic-funnel-submitBtn::after {
  content: "→";
  font-size: 15px;
}

.dynamic-funnel-lead-form button:hover {
  background: var(--primary-dark);
}

@media (max-width: 640px) {
  /*.dynamic-funnel-hero {
    padding-top: 32px;
  }*/

  .dynamic-funnel-hero h1 {
    font-size: 26px !important;
  }

  .dynamic-funnel-container {
    border-radius: 14px;
    padding: 22px 16px 18px;
  }

  .dynamic-funnel-indicator-wrap {
    gap: 18px;
  }
}

