/**
 * Alive4Health Wellness Quiz (popup / embed)
 */
.a4h-wellness-quiz {
  --a4h-quiz-green: #2e8b57;
  --a4h-quiz-green-light: #eaf5ee;
  --a4h-quiz-green-mid: #5ab37a;
  --a4h-quiz-cream: #faf8f4;
  --a4h-quiz-text: #1a1a1a;
  --a4h-quiz-muted: #777;
  --a4h-quiz-border: #e0ddd8;
  --a4h-quiz-white: #fff;
  --a4h-quiz-radius: 14px;
  --a4h-quiz-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
  --a4h-quiz-pad-x: 1.5rem;
  --a4h-quiz-pad-card: 2.5rem;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--a4h-quiz-text);
  width: 100%;
  max-width: min(620px, 100%);
  margin: 0 auto;
  -webkit-text-size-adjust: 100%;
}

.a4h-wellness-quiz *,
.a4h-wellness-quiz *::before,
.a4h-wellness-quiz *::after {
  box-sizing: border-box;
}

.a4h-wellness-quiz__brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.a4h-wellness-quiz__brand-name {
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--a4h-quiz-green);
  text-transform: uppercase;
}

.a4h-wellness-quiz__card {
  background: var(--a4h-quiz-white);
  border-radius: var(--a4h-quiz-radius);
  box-shadow: var(--a4h-quiz-shadow);
  padding: var(--a4h-quiz-pad-card);
  border: 1px solid var(--a4h-quiz-border);
}

.a4h-wellness-quiz__progress-bar {
  height: 3px;
  background: var(--a4h-quiz-border);
  border-radius: 99px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.a4h-wellness-quiz__progress-fill {
  height: 100%;
  background: var(--a4h-quiz-green);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.a4h-wellness-quiz__step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--a4h-quiz-muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.a4h-wellness-quiz__question {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.25rem, 4.5vw, 1.6rem);
  line-height: 1.3;
  color: var(--a4h-quiz-text);
  margin-bottom: 1.75rem;
  overflow-wrap: break-word;
}

.a4h-wellness-quiz__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 2rem;
}

.a4h-wellness-quiz__opt {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 1rem 1.25rem;
  min-height: 48px;
  border: 1.5px solid var(--a4h-quiz-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--a4h-quiz-text);
  background: var(--a4h-quiz-white);
  text-align: left;
  line-height: 1.4;
  width: 100%;
}

.a4h-wellness-quiz__opt:hover {
  border-color: var(--a4h-quiz-green-mid);
  background: var(--a4h-quiz-green-light);
}

.a4h-wellness-quiz__opt.is-selected {
  border-color: var(--a4h-quiz-green);
  background: var(--a4h-quiz-green-light);
}

.a4h-wellness-quiz__opt-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--a4h-quiz-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.a4h-wellness-quiz__opt.is-selected .a4h-wellness-quiz__opt-dot {
  border-color: var(--a4h-quiz-green);
  background: var(--a4h-quiz-green);
}

.a4h-wellness-quiz__opt.is-selected .a4h-wellness-quiz__opt-dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  display: block;
}

.a4h-wellness-quiz__btn {
  width: 100%;
  min-height: 48px;
  padding: 1rem;
  background: var(--a4h-quiz-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.a4h-wellness-quiz__btn:hover {
  background: #257347;
  color: #fff;
}

.a4h-wellness-quiz__btn:active {
  transform: scale(0.99);
}

.a4h-wellness-quiz__btn:disabled {
  background: var(--a4h-quiz-border);
  color: var(--a4h-quiz-muted);
  cursor: not-allowed;
}

.a4h-wellness-quiz__btn.is-loading {
  opacity: 0.85;
  cursor: wait;
}

.a4h-wellness-quiz__email-intro {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.a4h-wellness-quiz__email-sub {
  font-size: 0.9rem;
  color: var(--a4h-quiz-muted);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.a4h-wellness-quiz__field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--a4h-quiz-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
  display: block;
  line-height: 1.3;
}

.a4h-wellness-quiz__field-label + .a4h-wellness-quiz__field {
  margin-top: 0;
}

.a4h-wellness-quiz__field + .a4h-wellness-quiz__field-label {
  margin-top: 1.15rem;
}

/* Reset theme/Divi/Woo input styles inside quiz */
.a4h-wellness-quiz input.a4h-wellness-quiz__field,
.a4h-wellness-quiz input[type="text"].a4h-wellness-quiz__field,
.a4h-wellness-quiz input[type="email"].a4h-wellness-quiz__field {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto;
  min-height: 48px;
  margin: 0 0 1.15rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--a4h-quiz-border) !important;
  border-radius: 999px !important;
  background: var(--a4h-quiz-white) !important;
  background-image: none !important;
  box-shadow: none !important;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--a4h-quiz-text) !important;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.a4h-wellness-quiz__field::placeholder {
  color: #b0b0b0;
  opacity: 1;
}

.a4h-wellness-quiz__field::-webkit-input-placeholder {
  color: #b0b0b0;
}

.a4h-wellness-quiz__field:focus {
  border-color: var(--a4h-quiz-green) !important;
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.12) !important;
}

.a4h-wellness-quiz__field.is-error {
  border-color: #e24b4a !important;
  box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.12) !important;
}

