/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  background-color: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
}

/* Container principal - centré verticalement */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.results-page {
  max-width: 900px;
  justify-content: flex-start;
  padding-top: 60px;
}

/* Titres */
h1 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 30px;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 16px;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.3rem;
  font-weight: 500;
  color: #1a1a1a;
}

.subtitle {
  color: #666;
  margin-bottom: 40px;
  font-size: 0.95rem;
}

/* Étapes du questionnaire */
.step {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Questions */
.question {
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 48px;
  color: #1a1a1a;
  line-height: 1.5;
}

/* Boutons */
.buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 500;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-block;
  background: #ffffff;
  color: #1a1a1a;
}

.btn:hover {
  border-color: #1a1a1a;
  background: #fafafa;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
}

.btn-primary:hover {
  background: #333;
  border-color: #333;
}

.btn-secondary {
  background: #ffffff;
  color: #1a1a1a;
  border-color: #e0e0e0;
}

.btn-secondary:hover {
  border-color: #1a1a1a;
  background: #fafafa;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-danger:disabled,
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger:disabled:hover,
.btn-primary:disabled:hover {
  transform: none;
}

/* Input */
.input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

#estimate-input {
  width: 240px;
  padding: 14px 16px;
  font-size: 1.25rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  transition: border-color 0.15s;
  background: #ffffff;
}

#estimate-input:focus {
  outline: none;
  border-color: #1a1a1a;
}

#estimate-input::placeholder {
  color: #999;
}

.unit {
  color: #666;
  font-size: 0.95rem;
}

/* Page de remerciement */
#step-thanks h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #1a1a1a;
}

#step-thanks p {
  color: #666;
  font-size: 1rem;
}

/* Erreur */
.error {
  background: #fff5f5;
  color: #c53030;
  padding: 14px 20px;
  border-radius: 8px;
  margin-top: 24px;
  text-align: center;
  font-size: 0.9rem;
  border: 1px solid #feb2b2;
}

/* Page résultats */
.back-link {
  margin-bottom: 40px;
  font-size: 1.1rem;
}

/* Actions administratives */
.admin-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
  padding: 24px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
}

@media (max-width: 480px) {
  .admin-actions {
    flex-direction: column;
  }

  .admin-actions .btn {
    width: 100%;
  }
}

.loading {
  text-align: center;
  padding: 80px 20px;
  color: #666;
}

/* Statistiques */
.stats-section {
  margin-bottom: 48px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.stat-card {
  background: #fafafa;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
}

.stat-card h3 {
  margin-bottom: 4px;
}

.stat-label {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.stat-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.stat-desc {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

/* Graphiques */
.chart-section {
  background: #fafafa;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  margin-bottom: 32px;
}

.chart-section h2 {
  font-size: 1rem;
  margin-bottom: 20px;
}

.chart-container {
  position: relative;
  height: 280px;
}

.chart-large {
  height: 360px;
}

/* Explication */
.explanation {
  background: #fafafa;
  padding: 32px;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
}

.explanation h2 {
  margin-bottom: 16px;
}

.explanation p {
  margin-bottom: 16px;
  color: #444;
  font-size: 0.95rem;
}

.explanation .fact {
  background: #ffffff;
  padding: 16px 20px;
  border-radius: 8px;
  color: #1a1a1a;
  margin-top: 24px;
  margin-bottom: 0;
  border: 1px solid #e0e0e0;
}

/* No data */
#no-data {
  text-align: center;
  padding: 80px 20px;
}

#no-data p {
  margin-bottom: 24px;
  color: #666;
}

/* Modale */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  z-index: 1001;
}

.modal-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h2 {
  font-size: 1.35rem;
  margin: 0;
  color: #1a1a1a;
}

.modal-body {
  padding: 28px;
}

.modal-message {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  margin: 0 0 16px 0;
}

.modal-list {
  list-style: none;
  margin: 16px 0 0 0;
  padding: 20px;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #feb2b2;
}

.modal-list li {
  padding: 8px 0;
  color: #c53030;
  font-size: 0.95rem;
  position: relative;
  padding-left: 24px;
}

.modal-list li:before {
  content: "•";
  position: absolute;
  left: 8px;
  font-weight: bold;
}

.modal-footer {
  padding: 20px 28px 28px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-footer .btn {
  min-width: 100px;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  animation: slideInRight 0.3s ease;
}

.toast.hiding {
  animation: slideOutRight 0.3s ease;
}

.toast-content {
  background: #ffffff;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.95rem;
  color: #1a1a1a;
}

.toast.success .toast-content {
  border-color: #86efac;
  background: #f0fdf4;
}

.toast.error .toast-content {
  border-color: #feb2b2;
  background: #fff5f5;
}

.toast.success .toast-message {
  color: #166534;
}

.toast.error .toast-message {
  color: #c53030;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 24px 20px;
  }

  h1 {
    font-size: 1.25rem;
  }

  .question {
    font-size: 1.1rem;
    margin-bottom: 40px;
  }

  .buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .stat-values {
    grid-template-columns: 1fr 1fr;
  }

  .modal-content {
    margin: 0 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .toast {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .toast-content {
    min-width: 0;
    width: 100%;
  }
}
