.survey-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 500px;
  margin: 0 auto;
  position: relative; }

/* Header avec compteur et lien résultats */
.survey-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 10px; }

.survey-header.centered {
  justify-content: center; }

.survey-participants {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95em;
  color: #495057; }

.survey-participants-icon {
  font-size: 1.1em; }

.survey-participants-count {
  font-weight: 600;
  color: #007bff; }

.survey-see-results-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.9em;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px; }

.survey-see-results-link:hover {
  color: #007bff;
  text-decoration: underline; }

.survey-see-results-link svg {
  width: 14px;
  height: 14px; }

.survey-title {
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 24px;
  color: #333;
  text-align: center; }

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

.survey-option {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease; }

.survey-option:hover {
  border-color: #007bff;
  background: #f8faff; }

.survey-option.selected {
  border-color: #007bff;
  background: #e8f0ff; }

.survey-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: 14px;
  cursor: pointer; }

.survey-option label {
  flex: 1;
  cursor: pointer;
  font-size: 1.05em;
  color: #333; }

/* Form section - hidden by default */
.survey-form-section {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0; }

.survey-form-section.visible {
  max-height: 2000px;
  opacity: 1;
  margin-top: 20px; }

/* Custom fields */
.survey-custom-fields {
  margin-bottom: 16px; }

.survey-field {
  margin-bottom: 14px; }

.survey-field:last-child {
  margin-bottom: 0; }

.survey-field-label {
  display: block;
  font-size: 0.9em;
  font-weight: 500;
  color: #495057;
  margin-bottom: 6px; }

.survey-field-label .required {
  color: #dc3545;
  margin-left: 2px; }

.survey-field input[type="text"], .survey-field input[type="email"], .survey-field select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1em;
  box-sizing: border-box;
  transition: border-color 0.2s;
  background: #fff; }

.survey-field input:focus, .survey-field select:focus {
  outline: none;
  border-color: #007bff; }

.survey-field input.error, .survey-field select.error {
  border-color: #dc3545; }

.survey-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer; }

.survey-field-error {
  color: #dc3545;
  font-size: 0.85em;
  margin-top: 6px; }

/* Divider */
.survey-divider {
  height: 1px;
  background: #e9ecef;
  margin: 20px 0; }

/* Email field */
.survey-email-field {
  margin-bottom: 16px; }

.survey-email-field input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1em;
  box-sizing: border-box;
  transition: border-color 0.2s; }

.survey-email-field input:focus {
  outline: none;
  border-color: #007bff; }

.survey-email-field input.error {
  border-color: #dc3545; }

/* Coreg checkboxes */
.survey-coregs {
  margin-bottom: 16px; }

.survey-coreg-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s; }

.survey-coreg-item:hover {
  background: #e9ecef; }

.survey-coreg-item:last-child {
  margin-bottom: 0; }

.survey-coreg-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #007bff;
  flex-shrink: 0; }

.survey-coreg-item label {
  flex: 1;
  cursor: pointer;
  font-size: 0.9em;
  color: #495057;
  line-height: 1.4; }

.survey-submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s; }

.survey-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3); }

.survey-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none; }

/* Modal */
.survey-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out; }

.survey-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out; }

.survey-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef; }

.survey-modal-title {
  font-size: 1.25em;
  font-weight: 600;
  color: #333;
  margin: 0; }

.survey-modal-close {
  background: none;
  border: none;
  font-size: 1.5em;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s; }

.survey-modal-close:hover {
  color: #333; }

.survey-modal-body {
  padding: 24px; }

.survey-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e9ecef;
  text-align: center; }

.survey-modal-footer-text {
  font-size: 0.9em;
  color: #6c757d; }

.survey-modal-footer a {
  color: #007bff;
  text-decoration: none;
  cursor: pointer; }

.survey-modal-footer a:hover {
  text-decoration: underline; }

@keyframes fadeIn {
  from {
    opacity: 0; }
  to {
    opacity: 1; } }
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px); }
  to {
    opacity: 1;
    transform: translateY(0); } }
/* Toast notification */
.survey-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 360px;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
  transition: opacity 0.3s, transform 0.3s; }

.survey-toast.hiding {
  opacity: 0;
  transform: translateX(100%); }

.survey-toast.error {
  background: #fff;
  border-left: 4px solid #dc3545; }

.survey-toast.warning {
  background: #fff;
  border-left: 4px solid #ffc107; }

.survey-toast.success {
  background: #fff;
  border-left: 4px solid #28a745; }

.survey-toast-icon {
  font-size: 1.4em;
  line-height: 1; }

.survey-toast.error .survey-toast-icon {
  color: #dc3545; }

.survey-toast.warning .survey-toast-icon {
  color: #ffc107; }

.survey-toast.success .survey-toast-icon {
  color: #28a745; }

.survey-toast-content {
  flex: 1; }

.survey-toast-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px; }

.survey-toast-message {
  font-size: 0.9em;
  color: #666; }

.survey-toast-close {
  background: none;
  border: none;
  font-size: 1.2em;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1; }

.survey-toast-close:hover {
  color: #333; }

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%); }
  to {
    opacity: 1;
    transform: translateX(0); } }
/* Processing & Loading states */
.survey-processing, .survey-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #666; }

.survey-processing-text {
  margin-top: 16px;
  font-size: 1em;
  color: #495057; }

/* Spinner animation */
.survey-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e9ecef;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite; }

@keyframes spin {
  to {
    transform: rotate(360deg); } }
/* Results */
.survey-results-content {
  margin-top: 0; }

.survey-results {
  margin-top: 24px; }

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

.results-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #333; }

.results-total {
  font-size: 0.95em;
  color: #666;
  margin-top: 4px; }

.result-item {
  margin-bottom: 18px; }

.result-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px; }

.result-label {
  font-weight: 500;
  color: #333; }

.result-stats {
  color: #666;
  font-size: 0.95em; }

.result-bar-bg {
  background: #e9ecef;
  border-radius: 8px;
  height: 32px;
  overflow: hidden; }

.result-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 1s ease-out;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-weight: 600;
  font-size: 0.9em;
  color: #fff; }

.result-bar.color-0 {
  background: linear-gradient(90deg, #28a745, #20c997); }

.result-bar.color-1 {
  background: linear-gradient(90deg, #dc3545, #e83e8c); }

.result-bar.color-2 {
  background: linear-gradient(90deg, #ffc107, #fd7e14); }

.result-bar.color-3 {
  background: linear-gradient(90deg, #6f42c1, #007bff); }

.result-bar.color-4 {
  background: linear-gradient(90deg, #17a2b8, #20c997); }

.survey-message {
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  margin-top: 16px; }

.survey-message.success {
  background: #d4edda;
  color: #155724; }
