/* =========================================
   CSS 1: FARBEN & VARIABLEN
   ========================================= */
:root {
  --test-section-bg: #ebe5dc;
  --question-card-bg: #fbf8f3;
  --answer-bg: #f9f6f1;
  --answer-bg-hover: #fdfaf6;
  --answer-selected-bg: #fcfaf5;

  --question-cta-bg: #c2a085;
  --question-cta-hover: #b69377;
  --question-cta-text: #fcfbf8;
  --question-cta-shadow: rgba(191, 143, 102, 0.06);

  --back-btn-bg: #f6f0e8;
  --back-btn-border: #cdc0b0;
  --back-btn-text: #4f5961;

  --question-shell-border: rgba(155, 102, 72, 0.08);
  --question-shell-shadow: rgba(44, 44, 44, 0.05);

  --answer-border: #ddd4c8;
  --answer-border-strong: #9eaf9b;
  --answer-selected-ring: rgba(95, 133, 98, 0.12);
  --answer-selected-shadow: rgba(79, 116, 84, 0.06);

  --radio-size: 18px;
  --radio-border: #afbaac;
  --radio-border-active: #5f8562;
  --radio-dot: #5f8562;
  --radio-dot-size: 9px;

  --error-text: #a06a4a;
  --error-bg: rgba(196, 149, 106, 0.10);
  --error-border: rgba(196, 149, 106, 0.25);

  --result-bg: #fbfaf7;
  --result-border: rgba(0, 0, 0, 0.07);
  --result-shadow: rgba(0, 0, 0, 0.05);

  --progress-track: rgba(79, 116, 84, 0.10);
  --progress-fill: #8fa893;
}

/* =========================================
   CSS 2: TESTLAYOUT
   ========================================= */
.test-section {
  background: var(--test-section-bg);
  padding: 0 0 12px;
  padding-top: clamp(28px, 5vw, 48px);
  border-top: none;
  flex: 1 0 auto;
  display: flex;
}

.test-shell {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  min-height: 100%;
  width: 100%;
}

#test-root {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-top: 24px;
}

/* =========================================
   CSS 3: FRAGEN / PROGRESS
   ========================================= */
.question {
  display: none;
  width: 100%;
  background: var(--question-card-bg);
  border: 1px solid var(--question-shell-border);
  border-radius: 22px;
  padding: 40px 34px 26px;
  box-shadow: 0 12px 32px var(--question-shell-shadow);
}

.question.active {
  display: flex;
  flex-direction: column;
  min-height: auto;
}

.question.entering {
  animation: questionFadeIn 0.35s ease;
}

@keyframes questionFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress-wrap {
  margin-bottom: 34px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--sage-deep);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.9;
}

.progress-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--progress-track);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--progress-fill);
  transition: width .25s ease;
}

.question-kicker {
  display: block;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sage-deep);
  opacity: 0.92;
}

.question h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: clamp(20px, 6.8vw, 30px);
  line-height: 1.3;
}

.question-intro {
  margin-top: 0;
  margin-bottom: 30px;
  font-size: 0.95rem;
  display: block;
  line-height: 1.5;
  color: var(--mid);
  font-style: italic;
  opacity: 0.92;
}

/* =========================================
   CSS 4: ANTWORTEN
   ========================================= */
.answer-list {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
}

.answer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px 15px 22px;
  border: 1px solid var(--answer-border);
  border-radius: 18px;
  background: var(--answer-bg);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.answer:hover {
  border-color: var(--answer-border-strong);
  background: var(--answer-bg-hover);
}

.answer input {
  appearance: none;
  -webkit-appearance: none;
  width: var(--radio-size);
  height: var(--radio-size);
  min-width: var(--radio-size);
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--radio-border);
  background: transparent;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.answer input::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--radio-dot-size);
  height: var(--radio-dot-size);
  border-radius: 50%;
  background: var(--radio-dot);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform .14s ease, opacity .14s ease;
}

.answer input:checked {
  border-color: var(--radio-border-active);
  box-shadow: 0 0 0 3px rgba(95, 133, 98, 0.12);
}

.answer input:checked::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.answer.selected {
  border-color: var(--answer-border-strong);
  background: var(--answer-selected-bg);
  box-shadow:
    0 0 0 2px var(--answer-selected-ring),
    0 4px 12px var(--answer-selected-shadow);
}

.answer input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.answer span {
  display: block;
  font-size: 17px;
  line-height: 1.5;
  color: var(--charcoal);
}

/* =========================================
   CSS 5: TESTNAVIGATION
   ========================================= */
.question-actions {
  margin-top: 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.question-actions-first {
  justify-content: flex-end;
}

.question-actions-first .btn-secondary {
  display: none;
}

.question-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.btn-secondary {
  background: var(--back-btn-bg);
  color: var(--back-btn-text);
  border: 1px solid var(--back-btn-border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: #efe6db;
  border-color: #c3b29f;
  color: var(--charcoal);
}

.question-actions button:not(.btn-secondary) {
  background: var(--question-cta-bg);
  color: var(--question-cta-text);
  border: 1px solid rgba(155, 102, 72, 0.08);
  box-shadow: 0 6px 16px var(--question-cta-shadow);
}

.question-actions button:not(.btn-secondary):hover {
  background: var(--question-cta-hover);
}

/* =========================================
   CSS 6: FEHLERMELDUNG
   ========================================= */
.error-message {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  height: 0;
  overflow: hidden;
}

.error-message.show {
  display: block;
  height: auto;
  overflow: visible;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--error-border);
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 14px;
  line-height: 1.4;
}

/* =========================================
   CSS 7: ERGEBNIS
   ========================================= */
#esResult {
  display: none;
  max-width: 860px;
  margin: 0 auto;
  background: var(--warm-white);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  padding: 32px 32px 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.test-section.result-view {
  align-items: flex-start;
}

#esResetBtn {
  display: none !important;
}

