/* quiz.css — Quiz engine styles */

/* Themable custom properties (set by quiz.js) */
:root {
  --quiz-accent: #b45309;
  --quiz-bg: #faf6f1;
  /* Tailwind CSS default font-sans — same as the eshop */
  --quiz-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Flex column so the footer sits right below the content —
   visible above the fold whenever the screen is short. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

#quiz {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  font-family: var(--quiz-font);
  background: var(--quiz-bg);
  flex: 1;
  box-sizing: border-box;
}

/* Logo — above the progress bar, on every screen */
.quiz-logo {
  display: block;
  width: 120px;
  margin-bottom: 0.25rem;
}

/* Tagline under the logo */
.quiz-tagline {
  font-size: 0.8125rem;
  color: #737373;
  margin: 0 0 1.5rem;
}

/* Progress bar */
.quiz-progress {
  height: 4px;
  background: #e5e5e5;
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--quiz-accent);
  border-radius: 2px;
  transition: width 300ms ease;
  width: 0%;
}

/* Screen transitions */
.quiz-screen {
  animation: quiz-fade-in 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .quiz-screen {
    animation: none;
  }
  .quiz-progress-bar {
    transition: none;
  }
}

@keyframes quiz-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Headings */
.quiz-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #171717;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.quiz-text {
  font-size: 1rem;
  color: #525252;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

/* Intro and question image */
.quiz-intro-image,
.quiz-question-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  object-fit: cover;
  aspect-ratio: 4/3;
}

/* Option cards — single choice */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-options.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.quiz-option {
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  background: white;
}

.quiz-option:hover {
  border-color: var(--quiz-accent);
}

.quiz-option:focus-visible {
  outline: 2px solid var(--quiz-accent);
  outline-offset: 2px;
}

.quiz-option.quiz-option-selected {
  border-color: var(--quiz-accent);
  box-shadow: 0 0 0 1px var(--quiz-accent);
}

.quiz-option-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.quiz-option-label {
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  color: #171717;
}

.quiz-option-selected .quiz-option-label::after {
  content: " ✓";
  color: var(--quiz-accent);
}

/* CTA button */
.quiz-cta {
  display: inline-block;
  background: var(--quiz-accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.quiz-cta:hover {
  opacity: 0.9;
}

.quiz-cta:focus-visible {
  outline: 2px solid var(--quiz-accent);
  outline-offset: 2px;
}

/* Single-option ("continue") screen: full-width CTA under the image */
.quiz-continue-cta {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
}

/* Back button — in flow, below the progress bar */
.quiz-back {
  display: block;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #737373;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.quiz-back:hover {
  color: #171717;
}

/* Email question */
.quiz-email-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-email-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 6px;
  font-family: inherit;
  box-sizing: border-box;
}

.quiz-email-input:focus {
  outline: none;
  border-color: var(--quiz-accent);
}

.quiz-consent {
  font-size: 0.875rem;
  color: #525252;
  line-height: 1.4;
  cursor: pointer;
}

.quiz-consent input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--quiz-accent);
}

.quiz-consent a {
  color: var(--quiz-accent);
}

.quiz-error {
  font-size: 0.8125rem;
  color: #dc2626;
  min-height: 1.25rem;
}

/* End screen */
.quiz-end-cta {
  display: block;
  /*width: 100%;*/
  margin-top: 1.5rem;
  text-align: center;
}

/* Test mode badge */
.quiz-test-badge {
  display: inline-block;
  background: #dc2626;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Error screen */
.quiz-error-screen {
  text-align: center;
  padding: 3rem 1rem;
}

.quiz-error-screen p {
  color: #737373;
  margin-bottom: 1.5rem;
}

/* Footer link */
.quiz-footer {
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
  background: var(--quiz-bg);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.quiz-footer a {
  color: #737373;
  text-decoration: underline;
}

/* Noscript */
.quiz-noscript {
  background: #fef2f2;
  color: #dc2626;
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
}

/* Honeypot — hidden */
.quiz-honeypot {
  position: absolute;
  left: -9999px;
}
