/* ============================================================
   COMPONENTS.CSS — Boutons, icônes, alert-box, grilles, cartes
   ============================================================ */


/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.btn:hover {
  background-color: var(--primary-dark);
  color: #ffffff;
}

/* Variante outline (secondaire) */
.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #ffffff;
}

/* Variante petite taille */
.btn-sm {
  padding: 10px 16px;
  font-size: 0.9rem;
  width: 100%;
}

/* État chargement */
.btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}


/* --- Icônes SVG --- */
.icon {
  display: inline-block;
  vertical-align: middle;
}

.btn svg {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}


/* --- Encart de vigilance (Alert-box) --- */
.alert-box {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.alert-box svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  stroke: #856404;
}

.alert-box p {
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
  color: #856404;
}


/* --- Grille de cartes --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}


/* --- Cartes --- */
.card {
  background: var(--bg-color);
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
  border-bottom: 4px solid transparent;
}

.card:hover {
  transform: translateY(-5px);
  border-bottom: 4px solid var(--primary-color);
}

.card h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.card p {
  color: var(--text-light);
}

.card-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.card-icon svg {
  width: 48px;
  height: 48px;
  stroke: var(--primary-color);
  stroke-width: 1.5;
  transition: var(--transition);
}

.card:hover .card-icon svg {
  stroke: var(--primary-dark);
}

/* Variante : carte fond primaire (ex. "Particuliers") */
.card--primary {
  background-color: var(--primary-color);
  color: white;
}

.card--primary h3 {
  color: white;
}

.card--primary p {
  color: #f0f0f0;
}

.card--primary .card-icon svg {
  stroke: #ffffff;
}

.card--primary:hover .card-icon svg {
  stroke: #e0f6ff;
}

/* Variante : carte encadrée accent (ex. "Associations") */
.card--outlined {
  border: 2px solid var(--primary-color);
}


/* --- Layouts côte-à-côte (Formations, Cybersécurité…) --- */
.flex-split {
  display: flex;
  align-items: center;
  gap: 50px;
  flex-wrap: wrap;
}

.flex-split > div {
  flex: 1;
  min-width: 300px;
}

/* Modificateur : image en premier (visuel à gauche, texte à droite) */
.flex-split--reverse > div:first-child { order: 2; }
.flex-split--reverse > div:last-child  { order: 1; }


/* --- Images de section --- */
.illustration-formation {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.partner-image {
  border-radius: 8px;
  max-width: 100%;
}


/* --- Cartes de téléchargement (usage futur / RustDesk…) --- */
.download-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.download-card h3 {
  margin-bottom: 20px;
}

.download-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.brand-icon {
  fill: var(--primary-color);
  color: var(--primary-color);
  transition: var(--transition);
}

.card:hover .brand-icon {
  fill: var(--primary-dark);
  color: var(--primary-dark);
}


/* --- Responsive --- */
@media (max-width: 768px) {
  .flex-split {
    flex-direction: column;
    gap: 30px;
  }

  .flex-split > div {
    width: 100%;
    min-width: 100%;
  }

  /* En colonne, l'ordre naturel du DOM suffit */
  .flex-split--reverse > div:first-child,
  .flex-split--reverse > div:last-child {
    order: unset;
  }

  .grid {
    grid-template-columns: 1fr !important;
  }

  .alert-box {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}
