/* ─── Survey Page Transitions ─── */
@keyframes surveyPageEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.survey-page-enter-forward,
.survey-page-enter-back {
  animation: surveyPageEnter 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ─── Survey Page Break (canvas preview) ─── */
.survey-page-break {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 24px;
}

.survey-page-break::before,
.survey-page-break::after {
  content: '';
  flex: 1;
  height: 1px;
  border-top: 1px dashed rgba(232,85,61,.35);
}

.survey-page-break-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.survey-page-break-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.survey-page-break-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ─── Survey Progress Bar ─── */
.survey-progress {
  width: 100%;
  height: 4px;
  background: var(--surface-warm);
  border-radius: 99px;
  margin-bottom: 20px;
  overflow: hidden;
}

.survey-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .35s ease;
}

/* ─── Survey Thanks Preview (canvas) ─── */
.survey-thanks-preview {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  padding: 20px 0 4px;
  font-family: var(--font-display);
}

/* ─── Survey Page Navigation ─── */
.survey-page-nav {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-survey-back {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-warm);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.btn-survey-back:hover {
  background: var(--surface);
  border-color: var(--ink-muted);
}

.btn-survey-next,
.btn-survey-submit-nav {
  flex: 2;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: background .2s;
}

.btn-survey-next:hover,
.btn-survey-submit-nav:hover { background: var(--accent-hover); }
.btn-survey-submit-nav:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Survey Section Divider (preview & reviewer) ─── */
.survey-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 24px;
}

.survey-section-divider::before,
.survey-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-warm);
}

.survey-section-name {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Survey template loading state ─── */
.survey-template-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 14px;
  margin: auto;
}

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

.spin {
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ─── Survey Canvas Card (marketer preview in main canvas) ─── */
.survey-canvas-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  width: 100%;
  max-width: 520px;
  padding: 40px;
  margin: 0 auto;
}

.survey-canvas-card .survey-title { margin-bottom: 10px; }

/* ─── Survey section fills available height, centers content ─── */
#surveySection.survey-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;       /* fallback */
  justify-content: safe center;  /* modern: falls back to flex-start on overflow */
  padding: 40px 0;
}


/* ─── Survey Section (Reviewer page) ─── */
.survey-section {
  flex-shrink: 0;
  width: calc(100% - 48px);
  max-width: 540px;
  padding: 40px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* ─── White-label Logo ─── */
.survey-wl-logo {
  display: block;
  max-height: 40px;
  max-width: 160px;
  object-fit: contain;
  margin-bottom: 16px;
}

.survey-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.survey-intro {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 28px;
  white-space: pre-wrap;
}

.survey-question {
  margin-bottom: 24px;
}

.survey-question-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.4;
}

.survey-required-star {
  color: #e8553d;
  font-weight: 700;
}

.survey-question--error .survey-text-input,
.survey-question--error .survey-rating,
.survey-question--error .survey-choices {
  border-color: #e8553d;
  box-shadow: 0 0 0 2px rgba(232, 85, 61, .15);
  border-radius: var(--radius-sm);
}

.survey-required-msg {
  color: #e8553d;
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
}

.survey-text-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--surface-warm);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  transition: border-color .2s;
}

.survey-text-input:focus { border-color: var(--accent); }

.survey-rating {
  display: flex;
  gap: 8px;
}

.survey-rating-btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--surface-warm);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.survey-rating-btn:hover,
.survey-rating-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.survey-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.survey-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--surface-warm);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.survey-choice:hover { border-color: rgba(232,85,61,.4); background: var(--accent-glow); }

.survey-choice.selected { border-color: var(--accent); background: var(--accent-glow); }

.survey-choice input[type="radio"] {
  accent-color: var(--accent);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.survey-choice-label {
  font-size: 14px;
  color: var(--ink);
}

.btn-survey-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background .2s, transform .1s;
}

