/* ==========================
   Variables globales
========================== */
:root {
  --primary-color: #008CBA;
  --primary-hover: #0076a3;
  --error-bg: #f8d7da;
  --error-color: #842029;
  --success-bg: #d1e7dd;
  --success-color: #0f5132;
  --border-radius: 10px;
  --container-bg: rgba(255, 255, 255, 0.9);
  --container-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  --auth-width: 420px;
  --auth-padding: 30px;
  --font-main: "Segoe UI", Roboto, Arial, sans-serif;
  --bg-light: #f5f7fa;
  --bg-dark: #1f2937;
  --text-dark: #2c3e50;
  --text-light: #fff;
  --gradient-primary: linear-gradient(135deg, #00b4db, #0083b0);
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.text-center { text-align: center; }
.text-right { text-align: right; }

/* ==========================
   Particules / arrière-plan
========================== */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

/* ==========================
   Authentification
========================== */
.auth-container {
  max-width: var(--auth-width);
  margin: 80px auto;
  background: var(--container-bg);
  backdrop-filter: blur(10px);
  padding: var(--auth-padding);
  border-radius: var(--border-radius);
  box-shadow: var(--container-shadow);
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.auth-container h2 {
  margin-bottom: 25px;
  font-size: 26px;
  color: var(--text-dark);
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: var(--border-radius);
  border: 1px solid #ccc;
  font-size: 15px;
  transition: all 0.2s ease-in-out;
}

.auth-form input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 5px rgba(0, 140, 186, 0.4);
  outline: none;
}

.auth-form button {
  width: 100%;
  padding: 14px;
  margin-top: 15px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.auth-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 131, 176, 0.3);
}

.auth-container p a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-container p a:hover {
  text-decoration: underline;
}

/* ==========================
   Grille Produits
========================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card img {
  width: 100%;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
}

.card h3 {
  margin: 10px 0;
  font-size: 20px;
  color: var(--text-dark);
}

.card p {
  font-size: 15px;
  color: #555;
}

.card .btn {
  align-self: flex-start;
  margin-top: 10px;
}

/* ==========================
   Boutons
========================== */
.btn {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 50px;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 131, 176, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 131, 176, 0.3);
}

/* ==========================
   Alertes
========================== */
.alert {
  padding: 12px 15px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  font-size: 14px;
  animation: fadeIn 0.5s ease;
}

.alert.error {
  background: var(--error-bg);
  color: var(--error-color);
  border: 1px solid #f5c2c7;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid #badbcc;
}

.alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  width: 320px;
}

/* ==========================
   Animations
========================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================
   Responsive
========================== */
@media (max-width: 768px) {
  .container { padding: 0 10px; }
  .auth-container { margin: 50px 15px; padding: 20px; }
  .auth-container h2 { font-size: 22px; }
}
