/* ============================================================
   Euromedica Quiz — global styles
   Tablet-first (design baseline). Mobile shrinks, desktop only
   widens the pink background around the same content column.
   ============================================================ */

:root {
  --pink: #e82693;
  --pink-soft: #f495ca;
  --gray: #727272;
  --black: #404b52;
  --white: #ffffff;
  --blue: #287ee5;

  --font: 'Manrope', 'Segoe UI', Arial, sans-serif;

  --card-max-width: 420px;
  --page-max-width: 480px;
  --card-radius: 48px;
  --gap: 1.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--black);
  background: linear-gradient(180deg, #fffdf9 0%, #fdf1f4 55%, #fbe7ec 100%);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font-family: inherit;
}

a {
  color: var(--blue);
}

/* ---------------------------------------------------------
   Full-bleed decorative background art.
   Pinned to the bottom, always 100% viewport width so the
   left/right edges of the ribbon line up with the screen
   edges exactly — never cropped, never letterboxed.
--------------------------------------------------------- */
.bg-art-container {
  position: fixed;
  inset: 0;
  overflow:hidden;
  z-index: 0;
  display: flex;
  justify-content: center;
}

.bg-art {
  width: 100%;
  height: auto;
  max-width: calc(var(--page-max-width) + 200px);
  pointer-events: none;
  user-select: none;
  object-fit: cover;
}

/* Start screen has no background art */
body[data-screen='start'] .bg-art {
  display: none;
}

/* ---------------------------------------------------------
   Page shell
--------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.25rem 3rem;
}

.page-inner {
  width: 100%;
  max-width: var(--page-max-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Desktop only widens the pink background stage — content column stays put */
@media (min-width: 1024px) {
  .page {
    padding-top: 3rem;
  }
}

/* ---------------------------------------------------------
   Header (logo + quiz badge)
   Badge sits flush top-left; the Euromedica logo is centered
   BELOW it (not inline beside it) with a small gap.
--------------------------------------------------------- */
.header {
  position: relative;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  padding-top: 78px;
}

.header .logo {
  width: 190px;
      justify-self: center;
}

.header .quiz-badge {
  position: absolute;
  left: 0;
  top: 0;
  width: 140px;
}

/* ---------------------------------------------------------
   Screens (client-side steps of the SPA)
--------------------------------------------------------- */
.screen {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.screen.is-active {
  display: flex;
}

/* ---------------------------------------------------------
   Start screen
--------------------------------------------------------- */
.hero-art {
  width: 260px;
  margin: 0.5rem 0 1.75rem;
}

.title-pink {
  color: var(--pink);
  font-weight: 800;
  font-size: clamp(2.5rem, 4vw + 1rem, 3.1rem);
  line-height: 1.25;
  margin: 0 0 1rem;
}

.subtitle-black {
  color: var(--black);
  font-weight: 500;
  font-size: clamp(1.45rem, 1.85vw + 0.9rem, 1.85rem);
  line-height: 1.6;
  margin: 0 0 2rem;
  max-width: 30ch;
}

.subtitle-black strong {
  color: var(--pink);
  font-weight: 800;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--pink);
  color: var(--white);
  font-size: 1rem;
  padding: 0.9rem 2.75rem;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Pre-quiz CTAs (start, gift panels) sit a fixed distance from the bottom
   of the viewport instead of flowing after the text above them — otherwise
   the button jumps to a different height on every gift panel depending on
   how much copy is above it. */
.fixed-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12rem;
  transform: translateX(-50%);
  z-index: 10;
}

/* ---------------------------------------------------------
   Quiz card
--------------------------------------------------------- */
.quiz-topbar {
  position: relative;
  width: 100%;
  margin-bottom: 50px;
}