.btn-survey-submit:hover { background: var(--accent-hover); }
.btn-survey-submit:active { transform: scale(.98); }
.btn-survey-submit:disabled { opacity: .5; cursor: not-allowed; }

.survey-thanks {
  text-align: center;
  padding: 48px 24px;
}

.survey-thanks-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.survey-thanks-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.survey-thanks-sub {
  font-size: 14px;
  color: var(--ink-muted);
}

/* ─── Product Part Block (canvas preview) ─── */
.survey-part-block {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 24px;
  padding: 14px;
  background: var(--surface);
  border: 1px dashed rgba(255,169,0,.35);
  border-radius: var(--radius-sm);
  text-align: center;
}

.survey-part-block-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FFA900;
}

.survey-part-block--ad {
  border-color: rgba(232,85,61,.35);
}

.survey-part-block-label--ad {
  color: var(--accent);
}

/* ─── Ad Review hint (canvas page-break) ─── */
.survey-ad-review-hint {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 6px;
}

/* ─── Ad Format Switch Hint ─── */
.format-switch-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

@media (max-width: 600px) {
  .format-switch-hint {
    margin: 16px 0 0;
  }
}

/* ─── Ad Review Placement Tabs (within survey) ─── */
.survey-ad-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-warm);
  border-radius: 10px;
  padding: 4px;
  margin: 0 auto 12px;
  width: fit-content;
}

@keyframes format-tabs-attention {
  0%   { box-shadow: 0 0 0 0   rgba(232, 85, 61, 0.55); }
  25%  { box-shadow: 0 0 0 9px rgba(232, 85, 61, 0.08); }
  50%  { box-shadow: 0 0 0 0   rgba(232, 85, 61, 0.55); }
  75%  { box-shadow: 0 0 0 9px rgba(232, 85, 61, 0.08); }
  100% { box-shadow: 0 0 0 0   rgba(232, 85, 61, 0); }
}

.survey-ad-tabs.tabs-pulse {
  animation: format-tabs-attention 4s ease-in-out forwards;
}

/* ─── Ad Review Preview Area (within survey) ─── */
.survey-ad-preview-area {
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ─── Mobile: Survey ─── */
@media (max-width: 600px) {

  /* ── Unified survey container ── */
  #surveySection.survey-active {
    position: relative;
    padding: 0;
    align-items: stretch;
    justify-content: center;
    min-height: calc(100dvh - 44px);
  }

  /* Make .reviewer-split chain a transparent full-width pass-through */
  .reviewer-split {
    align-items: stretch;
  }

  .reviewer-split-cols {
    flex-direction: column;
    align-items: stretch;
  }

  .reviewer-split-survey {
    align-items: stretch;
  }

  /* ── Progress bar: pinned to top ── */
  .reviewer-split-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    border-radius: 0;
    margin: 0;
    z-index: 5;
  }

  /* ── All survey cards: uniform full-width style ── */
  .survey-section,
  .reviewer-split-survey .survey-section {
    width: 100%;
    max-width: 100%;
    padding: 24px 20px;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
  }

  /* ── Larger fonts for readability on mobile ── */
  .survey-title { font-size: 24px; }
  .survey-intro { font-size: 16px; }
  .survey-question-label { font-size: 16px; }
  .survey-text-input { font-size: 16px; }
  .survey-choice-label { font-size: 16px; }
  .btn-survey-submit { font-size: 17px; }

  /* Ad review page: break out to full viewport width */
  .survey-section--ad-review {
    width: 100vw;
    padding: 16px 0;
    background: transparent;
  }

  .survey-section--ad-review .survey-title {
    text-align: center;
    padding: 0 16px;
  }

  .survey-section--ad-review .survey-ad-tabs {
    margin: 0 auto 12px;
  }

  .survey-section--ad-review .survey-page-nav {
    margin: 16px 16px 0;
  }

  .survey-ad-preview-area {
    width: 100vw;
    overflow: hidden;
  }

  .survey-ad-preview-area .fb-card {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    box-shadow: none;
  }

  .survey-ad-preview-area .stories-card {
    width: 100vw;
    height: calc(100vw * 16 / 9);
    border-radius: 0;
  }
}

