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

:root {
  --green: #006B3F;
  --green-dark: #004D2C;
  --white: #FFFFFF;
  --gold: #FFD100;
  --red: #CE1126;
  --gray-light: #f0f0f0;
  --gray: #999;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.15);
}

html {
  font-size: max(16px, 1em);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--green);
  color: var(--white);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ===== WELCOME SCREEN ===== */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 1.5rem 1rem 2rem;
}
.screen.active { display: flex; }

.welcome-logo {
  width: 140px;
  height: auto;
  margin-bottom: 1rem;
}

.welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}
.welcome-subtitle {
  font-size: 0.95rem;
  opacity: 0.85;
  text-align: center;
  margin-bottom: 1.5rem;
}

.instructions {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 1rem;
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}
.instructions h3 {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  opacity: 0.9;
}
.instructions ol {
  padding-left: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.instructions li { margin-bottom: 0.3rem; }

.form-group {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  opacity: 0.9;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input::placeholder { color: rgba(255,255,255,0.5); }
.form-group input:focus,
.form-group select:focus {
  border-color: var(--gold);
}
.form-group select option { color: #333; background: var(--white); }

.form-error {
  color: var(--gold);
  font-size: 0.8rem;
  margin-top: 0.3rem;
  display: none;
}
.form-error.visible { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-gold {
  background: var(--gold);
  color: var(--green-dark);
}
.btn-white {
  background: var(--white);
  color: var(--green);
}

/* ===== QUIZ SCREEN ===== */
.quiz-header {
  width: 100%;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.8rem;
  opacity: 0.8;
  text-align: center;
}

/* Carousel container */
.carousel {
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-slide {
  min-width: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.option-card:active { transform: scale(0.98); }
.option-card.selected {
  background: rgba(255, 209, 0, 0.2);
  border-color: var(--gold);
}

.option-checkbox {
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  margin-top: 0.25rem;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}
.option-card.selected .option-checkbox {
  background: var(--gold);
  border-color: var(--gold);
}
.option-card.selected .option-checkbox::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid var(--green-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.option-letter {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.option-card.selected .option-letter {
  background: var(--gold);
  color: var(--green-dark);
}

.option-text {
  font-size: 0.9rem;
  line-height: 1.4;
  padding-top: 0.25rem;
}

/* Navigation button at bottom */
.quiz-footer {
  width: 100%;
  padding: 0.75rem 1rem 1.5rem;
  display: flex;
  justify-content: center;
}
.quiz-footer .btn {
  width: 100%;
  max-width: 400px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.quiz-footer .btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== THANK YOU SCREEN ===== */
.thankyou-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
}

.thankyou-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: center;
}
.thankyou-message {
  font-size: 0.95rem;
  opacity: 0.85;
  text-align: center;
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 2rem;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 107, 63, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.loading-overlay.active { display: flex; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ===== ERROR TOAST ===== */
.error-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--red);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  z-index: 200;
  transition: transform 0.3s ease;
  text-align: center;
  max-width: 90%;
}
.error-toast.visible { transform: translateX(-50%) translateY(0); }