.quiz-card {
  width: 100%;
  max-width: var(--card-max-width);
  background: rgba(255, 255, 255, 0.63);
  border-radius: var(--card-radius);
  box-shadow: 0 20px 45px rgba(64, 75, 82, 0.12);
  padding: 5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.quiz-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.quiz-card__question-count {
  color: var(--pink);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-pills {
  display: flex;
  gap: 6px;
}

.progress-pill {
  width: 26px;
  height: 6px;
  border-radius: 999px;
  background: #e3d9dc;
  transition: background-color 0.2s ease;
}

.progress-pill.is-current {
  background: var(--pink);
}

.quiz-card__question {
  color: var(--black);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 1rem 0 2.5rem;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 4.75rem;
}

.answer {
  appearance: none;
  border: 1px solid var(--pink);
  background: rgba(255, 255, 255, 0.63);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.answer__letter {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.answer__text {
  color: var(--black);
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.answer.is-correct {
  background: var(--pink);
  border-color: var(--pink);
}

.answer.is-correct .answer__letter {
  background: var(--white);
  color: var(--pink);
}

.answer.is-correct .answer__text {
  color: var(--white);
}

.answer.is-incorrect {
  background: var(--gray);
  border-color: var(--gray);
}

.answer.is-incorrect .answer__letter {
  background: var(--white);
  color: var(--gray);
}

.answer.is-incorrect .answer__text {
  color: var(--white);
}

.answer[disabled] {
  cursor: default;
}

.quiz-card__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.nav-arrow {
  appearance: none;
  border: 1px solid var(--pink);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--white);
  color: var(--pink);
}

.quiz-card__nav .nav-arrow {
  width: 76px;
  height: 76px;
}

.nav-arrow--next {
  background: var(--pink);
  color: var(--white);
  border-color: var(--pink);
}

.nav-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-arrow svg {
  width: 36px;
  height: 36px;
}

.step-dots {
  display: flex;
  gap: 6px;
  margin-top: 1.25rem;
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f0c4dc;
}

.step-dot.is-current {
  background: var(--pink);
}

/* ---------------------------------------------------------
   Gift / prize preview pages
--------------------------------------------------------- */
.gift-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.gift-panel[hidden] {
  display: none;
}

.prize-heading {
  color: var(--pink);
  font-weight: 800;
  font-size: clamp(1.7rem, 3vw + 1rem, 2.3rem);
  line-height: 1.3;
  margin: 0 0 1.25rem;
  padding-bottom: 10px;
}

.prize-heading-with-logo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.prize-heading-with-logo .prize-heading {
  margin: 0;
}

.rebeauty-logo {
  width: 270px;
}

.prize-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.prize-list li {
  color: var(--black);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.6vw + 0.8rem, 1.4rem);
  line-height: 1.4;
}

.prize-list--noted li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.prize-list-item__main {
  color: var(--black);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.6vw + 0.8rem, 1.4rem);
}

.prize-list-item__note {
  color: var(--gray);
  font-weight: 500;
  font-size: clamp(0.85rem, 1vw + 0.6rem, 1rem);
}

/* ---------------------------------------------------------
   Result screens
--------------------------------------------------------- */
.result-title {
  color: var(--pink);
  font-weight: 800;
  font-size: clamp(2.2rem, 3.5vw + 1rem, 3.2rem);
  line-height: 1.2;
  margin: 0.25rem 0 0;
}

.result-underline {
  width: 170px;
  margin: 0.35rem 0 1.5rem;
}

.result-copy {
  color: var(--black);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.6;
  text-align: left;
  max-width: 34ch;
  margin: 0 0 2rem;
}

/* ---------------------------------------------------------
   Form screen
--------------------------------------------------------- */
.form-intro {
  color: var(--black);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 0 0 1.75rem;
  max-width: 40ch;
}

.entry-form {
  width: 100%;
  max-width: var(--card-max-width);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.4rem;
}

.field .required-star {
  color: var(--pink);
}

.field input[type='text'],
.field input[type='email'],
.field input[type='tel'] {
  width: 100%;
  border: 1.5px solid var(--pink);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  color: var(--black);
  background: var(--white);
  outline: none;
}

.field input::placeholder {
  color: #c9c9c9;
}

.field input:focus {
  border-color: var(--blue);
}

.field-error {
  display: none;
  color: var(--pink);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.field.has-error input {
  border-color: var(--pink);
}

.field.has-error .field-error {
  display: block;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.checkbox-field input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 1.5px solid var(--pink);
  border-radius: 0;
  background-color: var(--white);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.checkbox-field input[type='checkbox']:checked {
  border-color: var(--pink);
  background-color: var(--pink);
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg' fill='none'%3E%3Cg%3E%3Ctitle%3ELayer 1%3C/title%3E%3Cpath stroke='%23ffffff' id='svg_1' stroke-linejoin='round' stroke-linecap='round' stroke-width='2' d='m1.0969,10.20112l5.94574,5.94574l11.89147,-12.88243'/%3E%3C/g%3E%3C/svg%3E");
}

.checkbox-field input[type='checkbox']:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.checkbox-field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--pink);
  line-height: 1.5;
}

.checkbox-field a {
  color: var(--blue);
  text-decoration: underline;
}

.link-button {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------------------------------------------------------
   Terms & conditions modal
--------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(64, 75, 82, 0.55);
}

.modal-overlay[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 20px;
  text-align: left;
  box-shadow: 0 20px 45px rgba(64, 75, 82, 0.25);
  overflow: hidden;
}

.modal-header {
  flex: none;
  padding: 2rem 1.75rem 1rem;
}

.modal-close {
  appearance: none;
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f5f5f5;
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-title {
  color: var(--pink);
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}

.modal-external-link {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.modal-external-link a {
  color: var(--blue);
  text-decoration: underline;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 1.75rem 2rem;
  color: var(--black);
  font-size: 0.9rem;
  line-height: 1.6;

  /* Custom scrollbar: a slim pink thumb instead of the default OS chrome */
  scrollbar-width: thin;
  scrollbar-color: var(--pink-soft) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: var(--pink-soft);
  border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--pink);
}

.modal-body p {
  margin: 0 0 1rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body strong {
  font-weight: 700;
  color: var(--black);
}

.modal-body a {
  color: var(--blue);
  text-decoration: underline;
  word-break: break-word;
}

.modal-body ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.modal-body li {
  margin-bottom: 0.35rem;
}

.modal-body li:last-child {
  margin-bottom: 0;
}

.modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
}

.modal-body table tr {
  border-bottom: 1px solid #f1e3ea;
}

.modal-body table tr:first-child {
  background: #fdf1f5;
}

.modal-body table td {
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}

.modal-body table td p {
  margin: 0;
}

.form-status {
  min-height: 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-status[data-state='error'] {
  color: var(--pink);
}

.form-status[data-state='success'] {
  color: var(--black);
}

.entry-form .btn-primary {
  align-self: center;
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------
   Thank-you screen
--------------------------------------------------------- */
[data-screen='thanks'] .header {
  margin-top: 300px;
}

[data-screen='thanks'] .header .logo {
  width: 355px; /* 190px base logo, 50% bigger */
}

[data-screen='thanks'] .title-pink {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.thanks-copy {
  color: var(--black);
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0;
}

/* ---------------------------------------------------------
   Mobile shrink
--------------------------------------------------------- */
@media (max-width: 480px) {
  .page {
    padding: 1.25rem 1rem 2rem;
  }

  .header {
    padding-top: 56px;
  }

  .header .logo {
    width: 150px;
  }

  .header .quiz-badge {
    width: 100px;
    top: 0;
  }

  .hero-art {
    width: 200px;
  }

  .fixed-bottom-nav {
    bottom: 12rem;
  }

  [data-screen='thanks'] .header {
    margin-top: 100px;
  }

  .quiz-card {
    padding: 1.15rem 1.1rem 1.4rem;
    border-radius: 20px;
  }

  .quiz-card__question {
    font-size: 0.92rem;
  }

  .answer__text {
    font-size: 0.85rem;
  }

  .btn-primary {
    padding: 0.8rem 2.1rem;
    font-size: 0.92rem;
  }
}

@media screen and (min-width: 1024px) {
  .fixed-bottom-nav {
    bottom: 3rem;
  }
}