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

:root {
  --primary-color: #2c3e50;
  --secondary-color: #24562A;
  --success-color: #27ae60;
  --error-color: #e74c3c;
  --bg-color: #f5f7fa;
  --card-bg: #ffffff;
  --text-color: #2c3e50;
  --text-light: #7f8c8d;
  --border-color: #dfe6e9;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

.navbar {
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--secondary-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Styles pour la section compteur total */
.total-counter-section {
  background: linear-gradient(135deg, #24562A 0%, #1e4a24 100%);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-hover);
  color: white;
}

.total-counter h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.total-amount {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.total-target {
  opacity: 0.8;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 25px;
  height: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.progress-fill {
  background: linear-gradient(90deg, #f1c40f 0%, #f39c12 100%);
  height: 20px!important;
  border-radius: 25px;
  transition: width 0.8s ease-in-out;
  width: 0%;
  position: relative;
  display: block;
}

/* Animation désactivée temporairement pour éviter les conflits
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shine 2s infinite;
}
*/

@keyframes shine {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.progress-percentage {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.status-message {
  text-align: center;
  margin: 1rem 0;
  font-size: 1.1rem;
  font-style: italic;
}

.amounts-section,
.update-section {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.amounts-section h2,
.update-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.amounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.amount-card {
  background-color: var(--bg-color);
  border-radius: 8px;
  padding: 1.5rem;
  border-left: 4px solid var(--secondary-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.amount-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.amount-card h3 {
  font-size: 1rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.amount-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.amount-date {
  font-size: 0.875rem;
  color: var(--text-light);
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-style: italic;
}

.forms-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.form-card {
  background-color: var(--bg-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.form-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(36, 86, 42, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 0.875rem;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background-color: #1d4421;
  transform: translateY(-1px);
}

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

.message-container {
  margin-top: 1rem;
  min-height: 20px;
}

.success-message,
.error-message {
  padding: 0.875rem;
  border-radius: 6px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-menu {
    gap: 1.5rem;
    font-size: 0.95rem;
  }

  .container {
    padding: 1rem;
  }

  /* Responsivité pour le compteur total */
  .total-counter-section {
    padding: 1.5rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }

  .progress-container {
    flex-direction: column;
    gap: 0.8rem;
  }

  .progress-bar {
    height: 16px;
    /* Légèrement plus haute sur mobile pour meilleure visibilité */
    min-width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* Plus visible sur mobile */
    border: 2px solid rgba(255, 255, 255, 0.6);
  }

  .progress-fill {
    background: linear-gradient(90deg, #f1c40f 0%, #f39c12 100%) !important;
    height: 100%;
  }

  .progress-percentage {
    text-align: center;
    min-width: auto;
    font-size: 1.2rem;
  }

  .amounts-section,
  .update-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .amounts-grid,
  .forms-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .amount-value {
    font-size: 1.75rem;
  }

  .amount-card {
    padding: 1.25rem;
  }

  .form-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
  }

  .nav-title {
    font-size: 1.1rem;
  }

  .amounts-section h2,
  .update-section h2 {
    font-size: 1.5rem;
  }

  .form-card h3 {
    font-size: 1.1rem;
  }

  .amount-value {
    font-size: 1.5rem;
  }

  .btn-primary {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  /* Styles spécifiques pour le compteur total sur très petits écrans */
  .total-counter-section {
    padding: 1rem;
  }

  .total-counter h2 {
    font-size: 1.2rem;
  }

  .total-amount {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .progress-bar {
    height: 20px;
    /* Encore plus visible sur très petits écrans */
    background-color: rgba(255, 255, 255, 0.9);
    /* Très visible sur petits mobiles */
    border: 2px solid rgba(255, 255, 255, 0.8);
  }

  .progress-fill {
    background: linear-gradient(90deg, #f1c40f 0%, #f39c12 100%) !important;
  }

  .progress-percentage {
    font-size: 1.3rem;
    font-weight: 700;
  }
}