/* ─── Product Parts (reviewer) ─── */
.product-parts-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pp-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.pp-about-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.pp-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.pp-description-wrap {
  position: relative;
}

.pp-description-toggle {
  display: none;
}

@media (max-width: 899px) {
  .pp-description--clamped {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }

  .pp-description-toggle {
    display: inline;
    background: none;
    border: none;
    padding: 4px 0 0;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
  }

  .pp-description-toggle:hover {
    text-decoration: underline;
  }
}

.pp-toggle-chevron {
  vertical-align: middle;
  margin-left: 2px;
  transition: transform .2s;
}

.pp-toggle-chevron--up {
  transform: rotate(180deg);
}

.pp-carousel {
  position: relative;
}

.pp-carousel-track {
  position: relative;
  width: 100%;
  min-width: 500px;
  min-height: 500px;
  aspect-ratio: 1;
  background: #fafafa;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

@media (max-width: 899px) {
  .pp-carousel-track {
    min-width: 0;
    min-height: 0;
  }
}

.pp-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.pp-carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.pp-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 0;
}

.pp-carousel-arrow {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15);
  background: white;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, border-color .15s;
}

.pp-carousel-arrow:hover {
  background: rgba(0,0,0,.06);
  border-color: rgba(0,0,0,.3);
}

.pp-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0,0,0,.15);
  cursor: pointer;
  transition: background .15s;
}

.pp-carousel-dot.active { background: var(--ink); }
.pp-carousel-dot:hover:not(.active) { background: rgba(0,0,0,.3); }

.pp-listing-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.pp-listing-link:hover { text-decoration: underline; }

/* Mobile/desktop visibility for product parts */
.pp-desktop-only { display: flex; }
.pp-mobile-only { display: none; }

@media (max-width: 899px) {
  .pp-desktop-only { display: none !important; }
  .pp-mobile-only {
    display: flex !important;
    margin-bottom: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--surface-warm);
  }

  .pp-mobile-flush-top {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: -24px;
    margin-left: -20px;
    margin-right: -20px;
  }

  .pp-mobile-flush-top .pp-carousel-track {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }
}

/* ─── Amazon Side Panel (desktop question pages) ─── */
.reviewer-split-amazon {
  display: none; /* hidden on mobile — use "View Listing" button instead */
}

@media (min-width: 900px) {
  .reviewer-split-amazon {
    display: flex;
    flex-direction: column;
  }
}

.amazon-side-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.amazon-side-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.amazon-side-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-glow);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.amazon-side-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.amazon-side-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
  align-self: flex-start;
}

.amazon-side-cta:hover { background: var(--accent-hover); }

.amazon-side-url {
  font-size: 11px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  width: 100%;
}

.amazon-side-no-url {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
}

/* ─── Amazon Review Card ─── */
.amazon-review-card {
  width: 100%;
  max-width: 480px;
  margin: 8px auto 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  background: white;
}

.amazon-review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.amazon-review-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.amazon-review-eyebrow {
  font-size: 15px;
  font-weight: 700;
  color: white;
  letter-spacing: .01em;
}

.amazon-review-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.amazon-review-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.amazon-review-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 8px;
}

.amazon-review-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--accent);
  color: white;
  border-radius: 99px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .15s;
  align-self: flex-start;
}

.amazon-review-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.amazon-review-cta:active { transform: translateY(0); }

.amazon-review-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--ink-muted);
}

.amazon-review-url-row svg { flex-shrink: 0; }

.amazon-review-url-row span {
  font-size: 11px;
  word-break: break-all;
  line-height: 1.4;
}

.amazon-review-no-url {
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
}

@media (max-width: 600px) {
  .amazon-review-cta {
    align-self: stretch;
    justify-content: center;
  }
}
