﻿/* Quiz floating banner & modal */

/* Floating banner (bottom bar) */
.quiz-banner {
  position: fixed;
  bottom: -200px;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  height: 90px;
  margin: 0 auto;
  background: #ccf2e5;
  overflow: hidden;
  transition: bottom 0.4s ease;
}

.quiz-banner.is-visible {
  bottom: 0;
}

.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: #000;
}

@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 (animated gradient + 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: 9px;
  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: #fff;
  cursor: pointer;
  background: linear-gradient(254.24deg, #fd6174 -3.42%, #e82044 48.11%);
  animation: quiz-banner-gradient 3.5s linear infinite forwards;
  transition: color 0.3s ease, background 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.png') 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.9);
  box-shadow: 0 0 30px 20px #fff;
  transform: skew(-75deg);
  animation: quiz-banner-shine 4.5s 1s ease infinite;
}

.quiz-banner__btn:hover {
  color: #cef;
}

@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-gradient {
  0% {
    background: #2f4ce4;
    box-shadow: -20rem 0 10rem -5rem #a170f2 inset;
  }
  25% {
    background: #a170f2;
    box-shadow: -20rem 0 10rem -5rem #2f4ce4 inset;
  }
  50% {
    background: #f9781b;
    box-shadow: -20rem 0 10rem -5rem #fa143e inset;
  }
  75% {
    background: #fa143e;
    box-shadow: -20rem 0 10rem -5rem #f9781b inset;
  }
  100% {
    background: #2f4ce4;
    box-shadow: -20rem 0 10rem -5rem #a170f2 inset;
  }
}

@keyframes quiz-banner-shine {
  0% {
    left: -220%;
  }
  30% {
    left: 180%;
  }
  100% {
    left: 300%;
  }
}

/* Banner close button (cross) */
.quiz-banner__close {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 26;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: #fff;
  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: #000;
  transition: 0.3s ease;
}

.quiz-banner__close::before {
  transform: rotate(-45deg);
}

.quiz-banner__close::after {
  transform: rotate(45deg);
}

.quiz-banner__close:hover {
  background: #efefef;
}

@media (min-width: 769px) {
  .quiz-banner__close {
    display: block;
  }
}

@media (min-width: 1366px) {
  .quiz-banner__close {
    width: 24px;
    height: 24px;
  }
}

/* Collapsed round mini-button */
.quiz-mini {
  position: fixed;
  z-index: 10010;
  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: #fa2626 url('../images/quiz/calc.png') no-repeat center;
  background-size: 44%;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.09), 0 2px 14px rgba(0, 0, 0, 0.19);
  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: #3c9;
}

@media (max-width: 600px) {
  .quiz-mini {
    width: 4em;
    height: 4em;
  }
}

@keyframes quiz-mini-pulse {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(0.9);
  }
}

/* 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;
}

/* 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;
  }
}