.es-result-eyebrow {
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #9a9d99;
  margin-bottom: 10px;
}

#esResultTitle {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.12;
  font-weight: 500;
  color: var(--accent-deep);
  margin: 0 0 14px;
  letter-spacing: 0.2px;
}

#esResultBody {
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--mid);
  max-width: 860px;
}

#esResultBody p {
  margin: 0 0 14px;
}

#esResultBody strong {
  color: var(--charcoal);
  font-weight: 600;
}

.es-result-copy {
  max-width: none;
}

.es-result-lead,
.es-result-next {
  font-family: "DM Sans", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--charcoal);
  font-weight: 400;
}

.es-result-lead {
  margin-bottom: 14px;
}

.es-result-next {
  margin-bottom: 18px;
}

.es-result-moment {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.4;
  font-weight: 500;
  color: var(--accent-deep);
  margin-top: 16px;
  margin-bottom: 2px !important;
  text-align: left;
  opacity: 0.9;
}

.es-highlight {
  font-weight: 600;
  color: var(--accent-deep);
}

.es-insights {
  display: grid;
  gap: 12px;
  margin: 28px 0 30px;
}

.es-insight {
  background: #f7f3ed;
  border: 1px solid #e7ddd2;
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--mid);
  line-height: 1.55;
}

.es-insight strong {
  color: var(--charcoal);
  font-weight: 600;
}

.es-mail-intro,
.es-email-hint {
  margin: 26px 0 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--charcoal);
  font-weight: 500;
}

.es-followup {
  margin-top: -18px;
  padding-top: 0;
}

.es-formclip {
  max-width: 100%;
  width: 100%;
  padding: 0;
  margin-top: 0;
  border-radius: 0;
}

.es-form {
  margin: 0;
  padding: 0;
  line-height: 0;
}

.es-brevo {
  width: 100%;
  min-height: 420px;
  border-radius: 0;
  margin-top: 0;
  display: block;
}

#es-test-loader {
  display: none;
  margin-top: 12px;
  margin-bottom: 28px;
}

.es-loader-bar {
  width: 100%;
  height: 8px;
  background: var(--progress-track);
  border-radius: 999px;
  overflow: hidden;
}

.es-loader-progress {
  width: 0;
  height: 100%;
  background: var(--progress-fill);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.es-loader-text {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mid);
  text-align: center;
}

.es-loader-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.4) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* =========================================
   CSS 8: MOBILE TEST
   ========================================= */
@media (max-width: 700px) {
  .test-section {
    background: var(--warm-white);
    padding: 0 0 96px;
	padding-top: 36px;
    flex: 1 0 auto;
    display: flex;
  }

  .test-shell {
    max-width: 100%;
    min-height: 100%;
    width: 100%;
  }

  #test-root {
    padding-top: 20px;
    min-height: 100%;
  }

  .question {
    padding: 10px 0 6px;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .progress-wrap {
    margin-bottom: 18px;
  }

  .progress-meta {
    margin-bottom: 9px;
    font-size: 12px;
  }

  .question-kicker {
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .question h2 {
    margin: 0 0 12px;
    font-size: clamp(21px, 6.4vw, 28px);
    line-height: 1.2;
  }

  .question-intro {
    margin: 0 0 26px;
    font-size: 15px;
    line-height: 1.5;
  }

  .answer-list {
    gap: 14px;
    margin-bottom: 22px;
  }

  .answer {
    padding: 14px 14px;
    gap: 12px;
    border-radius: 16px;
  }

  .answer input {
    width: 16px;
    height: 16px;
    min-width: 16px;
  }

  .answer input::after {
    width: 4px;
    height: 4px;
  }

  .answer span {
    font-size: 15px;
    line-height: 1.45;
  }

  .error-message.show {
    margin-top: 10px;
    padding: 9px 12px;
    font-size: 13px;
  }

  .question-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .question-actions-first {
    justify-content: flex-end;
  }

  .question-actions button {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 44px;
  }

  .es-formclip {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin-top: 0;
    border-radius: 0;
  }

  .es-brevo {
    width: 100%;
    min-height: 420px;
    border-radius: 0;
    margin-top: 0;
    display: block;
  }

  .es-followup {
    margin-top: -22px;
    padding-top: 0;
  }

  .es-result-moment {
    font-size: 20px;
    line-height: 1.35;
    margin-top: 10px;
    margin-bottom: -14px !important;
    opacity: 0.9;
  }

  .es-insights {
    gap: 10px;
    margin: 24px 0 26px;
  }

  .es-insight {
    padding: 13px 14px;
    border-radius: 14px;
  }

  #esResult {
    padding: 20px 20px 14px;
    border-radius: 20px;
    background: var(--warm-white);
    box-shadow: none;
    border: none;
  }

  #esResultTitle {
    font-size: 30px;
    line-height: 1.1;
    margin-bottom: 12px;
  }

  #esResultBody {
    font-size: 15px;
    line-height: 1.65;
  }

  .es-result-eyebrow {
    margin-bottom: 10px;
  }

  .es-result-lead,
  .es-result-next {
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 12px;
  }
}