:root {
  --survey-theme-soft: #e8f0fa;
  --survey-shadow: 0 8px 32px rgba(48, 105, 176, 0.12);
  --survey-radius: 12px;
}

body.d-flex.flex-column.min-vh-100 > .container {
  padding-bottom: 0.25rem;
  padding-top: 0.25rem;
}

#surveyPageFooter[hidden] {
  display: none !important;
}

.survey-page {
  margin: 0.5rem auto 0.75rem;
  max-width: 880px;
  padding: 0 0.5rem;
  width: 100%;
}

.survey-box {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--theme-color, #7B57D1) 28%, #ddd);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(40, 24, 72, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.survey-header {
  background: linear-gradient(135deg, var(--theme-color, #3069B0) 0%, #4a84c4 100%);
  color: #fff;
  padding: 1rem 1.25rem;
}

.survey-header-inner {
  align-items: flex-start;
  display: flex;
  gap: 0.85rem;
}

.survey-header-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  flex-shrink: 0;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.survey-header-icon svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 24px;
}

.survey-title {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.25rem;
}

.survey-subtitle {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
  opacity: 0.92;
}

.survey-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.survey-badge {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.2rem 0.65rem;
}

.survey-intro-actions {
  display: flex;
  justify-content: center;
  padding: 0.25rem 1.25rem 0.75rem;
}

.survey-start-button {
  align-items: center;
  background: var(--theme-color, #7B57D1);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-color, #7B57D1) 28%, transparent);
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 56px;
  padding: 0.7rem 1.15rem;
  position: relative;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  width: 100%;
}

.survey-start-button-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.survey-start-button-label {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.survey-start-button-hint {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
}

.survey-start-button-arrow {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
}

.survey-start-button-arrow svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 22px;
}

.survey-start-button:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--theme-color, #7B57D1) 34%, transparent);
}

.survey-start-button:active {
  transform: translateY(1px);
}

.survey-start-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--theme-color, #7B57D1) 35%, transparent);
  outline-offset: 2px;
}

/* Intro hero (mock-based) */
.survey-logo-bar {
  padding: 0.55rem 1.25rem 0.35rem;
}

.survey-logo-bar[hidden] {
  display: none !important;
}

.survey-intro {
  background: #fff;
  border-radius: 18px;
  position: relative;
}

.survey-logo {
  margin: 0;
  padding: 0;
  text-align: center;
}

.survey-logo img {
  background: transparent;
  border-radius: 12px;
  height: auto;
  max-height: 72px;
  max-width: 260px;
  object-fit: contain;
  padding: 0;
  width: auto;
}

.survey-intro-hero {
  padding: 0.15rem 1.25rem 0.35rem;
}

.survey-intro-hero-main {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(110px, 0.7fr);
}

.survey-intro-hero-copy {
  min-width: 0;
}

