[data-bs-theme="light"] {
  --bs-primary: #303280;
  --bs-primary-rgb: 48, 50, 128;
  --bs-primary-active: #25275f;
  --merit-navy: #303280;
  --bs-app-bg-color: #f5f6fb;
}

.btn.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-color: #ffffff;
  --bs-btn-hover-bg: var(--bs-primary-active);
  --bs-btn-hover-border-color: var(--bs-primary-active);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: var(--bs-primary-active);
  --bs-btn-active-border-color: var(--bs-primary-active);
  --bs-btn-active-color: #ffffff;
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

.text-primary {
  color: var(--bs-primary) !important;
}
.bg-primary {
  background-color: var(--bs-primary) !important;
}

.survey-preview-root {
  --survey-bg: linear-gradient(135deg, #303280 0%, #1b1c3d 100%);
  position: relative;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: var(--survey-bg);
}

.theme-merit-navy {
  --survey-bg: linear-gradient(135deg, #303280 0%, #1b1c3d 100%);
  --bs-primary: #303280;
  --bs-primary-rgb: 48, 50, 128;
  --bs-primary-active: #25275f;
}

.theme-ocean-teal {
  --survey-bg: linear-gradient(135deg, #0e7490 0%, #164e63 100%);
  --bs-primary: #06b6d4;
  --bs-primary-rgb: 6, 182, 212;
  --bs-primary-active: #0891b2;
}

.theme-royal-burgundy {
  --survey-bg: linear-gradient(135deg, #7c2d12 0%, #431407 100%);
  --bs-primary: #b91c1c;
  --bs-primary-rgb: 185, 28, 28;
  --bs-primary-active: #7f1d1d;
}

.theme-luxury-gold {
  --survey-bg: linear-gradient(135deg, #1c1917 0%, #000000 100%);
  --bs-primary: #d4a574;
  --bs-primary-rgb: 212, 165, 116;
  --bs-primary-active: #b08855;
}

.survey-preview-root #previewBody .card.card-bordered {
  --bs-card-bg: rgba(var(--bs-primary-rgb), 0.07);
  background-color: rgba(var(--bs-primary-rgb), 0.07);
  border-color: rgba(var(--bs-primary-rgb), 0.22);
}

.pattern-bubbles::before,
.pattern-bubbles::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.03) 70%
  );
}

.pattern-bubbles::before {
  width: 480px;
  height: 480px;
  top: -150px;
  right: -120px;
}

.pattern-bubbles::after {
  width: 360px;
  height: 360px;
  bottom: -140px;
  left: -110px;
}

.pattern-stripes::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05) 0 22px,
    transparent 22px 44px
  );
}

.pattern-dots::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.22) 2.2px, transparent 2.2px);
  background-size: 28px 28px;
}

.survey-preview-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
}

.survey-preview-content {
  margin: auto;
}

.survey-preview-stage #previewBody {
  background: var(--bs-body-bg);
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px rgba(27, 28, 61, 0.28);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  max-width: 700px;
  transition: max-width 0.3s ease;
  position: relative;
  overflow-wrap: anywhere;
}

.survey-preview-stage #previewBody.pv-narrow {
  max-width: 480px;
}

.survey-preview-stage .pv-sheet {
  background: var(--bs-body-bg);
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px rgba(27, 28, 61, 0.28);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  max-width: 700px;
  transition: max-width 0.3s ease;
}

.survey-preview-stage .pv-sheet.pv-narrow {
  max-width: 480px;
}

.pv-intro-logo {
  height: 160px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(27, 28, 61, 0.2));
}

.pv-intro-title {
  color: var(--bs-primary);
}

.pv-field.pv-invalid .select2-selection,
.pv-field.pv-invalid .form-select {
  border-color: var(--bs-danger) !important;
  box-shadow: 0 0 0 1px var(--bs-danger) !important;
}

.js-pv-answer.form-control.pv-invalid,
.js-pv-answer.form-select.pv-invalid,
.js-pv-answer.pv-invalid .form-control,
.js-pv-answer.pv-invalid .form-select {
  border-color: var(--bs-danger) !important;
  box-shadow: 0 0 0 1px var(--bs-danger) !important;
}

.survey-preview-stage .form-control,
.survey-preview-stage .select2-selection {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}

.survey-preview-stage .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15);
}

.pv-done-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--bs-success),
    color-mix(in srgb, var(--bs-success) 75%, #000)
  );
  box-shadow: 0 16px 36px rgba(var(--bs-success-rgb), 0.35);
  animation: pv-done-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pv-done-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pv-done-badge {
    animation: none;
  }
}

.survey-progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.survey-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.4s ease;
}

.survey-progress-logo {
  position: absolute;
  top: 50%;
  left: 0;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 16px rgba(27, 28, 61, 0.4);
  transition: left 0.4s ease;
}

.survey-progress-logo img {
  width: 22px;
  height: 22px;
}

.pv-qnum {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
}

#previewBody .form-check-label,
#previewBody .form-label {
  color: var(--bs-body-color);
  opacity: 1;
}

.pv-option {
  padding: 0.7rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.65rem;
  background: var(--bs-body-bg);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.pv-option .form-check-input {
  margin-top: 0;
}

.pv-option .form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.pv-option:hover {
  border-color: var(--bs-primary);
}

.pv-option:has(.form-check-input:checked) {
  border-color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.06);
}

.pv-sort-item {
  cursor: grab;
}

.pv-sort-item.sortable-chosen {
  cursor: grabbing;
}

.pv-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  font-size: 2rem;
  line-height: 1;
}

.pv-rating .pv-star {
  cursor: pointer;
  color: var(--bs-gray-300);
  transition: color 0.12s ease;
  margin-bottom: 0;
}

.pv-rating .pv-star:hover,
.pv-rating .pv-star:hover ~ .pv-star,
.pv-rating input:checked ~ .pv-star {
  color: var(--bs-warning);
}
