/* Quiz floating banner & modal */

/* Floating banner (bottom card) */
.quiz-banner {
  position: fixed;
  bottom: -200px;
  left: 16px;
  right: 16px;
  z-index: 250;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  box-sizing: border-box;
  width: auto;
  max-width: 960px;
  height: 90px;
  margin: 0 auto;
  border: var(--border-rule-light);
  border-radius: var(--radius-card, 16px);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-xl, 0 16px 48px rgba(18, 56, 107, 0.13));
  overflow: hidden;
  transition: bottom 0.4s ease;
}

.quiz-banner.is-visible {
  bottom: 16px;
}

.quiz-banner[hidden],
.quiz-mini[hidden] {
  display: none;
}

@media (min-width: 480px) {
  .quiz-banner {
    height: 95px;
  }
}

@media (min-width: 1366px) {
  .quiz-banner {
    height: 118px;
    max-width: 1200px;
  }
}

/* Banner image (calculator phone) */
.quiz-banner__image {
  display: none;
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 95px;
  height: 95px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media (min-width: 769px) {
  .quiz-banner__image {
    display: block;
  }
}

@media (min-width: 960px) {
  .quiz-banner__image {
    min-width: 210px;
  }
}

@media (min-width: 1366px) {
  .quiz-banner__image {
    min-width: 236px;
    height: 118px;
  }
}

/* Banner offer text */
.quiz-banner__offer {
  display: none;
  box-sizing: border-box;
  margin: 0 35px 0 16px;
  font-family: var(--font-display, Montserrat, sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text, #0f172a);
}

@media (min-width: 480px) {
  .quiz-banner__offer {
    font-size: 16px;
    max-width: 480px;
  }
}

@media (min-width: 769px) {
  .quiz-banner__offer {
    display: block;
    margin-left: 30px;
    margin-right: 24px;
  }
}

@media (min-width: 1280px) {
  .quiz-banner__offer {
    max-width: 500px;
  }
}

@media (min-width: 1366px) {
  .quiz-banner__offer {
    font-size: 18px;
    margin-left: 40px;
    margin-right: 40px;
  }
}

@media (min-width: 1440px) {
  .quiz-banner__offer {
    font-size: 20px;
  }
}

/* Banner main button (brand navy + soft shine + arrow) */
.quiz-banner__btn {
  position: relative;
  display: block;
  box-sizing: border-box;
  flex-shrink: 0;
  height: 60px;
  min-width: 260px;
  margin: 0 auto;
  padding: 16px;
  border: none;
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
  font-family: var(--font-display, Montserrat, sans-serif);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  color: var(--text-white, #fff);
  cursor: pointer;
  background: var(--primary, #12386B);
  box-shadow: var(--shadow-glow-md, 0 4px 12px rgba(18, 56, 107, 0.25));
  transition: color 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.quiz-banner__btn::after {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  margin-left: 0.5rem;
  background: url('../images/quiz/button-arrow.webp') no-repeat top center;
  background-size: contain;
  transition: 0.3s ease;
}

.quiz-banner__btn::before {
  content: '';
  position: absolute;
  left: -220%;
  top: 0;
  z-index: 0;
  width: 130%;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 24px 12px rgba(255, 255, 255, 0.35);
  transform: skew(-75deg);
  animation: quiz-banner-shine 6s 1s ease infinite;
}

.quiz-banner__btn:hover {
  background: var(--primary-hover, #0d2b5a);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-lg, 0 6px 20px rgba(18, 56, 107, 0.35));
}

@media (min-width: 769px) {
  .quiz-banner__btn {
    margin-right: 50px;
  }
}

@media (min-width: 1440px) {
  .quiz-banner__btn {
    height: 70px;
    min-width: 320px;
    padding: 18px;
    font-size: 14px;
  }
}

@keyframes quiz-banner-shine {
  0% {
    left: -220%;
  }
  30% {
    left: 180%;
  }
  100% {
    left: 300%;
  }
}

/* Banner close button (cross) */
.quiz-banner__close {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 26;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full, 9999px);
  background: transparent;
  cursor: pointer;
}

.quiz-banner__close::before,
.quiz-banner__close::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  margin: auto;
  width: 58%;
  height: 1px;
  background: var(--text-muted, #64748b);
  transition: 0.3s ease;
}

.quiz-banner__close::before {
  transform: rotate(-45deg);
}

.quiz-banner__close::after {
  transform: rotate(45deg);
}

.quiz-banner__close:hover {
  background: var(--surface-2, #f5f7fa);
}

@media (min-width: 1366px) {
  .quiz-banner__close {
    width: 24px;
    height: 24px;
  }
}

/* Collapsed round mini-button */
.quiz-mini {
  position: fixed;
  z-index: 250;
  right: 1.3em;
  bottom: 0.9rem;
  box-sizing: border-box;
  width: 4.2em;
  height: 4.2em;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  outline: none;
  background: var(--primary, #12386B) url('../images/quiz/calc.webp') no-repeat center;
  background-size: 44%;
  box-shadow: var(--shadow-glow-md, 0 4px 12px rgba(18, 56, 107, 0.25));
  cursor: pointer;
  opacity: 1;
  animation: quiz-mini-pulse 2s ease infinite;
  transition: background-color 0.4s ease;
}

.quiz-mini:hover,
.quiz-mini:active {
  background-color: var(--primary-hover, #0d2b5a);
}

@media (max-width: 600px) {
  .quiz-mini {
    width: 4em;
    height: 4em;
  }
}

@keyframes quiz-mini-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

/* Quiz modal (fullscreen, original app renders in shadow DOM) */
.quiz-modal {
  padding: 0;
}

.quiz-modal__content {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border-radius: 0;
  background: #fafafa;
  overflow: hidden;
}

.quiz-modal__noscript {
  padding: var(--space-8, 2rem);
  text-align: center;
  color: var(--text-secondary, #475569);
}

#stoma-quiz-app {
  position: absolute;
  inset: 0;
}

/* Mobile: footer clearance so the page scrolls past the floating card */
@media (max-width: 768px) {
  .site-footer-main {
    padding-bottom: calc(130px + env(safe-area-inset-bottom));
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .quiz-banner,
  .quiz-banner__btn,
  .quiz-banner__btn::before,
  .quiz-banner__btn::after,
  .quiz-banner__close::before,
  .quiz-banner__close::after,
  .quiz-mini {
    animation: none;
    transition: none;
  }
}