.survey-intro-title {
  color: #1f1a2e;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

.survey-intro-title-accent {
  color: var(--theme-color, #7B57D1);
}

.survey-intro-lead {
  color: #5c5670;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
  max-width: 26rem;
}

.survey-intro-hero-art {
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.survey-intro-hero-image {
  display: block;
  height: auto;
  max-width: min(100%, 200px);
  object-fit: contain;
  width: 100%;
}

.survey-flow-step[hidden] {
  display: none !important;
}

.survey-iframe-panel {
  background: var(--survey-theme-soft);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 6.5rem);
  min-height: calc(100dvh - 6.5rem);
  padding: 0.5rem 0.75rem 0.75rem;
  position: relative;
}

.survey-iframe-frame {
  background: #fff;
  border: 1px solid rgba(48, 105, 176, 0.2);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.survey-iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.survey-iframe-loader {
  align-items: center;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  inset: 0;
  justify-content: center;
  position: absolute;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2;
}

.survey-iframe-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.survey-spinner {
  animation: survey-spin 0.85s linear infinite;
  border: 3px solid var(--survey-theme-soft);
  border-radius: 50%;
  border-top-color: var(--theme-color, #3069B0);
  height: 44px;
  width: 44px;
}

.survey-loader-text {
  color: #555;
  font-size: 0.95rem;
  margin: 0;
}

.survey-footer-note {
  border-top: 1px solid rgba(48, 105, 176, 0.15);
  color: #666;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 0.85rem 1.5rem;
  text-align: center;
}

.survey-visit-info {
  background: transparent;
  border-bottom: 0;
  padding: 0 1.25rem 0.75rem;
}

.survey-visit-panel {
  background: color-mix(in srgb, var(--theme-color, #7B57D1) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--theme-color, #7B57D1) 18%, #e8e4f2);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
}

.survey-visit-panel-title {
  color: #1f1a2e;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.survey-visit-summary {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.survey-visit-summary-row {
  align-items: flex-start;
  display: flex;
  gap: 0.65rem;
  min-width: 0;
}

.survey-visit-summary-icon {
  align-items: center;
  background: #fff;
  border-radius: 10px;
  color: var(--theme-color, #7B57D1);
  display: inline-flex;
  flex-shrink: 0;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.survey-visit-summary-icon svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 16px;
}

.survey-visit-summary-text {
  color: #1f1a2e;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
  padding-top: 0.3rem;
}

.survey-visit-details {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid color-mix(in srgb, var(--theme-color, #7B57D1) 14%, #e6e2ef);
  border-radius: 12px;
  overflow: hidden;
}

.survey-visit-details-summary {
  align-items: center;
  color: var(--theme-color, #7B57D1);
  cursor: pointer;
  display: flex;
  font-size: 0.9rem;
  font-weight: 650;
  gap: 0.65rem;
  list-style: none;
  padding: 0.7rem 0.85rem;
  user-select: none;
}

.survey-visit-details-summary::-webkit-details-marker {
  display: none;
}

.survey-visit-details-chevron {
  align-items: center;
  display: inline-flex;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.survey-visit-details-chevron svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.survey-visit-details[open] .survey-visit-details-chevron {
  transform: rotate(180deg);
}

.survey-visit-details-body {
  border-top: 1px solid #eeeaf5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1rem 1rem;
}

.survey-visit-details-item .survey-visit-label {
  color: #6b657c;
  font-size: 0.75rem;
}

.survey-visit-details-item .survey-visit-value {
  font-size: 0.95rem;
}

.survey-visit-privacy-lead {
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
  padding: 0.85rem 1.25rem 0.5rem;
}

.survey-visit-privacy {
  background: #f8f7fb;
  border-bottom: 0;
  border-radius: 0 0 17px 17px;
  border-top: 1px solid #eeeaf5;
  padding: 0.85rem 1.25rem 1.15rem;
}

.survey-visit-privacy-header {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.survey-visit-privacy-title {
  color: #374151;
  font-size: 0.9rem;
  font-weight: 650;
}

.survey-visit-privacy-text {
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.survey-visit-privacy-text + .survey-visit-privacy-text {
  margin-top: 0.4rem;
}

.survey-visit-contact {
  background: #faf9fc;
  border: 1px solid #ebe7f2;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.survey-visit-contact-heading {
  align-items: center;
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.survey-visit-contact-title {
  color: var(--theme-color, #7B57D1);
  flex: 1;
  font-size: 0.82rem;
  font-weight: 650;
}

.survey-visit-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.survey-visit-contact-list li {
  align-items: center;
  border-top: 1px solid #ece8f3;
  display: flex;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.4rem 0;
}

.survey-visit-contact-list li:first-child {
  border-top: 0;
  padding-top: 0.25rem;
}

.survey-visit-contact-list li:last-child {
  padding-bottom: 0;
}

.survey-visit-contact-text {
  color: #2c3340;
  font-size: 0.85rem;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
}

a.survey-visit-contact-text:hover {
  color: var(--theme-color, #7B57D1);
  text-decoration: underline;
}

.survey-visit-icon {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  flex-shrink: 0;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.survey-visit-icon--sm {
  border-radius: 6px;
  height: 22px;
  width: 22px;
}

.survey-visit-icon svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 15px;
}

.survey-visit-icon--sm svg {
  height: 12px;
  width: 12px;
}

.survey-visit-icon--blue {
  background: color-mix(in srgb, var(--theme-color, #7B57D1) 12%, #fff);
  color: var(--theme-color, #7B57D1);
}

.survey-visit-icon--purple {
  background: #efe7fb;
  color: #7b4fc4;
}

.survey-visit-icon--green {
  background: #e6f6ed;
  color: #2f9d5d;
}

.survey-visit-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.15rem;
}

.survey-visit-value {
  color: #1f2937;
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.survey-visit-info-address {
  text-transform: capitalize;
}

@media (max-width: 640px) {
  .survey-page {
    margin: 0.35rem auto 0.5rem;
    padding: 0 0.35rem;
  }

  .survey-header {
    padding: 0.7rem 0.85rem;
  }

  .survey-header-icon {
    display: none;
  }

  .survey-title {
    font-size: 1.05rem;
  }

  .survey-subtitle {
    font-size: 0.8rem;
  }

  .survey-logo-bar {
    padding: 0.4rem 0.9rem 0.25rem;
  }

  .survey-logo img {
    max-height: 52px;
    max-width: 170px;
  }

  .survey-intro-hero {
    padding: 0.15rem 0.9rem 0.35rem;
  }

  .survey-intro-hero-main {
    gap: 0.55rem 0.65rem;
    grid-template-columns: minmax(0, 1fr) minmax(100px, 0.72fr);
  }

  .survey-intro-title {
    font-size: 1.4rem;
    margin-bottom: 0.35rem;
  }

  .survey-intro-lead {
    font-size: 0.84rem;
  }

  .survey-intro-hero-image {
    max-width: min(100%, 150px);
  }

  .survey-intro-actions {
    padding: 0.25rem 0.9rem 0.85rem;
  }

  .survey-start-button {
    border-radius: 12px;
    min-height: 54px;
    padding: 0.65rem 0.95rem;
  }

  .survey-start-button-label {
    font-size: 0.98rem;
  }

  .survey-start-button-hint {
    font-size: 0.72rem;
  }

  .survey-visit-info,
  .survey-visit-privacy,
  .survey-visit-privacy-lead {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .survey-visit-privacy-lead {
    font-size: 0.74rem;
    line-height: 1.35;
  }

  .survey-visit-summary-text {
    font-size: 0.88rem;
  }

  .survey-visit-privacy-title {
    font-size: 0.82rem;
  }

  .survey-visit-privacy-text {
    font-size: 0.74rem;
    line-height: 1.35;
  }
}

.survey-message-panel {
  background: var(--survey-theme-soft);
  min-height: 280px;
  padding: 1.5rem;
}

.survey-message-body {
  background: #fff;
  border: 1px solid rgba(48, 105, 176, 0.2);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin: 0 auto;
  max-width: 520px;
  padding: 2rem 1.75rem;
  text-align: center;
}

.survey-message-lead {
  color: #333;
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.survey-message-detail {
  color: #555;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.survey-message-detail strong {
  color: var(--theme-color, #3069B0);
  font-weight: 600;
}

.survey-message-hint {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
}

@keyframes survey-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .survey-page {
    margin-top: 0.5rem;
    padding: 0 0.5rem;
  }

  .survey-header {
    padding: 1rem;
  }

  .survey-title {
    font-size: 1.15rem;
  }

  .survey-iframe-panel {
    height: calc(100dvh - 5.5rem);
    min-height: calc(100dvh - 5.5rem);
    padding: 0.35rem 0.5rem 0.5rem;
  }

  .survey-message-panel {
    padding: 1rem;
  }

  .survey-message-body {
    padding: 1.5rem 1.25rem;
  }
}

@media (min-width: 992px) {
  .survey-page {
    margin-top: 0.85rem;
  }
}