.a4h-wellness-quiz__field.is-error:focus {
  border-color: #e24b4a !important;
  box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.15) !important;
}

.a4h-wellness-quiz__privacy {
  font-size: 0.78rem;
  color: var(--a4h-quiz-muted);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.45;
}

.a4h-wellness-quiz__form-error {
  font-size: 0.85rem;
  color: #c0392b;
  margin-bottom: 0.75rem;
  text-align: center;
}

.a4h-wellness-quiz__result-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a4h-quiz-green);
  background: var(--a4h-quiz-green-light);
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}

.a4h-wellness-quiz__result-title {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  line-height: 1.25;
  margin-bottom: 0.7rem;
  overflow-wrap: break-word;
}

.a4h-wellness-quiz__result-desc {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.a4h-wellness-quiz__products-label {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--a4h-quiz-muted);
  margin-bottom: 0.75rem;
}

.a4h-wellness-quiz__products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.75rem;
}

.a4h-wellness-quiz__product-pill {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: var(--a4h-quiz-green-light);
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.a4h-wellness-quiz__product-pill:hover {
  background: #dff0e6;
}

.a4h-wellness-quiz__check {
  width: 18px;
  height: 18px;
  background: var(--a4h-quiz-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.a4h-wellness-quiz__check::after {
  content: "";
  width: 6px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  display: block;
}

.a4h-wellness-quiz__product-name {
  font-weight: 500;
  color: var(--a4h-quiz-text);
}

.a4h-wellness-quiz__product-ben {
  font-size: 0.8rem;
  color: var(--a4h-quiz-muted);
}

.a4h-wellness-quiz__discount-box {
  background: var(--a4h-quiz-green);
  color: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.a4h-wellness-quiz__discount-code {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-bottom: 0.3rem;
}

.a4h-wellness-quiz__discount-note {
  font-size: 0.82rem;
  opacity: 0.85;
}

.a4h-wellness-quiz__btn-outline {
  width: 100%;
  padding: 1rem;
  background: transparent;
  color: var(--a4h-quiz-green);
  border: 1.5px solid var(--a4h-quiz-green);
  border-radius: 10px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.6rem;
}

.a4h-wellness-quiz__btn-outline:hover {
  background: var(--a4h-quiz-green-light);
}

/* Tablet */
@media (max-width: 768px) {
  .a4h-wellness-quiz {
    --a4h-quiz-pad-card: 2rem 1.5rem;
  }

  .a4h-wellness-quiz__brand {
    margin-bottom: 1rem;
  }

  .a4h-wellness-quiz__progress-bar {
    margin-bottom: 1.5rem;
  }

  .a4h-wellness-quiz__options {
    margin-bottom: 1.5rem;
  }

  .a4h-wellness-quiz__email-intro {
    font-size: 1.35rem;
  }

  .a4h-wellness-quiz__discount-box {
    padding: 1.1rem 1.25rem;
  }
}

/* Phone */
@media (max-width: 480px) {
  .a4h-wellness-quiz {
    --a4h-quiz-pad-card: 1.35rem 1.1rem;
    --a4h-quiz-radius: 12px;
  }

  .a4h-wellness-quiz__brand {
    margin-bottom: 0.75rem;
  }

  .a4h-wellness-quiz__brand-name {
    font-size: 11px;
  }

  .a4h-wellness-quiz__progress-bar {
    margin-bottom: 1.25rem;
  }

  .a4h-wellness-quiz__step-label {
    font-size: 11px;
    margin-bottom: 0.5rem;
  }

  .a4h-wellness-quiz__question {
    margin-bottom: 1.25rem;
  }

  .a4h-wellness-quiz__options {
    gap: 8px;
    margin-bottom: 1.25rem;
  }

  .a4h-wellness-quiz__opt {
    gap: 12px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  .a4h-wellness-quiz__opt-dot {
    width: 20px;
    height: 20px;
    margin-top: 2px;
  }

  .a4h-wellness-quiz__btn,
  .a4h-wellness-quiz__btn-outline {
    font-size: 0.95rem;
    padding: 0.9rem 1rem;
  }

  .a4h-wellness-quiz__email-intro {
    font-size: 1.2rem;
  }

  .a4h-wellness-quiz__email-sub {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .a4h-wellness-quiz input.a4h-wellness-quiz__field,
  .a4h-wellness-quiz input[type="text"].a4h-wellness-quiz__field,
  .a4h-wellness-quiz input[type="email"].a4h-wellness-quiz__field {
    font-size: 16px;
    padding: 0.7rem 1.1rem;
    margin-bottom: 1rem;
  }

  .a4h-wellness-quiz__field + .a4h-wellness-quiz__field-label {
    margin-top: 1rem;
  }

  .a4h-wellness-quiz__privacy {
    font-size: 0.72rem;
  }

  .a4h-wellness-quiz__result-title {
    margin-bottom: 0.5rem;
  }

  .a4h-wellness-quiz__result-desc {
    font-size: 0.9rem;
    margin-bottom: 1.35rem;
  }

  .a4h-wellness-quiz__products {
    margin-bottom: 1.35rem;
  }

  .a4h-wellness-quiz__product-pill {
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
  }

  .a4h-wellness-quiz__discount-code {
    font-size: 1.35rem;
  }

  .a4h-wellness-quiz__discount-box {
    margin-bottom: 1.25rem;
  }
}

/* Small phones */
@media (max-width: 360px) {
  .a4h-wellness-quiz {
    --a4h-quiz-pad-card: 1.15rem 0.9rem;
  }

  .a4h-wellness-quiz__opt {
    padding: 0.75rem 0.85rem;
    font-size: 0.875rem;
  }
}

/* Modal popup (#ttquiz opens #a4h-popup-wrap) */
body.a4h-quiz-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

#a4h-popup-wrap,
.a4h-popup-wrap {
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(1rem, env(safe-area-inset-top, 0))
    max(0.75rem, env(safe-area-inset-right, 0))
    max(1rem, env(safe-area-inset-bottom, 0))
    max(0.75rem, env(safe-area-inset-left, 0));
  z-index: 100000;
}

#a4h-popup-wrap #a4h-popup,
.a4h-popup-wrap #a4h-popup {
  width: 100%;
  max-width: min(620px, 100%);
  max-height: none;
  overflow: visible;
  margin: 0 auto;
}

#a4h-popup-wrap .a4h-wellness-quiz,
.a4h-popup-wrap .a4h-wellness-quiz {
  padding: 0.25rem 0 0.75rem;
}

#a4h-popup-wrap .a4h-close,
.a4h-popup-wrap .a4h-close {
  top: max(0.5rem, env(safe-area-inset-top, 0));
  right: max(0.5rem, env(safe-area-inset-right, 0));
  width: 40px;
  height: 40px;
}

@media (max-width: 768px) {
  #a4h-popup-wrap,
  .a4h-popup-wrap {
    align-items: flex-start;
    padding-top: max(0.75rem, env(safe-area-inset-top, 0));
  }

  #a4h-popup-wrap #a4h-popup,
  .a4h-popup-wrap #a4h-popup {
    max-height: none;
  }

  #a4h-popup-wrap .a4h-wellness-quiz,
  .a4h-popup-wrap .a4h-wellness-quiz {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  #a4h-popup-wrap,
  .a4h-popup-wrap {
    padding-left: max(0.5rem, env(safe-area-inset-left, 0));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0));
  }

  #a4h-popup-wrap .a4h-close,
  .a4h-popup-wrap .a4h-close {
    width: 36px;
    height: 36px;
    right: max(0.35rem, env(safe-area-inset-right, 0));
  }
}
