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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #333;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  padding: 40px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

header h1 {
  font-size: 28px;
  color: #667eea;
  font-weight: 600;
}

main {
  min-height: 300px;
}

#question-container {
  width: 100%;
}

.question {
  margin-bottom: 30px;
}

.question h2 {
  font-size: 20px;
  margin-bottom: 24px;
  color: #2d3748;
  line-height: 1.4;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.option {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #f7fafc;
}

.option:hover {
  border-color: #667eea;
  background: #edf2f7;
  transform: translateX(4px);
}

.option input[type="checkbox"] {
  margin-right: 12px;
  margin-top: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #667eea;
}

.option input[type="checkbox"]:checked + span,
.option input[type="radio"]:checked + span {
  color: #667eea;
  font-weight: 500;
}

.option span {
  flex: 1;
  cursor: pointer;
  line-height: 1.5;
  color: #4a5568;
}

.option span strong {
  color: #667eea;
  font-weight: 600;
  margin-right: 8px;
}

.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.loading {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: #667eea;
}

.error {
  padding: 24px;
  background: #fed7d7;
  border: 2px solid #fc8181;
  border-radius: 8px;
  color: #c53030;
  font-weight: 500;
}

.result {
  padding: 24px;
}

.result h2 {
  color: #48bb78;
  margin-bottom: 20px;
  font-size: 24px;
}

.result pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.result #copy-btn {
  margin-top: 16px;
}

/* Comment section */
.comment-section {
  display: block;
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.comment-section * {
  box-sizing: border-box;
}

.comment-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.optional-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: #f0fdf4;
  color: #16a34a;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

textarea.comment-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  transition: all 0.2s ease;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-height: 80px;
}

textarea.comment-input:hover {
  border-color: #cbd5e1;
}

textarea.comment-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.comment-input::placeholder {
  color: #94a3b8;
  font-style: italic;
}

/* Affichage résultat */
.result-display {
  background: #f7fafc;
  color: #2d3748;
  border: 1px solid #e2e8f0;
}

/* JSON preview */
.json-preview {
  margin-top: 16px;
}

.json-preview summary {
  cursor: pointer;
  color: #667eea;
  font-size: 14px;
}

.json-preview summary:hover {
  text-decoration: underline;
}

.json-code {
  background: #1a202c;
  color: #68d391;
  font-size: 12px;
  margin-top: 8px;
}

footer {
  margin-top: 40px;
  text-align: center;
}

.help-text {
  color: #718096;
  font-size: 14px;
  font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 24px;
  }
  
  header h1 {
    font-size: 24px;
  }
  
  .question h2 {
    font-size: 18px;
  }
  
  .option {
    padding: 12px;
  }
}

