* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background: #f2f2f2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Svarbu: kad nebūtų šoninio scrollinimo */
}

.content-wrapper {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1; /* Nustumia footerį į apačią */
}

/* 🔔 TOP BAR */
.top-bar {
  width: 100%;
  background: #2e7d32;
  height: 40px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* fade edges */
.top-bar::before,
.top-bar::after {
  content: "";
  position: absolute;
  top: 0;
  width: 40px;
  height: 100%;
  z-index: 2;
}

.top-bar::before {
  left: 0;
  background: linear-gradient(to right, #2e7d32, transparent);
}

.top-bar::after {
  right: 0;
  background: linear-gradient(to left, #2e7d32, transparent);
}

.scroll-track {
  display: flex;
  width: max-content;
  /* Naudojame tik CSS animaciją */
  animation: scroll-loop 50s linear infinite; 
}

.scroll-track span {
  flex-shrink: 0;
}

.scroll-content {
  display: flex;
  flex-shrink: 0;
}

.scroll-content span {
  white-space: nowrap;
  padding: 0 30px; /* Tarpas tarp užrašų */
  color: white;
  font-weight: bold;
  font-size: 14px;
}

@keyframes scroll-loop {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Kadangi turime du identiškus blokus, pasiekus -50% 
       vaizdas sutampa su 0% ir ciklas prasideda iš naujo nepastebimai */
    transform: translateX(-50%);
  }
}

.top-bar:hover .scroll-track {
  animation-play-state: paused;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px; /* Lygiavimas pagal kraštus */
}

.logo {
  height: 50px;
  width: auto;
}

.menu-btn {
  background: gold;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 150%;
  cursor: pointer;
}

/* MAIN */
main {
  width: 100%;
  flex: 1; /* Nustumia legalų tekstą į apačią */
  padding: 0 15px;
}

h1 {
  margin: 20px auto;
  max-width: 280px;   /* 👈 reguliuok šitą */
  line-height: 1.2;
}

h1, p, h3 {
  text-align: center;
}

.cards {
  flex-direction: row;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.card {
  width: 160px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.3s;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-footer {
  padding: 10px;
  color: white;
  font-weight: bold;
}

.male {
  background: #4a6fa5;
}

.male .card-footer {
  background: #2d4d7a;
}

.female {
  background: #8b3a3a;
}

.female .card-footer {
  background: #5e1f1f;
}

.card:hover {
  transform: scale(1.05);
}

/* STEPS */
.step {
  display: none;
}

.step.active {
  display: block;
}

button {
  padding: 10px 20px;
  margin-top: 20px;
  cursor: pointer;
}

.bottom-legal {
  position: fixed;    /* pririša prie ekrano */
  bottom: 20px;       /* 20px nuo apačios */
  left: 0;            /* kairė kraštinė */
  width: 100%;        /* visos pločio */
  padding: 10px 20px; /* vidinis tarpas */
  font-size: 12px;
  color: #555;
  text-align: center;
  line-height: 1.4;
  background: transparent; /* arba jei nori spalvos */
  box-sizing: border-box;  /* kad padding neplėstų pločio */
}

.bottom-legal a {
  color: #2e7d32;
  text-decoration: underline;
}

/* OVERLAY (blur/dim background) */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 100;
}

/* SIDE MENU */
.side-menu {
  position: fixed;
  top: 0;
  right: -300px; /* hidden */
  width: 280px;
  height: 100%;
  background: #fff;
  box-shadow: -5px 0 20px rgba(0,0,0,0.1);
  padding: 20px;
  transition: 0.3s ease;
  z-index: 101;

  display: flex;
  flex-direction: column;
}

/* OPEN STATE */
.side-menu.open {
  right: 0;
}

.overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* MENU HEADER */
.menu-header {
  display: flex;
  justify-content: flex-end;
}

.menu-header button {
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

/* MENU LIST */
.side-menu ul {
  list-style: none;
  margin-top: 20px;
  text-align: left;
}

.side-menu li a {
  display: block;
  padding: 15px;
  color: #000;
  text-decoration: none;
}

.side-menu li a:hover {
  background: #f2f2f2;
}

@media (max-width: 600px) {

  .header {
    max-width: 100%;
    padding: 10px 15px;
  }

  main {
    width: 100%;
    padding: 0 15px;
  }

  h1 {
    font-size: 26px;
    max-width: 280px;
    margin: 20px auto;
  }

  p {
    font-size: 14px;
  }

  h3 {
    font-size: 16px;
  }

  .cards {
    flex-direction: row;   /* 👈 svarbiausia */
    justify-content: center;
    gap: 10px;
  }

  .card {
    width: 45%;            /* 👈 telpa dvi */
    max-width: 160px;
  }

  .card img {
    height: 160px;
  }

  .menu-btn {
    font-size: 120%;
    padding: 8px 12px;
  }

    .side-menu {
    width: 60%;
  }
}

/* =============================================
   QUIZ CARD — base wrapper rendered by ui.js
   ============================================= */

.quiz-card {
  border-radius: 20px;
  padding: 28px 20px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-top: 30px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.quiz-card h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 22px;
  color: #1a1a1a;
}

/* =============================================
   CHOICE / INFO — single answer buttons
   ============================================= */

.quiz-card button {
  display: block;
  width: 100%;
  padding: 15px 18px;
  margin: 10px 0;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f5f5f5;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  text-align: left;
}

.quiz-card button:hover {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #2e7d32;
  transform: translateY(-2px);
}

.quiz-card button:active {
  transform: scale(0.98);
}

/* CTA button on info slides — centred, green */
.quiz-card .cta-btn,
.quiz-card button:only-of-type {
  text-align: center;
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
  margin-top: 18px;
}

.quiz-card button:only-of-type:hover {
  background: #1b5e20;
  border-color: #1b5e20;
  color: #fff;
}

/* =============================================
   INFO SLIDE — descriptive text
   ============================================= */

.quiz-card p {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

/* =============================================
   MULTI-SELECT — checkboxes
   ============================================= */

.quiz-card label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  margin: 8px 0;
  background: #f5f5f5;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 15px;
  color: #1a1a1a;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-align: left;
}

.quiz-card label:hover {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #2e7d32;
}

.quiz-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2e7d32;
  flex-shrink: 0;
  cursor: pointer;
}

/* Continue button below checkboxes */
.quiz-card button[onclick^="submitMulti"] {
  text-align: center;
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
  margin-top: 18px;
}

.quiz-card button[onclick^="submitMulti"]:hover {
  background: #1b5e20;
  border-color: #1b5e20;
}

/* =============================================
   FINAL STEP — email input & generating states
   ============================================= */

.quiz-card h2:only-child {
  color: #888;
  font-size: 20px;
  animation: pulse 1.5s infinite;
}

.quiz-card input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  margin: 16px 0 10px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s ease;
}

.quiz-card input[type="email"]:focus {
  border-color: #2e7d32;
}

.quiz-card input[type="email"]::placeholder {
  color: #aaa;
}

/* =============================================
   PROGRESS BAR (optional — add to loadQuestion
   if you want to show progress)
   ============================================= */

#quiz-progress {
  width: 100%;
  height: 5px;
  background: #e0e0e0;
  border-radius: 5px;
  margin-bottom: 20px;
  overflow: hidden;
}

#quiz-progress-bar {
  height: 100%;
  background: #2e7d32;
  border-radius: 5px;
  transition: width 0.4s ease;
}

.quiz-card input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  margin: 16px 0 10px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s ease;
}

.quiz-card input[type="text"]:focus {
  border-color: #2e7d32;
}

.quiz-card input[type="text"]::placeholder {
  color: #aaa;
}

/* =============================================
   RESPONSIVE TWEAKS
   ============================================= */

@media (max-width: 600px) {
  .quiz-card {
    padding: 22px 15px 20px;
  }

  .quiz-card h2 {
    font-size: 19px;
  }

  .quiz-card button,
  .quiz-card label {
    font-size: 14px;
    padding: 12px 14px;
  }
}