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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 30%, #8b0000 70%, #5c1515 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #c41e3a, #228b22, #c41e3a, #228b22, #c41e3a);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.logo-icon {
  font-size: 32px;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #c41e3a, #228b22);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 8px;
  line-height: 1.3;
}

.subtitle {
  font-size: 16px;
  color: #4a5568;
}

.subtitle strong {
  color: #228b22;
  font-weight: 700;
  font-size: 20px;
}

.progress-section {
  background: #f0f4f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 8px;
}

#progress-percent {
  font-weight: 600;
  color: #228b22;
}

.progress-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #228b22, #32cd32, #228b22);
  background-size: 200% 100%;
  animation: progress-shimmer 2s ease-in-out infinite;
  border-radius: 6px;
  transition: width 0.5s ease-out;
}

@keyframes progress-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.step-text {
  text-align: center;
  font-size: 12px;
  color: #718096;
  margin-top: 8px;
}

#step-number {
  font-weight: 600;
  color: #c41e3a;
}

.loading {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #228b22;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  color: #4a5568;
  font-size: 14px;
  font-style: italic;
}

.hidden {
  display: none !important;
}

.question-section {
  margin-bottom: 20px;
}

#question-label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a2e;
  margin-bottom: 12px;
  line-height: 1.5;
}

#answer {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

#answer:focus {
  border-color: #228b22;
  box-shadow: 0 0 0 4px rgba(34, 139, 34, 0.1);
}

#answer::placeholder {
  color: #a0aec0;
}

#submit-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

#submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(196, 30, 58, 0.3);
}

#submit-btn:active {
  transform: translateY(0);
}

#submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 14px;
}

/* Image Upload Section */
.image-upload-section {
  margin-bottom: 20px;
}

#image-input {
  display: none;
}

.image-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: #f0f4f0;
  border: 2px dashed #c1c9c1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: #4a5568;
}

.image-upload-label:hover {
  background: #e8ede8;
  border-color: #228b22;
}

.image-upload-label.has-file {
  background: #e8f5e9;
  border-color: #228b22;
  border-style: solid;
}

.upload-icon {
  font-size: 20px;
}

.upload-filename {
  font-weight: 500;
  color: #228b22;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-container {
  margin-top: 12px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f4f0;
}

#image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

.remove-image {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(196, 30, 58, 0.9);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.remove-image:hover {
  transform: scale(1.1);
  background: #c41e3a;
}

.footer {
  margin-top: 24px;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.footer p {
  font-size: 12px;
  color: #718096;
  margin-bottom: 4px;
}

.disclaimer {
  font-size: 10px !important;
  color: #a0aec0 !important;
}

.decorations {
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.decoration {
  font-size: 48px;
  opacity: 0.9;
  animation: bounce 2s ease-in-out infinite;
}

.decoration.left {
  animation-delay: 0s;
}

.decoration.right {
  animation-delay: 1s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Snowflakes */
.snowflakes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  animation: fall linear infinite;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.snowflake:nth-child(1) { left: 5%; animation-duration: 10s; animation-delay: 0s; font-size: 1rem; }
.snowflake:nth-child(2) { left: 15%; animation-duration: 12s; animation-delay: 1s; font-size: 1.5rem; }
.snowflake:nth-child(3) { left: 25%; animation-duration: 8s; animation-delay: 2s; font-size: 1.2rem; }
.snowflake:nth-child(4) { left: 35%; animation-duration: 14s; animation-delay: 0.5s; font-size: 1.8rem; }
.snowflake:nth-child(5) { left: 45%; animation-duration: 9s; animation-delay: 3s; font-size: 1rem; }
.snowflake:nth-child(6) { left: 55%; animation-duration: 11s; animation-delay: 1.5s; font-size: 1.4rem; }
.snowflake:nth-child(7) { left: 65%; animation-duration: 13s; animation-delay: 2.5s; font-size: 1.6rem; }
.snowflake:nth-child(8) { left: 75%; animation-duration: 10s; animation-delay: 0.8s; font-size: 1.1rem; }
.snowflake:nth-child(9) { left: 85%; animation-duration: 15s; animation-delay: 1.2s; font-size: 1.3rem; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 7s; animation-delay: 2.8s; font-size: 1.7rem; }

@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0.3;
  }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  body {
    padding: 12px;
    align-items: flex-start;
    padding-top: 40px;
  }

  .card {
    padding: 24px 20px;
    border-radius: 20px;
  }

  h1 {
    font-size: 20px;
  }

  .logo-icon {
    font-size: 28px;
  }

  .logo-text {
    font-size: 24px;
  }

  .subtitle strong {
    font-size: 18px;
  }

  #question-label {
    font-size: 15px;
  }

  #answer {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  #submit-btn {
    padding: 14px 20px;
  }

  .decoration {
    font-size: 36px;
  }

  .decorations {
    top: -15px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .card {
    padding: 20px 16px;
  }

  h1 {
    font-size: 18px;
  }

  .logo-text {
    font-size: 22px;
  }
}

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
}

/* Smooth animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .snowflake,
  .decoration,
  .progress-fill,
  .card::before {
    animation: none;
  }

  .spinner {
    animation: spin 2s linear infinite;
  }
}
