/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --status-ok: #28a745;
  --status-complet: #dc3545;
  --status-avenir: #ffc107;
  --status-neutral: #6c757d;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-md: 10px;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin: 20px 0 16px;
  font-size: 1.15em;
  font-weight: 700;
  color: var(--appli-primary, #ff5522);
  border-bottom: 2px solid var(--appli-primary, #ff5522);
}

.section-title i {
  font-size: 0.9em;
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--appli-primary, #ff5522);
  color: #fff;
  font-size: 0.7em;
  font-weight: 800;
}

.section-title--past {
  color: var(--status-neutral);
  border-bottom-color: #ddd;
}

.section-title--past .section-count {
  background: var(--status-neutral);
}

/* ============================================================
    EVENT GRID (3 colonnes sur grand écran)
    ============================================================ */
.event-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

@media (min-width: 600px) {
  .event-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .event-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   EVENT CARD (lien <a> entier cliquable)
   ============================================================ */
.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8e8e8;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--appli-primary, #ff5522);
}

.event-card--complet {
  opacity: 0.7;
}

.event-card--past {
  opacity: 0.6;
  background: #fafafa;
}

.event-card--past:hover {
  opacity: 1;
}

/* --- Image (skeleton par defaut, puis cover) --- */
.event-card__img {
  aspect-ratio: 2 / 3;
  min-height: 380px;
  background: linear-gradient(90deg, #f4f4f4 25%, #e8e8e8 50%, #f4f4f4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: #f0f0f0;
}

/* Une fois l'image chargee : cover pour remplir sans bords blancs */
.event-card__img[style*="background-image"] {
  animation: none;
  background-size: cover;
  background-position: center center;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Desactiver shimmer une fois l'image chargee */
.event-card__img[style*="background-image"] {
  animation: none;
}

/* --- Badge statut --- */
.event-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  z-index: 2;
}

.badge-ok { background: var(--status-ok); }
.badge-complet { background: var(--status-complet); }
.badge-avenir { background: var(--status-avenir); color: #333; }
.badge-ok_inscription_fini { background: var(--status-neutral); }
.badge-neutral { background: #ccc; color: #555; }

/* --- Tag public cible --- */
.event-card__public {
  margin-top: 4px;
}

.public-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 600;
  background: #f0f4fa;
  color: #5577aa;
  border: 1px solid #d6e2f0;
}

.public-tag i {
  font-size: 0.9em;
}

.public-tag--open {
  background: #e8f8ee;
  color: #28a745;
  border-color: #c3e6d1;
}

/* --- Contenu texte --- */
.event-card__content {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.event-card__title {
  margin: 0;
  font-size: 0.92em;
  font-weight: 700;
  color: #222;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lignes d'info (dates, sessions, inscriptions, places) */
.event-card__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-card__info-row {
  font-size: 0.85em;
  color: #444;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
  font-weight: 600;
}

.event-card__info-row i {
  margin-top: 2px;
  color: #999;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1.1em;
}

/* Date de l'event : plus visible */
.event-card__info-row--deadline {
  color: #d35400;
  font-weight: 700;
  font-size: 0.88em;
  background: #fff8f0;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 2px;
}
.event-card__info-row--deadline i {
  color: #e67e22;
}

.event-card__info-row--places {
  color: #444;
  font-weight: 600;
}
.event-card__info-row--places i {
  color: var(--appli-primary, #ff5522);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #bbb;
}

.empty-state i {
  font-size: 2.5em;
  margin-bottom: 10px;
  display: block;
}

.empty-state p {
  margin: 0;
  font-size: 0.9em;
  color: #999;
}

/* ============================================================
   LEGACY STYLES (conserves pour les autres pages)
   ============================================================ */

fieldset {
  border: 1px solid var(--appli-primary, #ff5522);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
  background-color: #fff;
}

legend {
  font-weight: bold;
  color: var(--appli-primary, #ff5522);
  padding: 0 10px;
  font-size: 1.1em;
}

.pc-fieldset { margin:8px 0 14px; padding:10px; border-radius:6px; border:1px solid rgba(255,85,34,0.15); background:#fff; }
.pc-fieldset p.modulebo_intertitre { margin:6px 0 8px; }
.pc-fieldset legend + .modulebo_intertitre { margin-top:4px; }

/* --- Date Cards --- */
.date-list-cards { display: flex; flex-direction: column; gap: 14px; }
.date-card { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; background: #fafafa; transition: box-shadow 0.2s; }
.date-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.date-card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: linear-gradient(135deg, var(--appli-primary, #ff5522), #ff7a4d); color: #fff; }
.date-card-badge { font-weight: 600; font-size: 0.9em; display: flex; align-items: center; gap: 6px; }
.btn-remove-date { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4); color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 0.85em; transition: background 0.2s; }
.btn-remove-date:hover { background: rgba(255,255,255,0.35); }
.date-card-body { padding: 16px; }
.date-card-section { margin-bottom: 14px; }
.date-card-section:last-child { margin-bottom: 0; }
.date-section-label { display: flex; align-items: center; gap: 6px; font-size: 0.85em; font-weight: 600; color: #555; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.date-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-field { display: flex; flex-direction: column; gap: 4px; }
.date-field label { font-size: 0.8em; font-weight: 600; color: #777; }
.date-input { width: 100%; padding: 8px 10px; border: 1px solid #d0d0d0; border-radius: 6px; font-size: 0.9em; background: #fff; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; }
.date-input:focus { outline: none; border-color: var(--appli-primary, #ff5522); box-shadow: 0 0 0 2px rgba(255,85,34,0.15); }

.fieldset_appli p { margin-bottom: 12px; line-height: 1.5; color: #333; }
.fieldset_appli p:last-of-type { margin-bottom: 0; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .col { flex: 1 1 200px; min-width: 180px; }
.form-row .col.full-width { flex: 1 1 100%; min-width: 220px; }

.reservation-label { display: block; margin-bottom: 6px; font-weight: bold; color: #555; }

input[type="text"], input[type="date"], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 14px;
}

.dz-preview .dz-image img { width: 100%; height: auto; }
.dropzone { border: 2px dashed #ccc; padding: 12px; border-radius: 6px; background: #fafafa; }

.rt-toolbar { display: flex; gap: 6px; margin-bottom: 6px; }
.rt-toolbar button { padding: 6px 8px; font-weight: bold; background: #f2f2f2; border: 1px solid #e0e0e0; border-radius: 4px; cursor: pointer; }
.rt-toolbar button:active { transform: translateY(1px); }

.editor { min-height: 140px; border: 1px solid #ddd; padding: 8px; border-radius: 4px; background: #fff; }
.editor:focus { outline: 2px solid rgba(255,85,34,0.25); box-shadow: 0 0 0 3px rgba(255,85,34,0.06); }

.note { font-size: 0.9em; color: #666; }
.actions { margin-top: 12px; }
.actions.right { text-align: right; }
.submit { background: var(--appli-primary, #ff5522); color: #fff; border: none; padding: 8px 14px; border-radius: 4px; cursor: pointer; }

.modulebo_intertitre { margin: 12px 0 8px; font-size: 1.03em; color: var(--appli-primary, #ff5522); font-weight: 600; }

.tree { padding: 6px 0; }
.tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree li { margin: 6px 0; }
.tree li.collapsed > ul { display: none; }
.tree b { font-weight: 600; color: #333; }
.tree input[type="checkbox"] { margin-right: 8px; transform: scale(1.02); vertical-align: middle; }
.tree .scroll { cursor: pointer; color: var(--appli-primary, #ff5522); margin-left: 6px; font-size: 0.95em; }

#liste_tous_diplomes { padding: 10px; border: 1px solid #eee; border-radius: 6px; background: #fff; box-shadow: none; }
.annees-checkbox { display: block; background: #fff; padding: 8px; border-radius: 6px; border: 1px solid #eee; }
.annees-checkbox label { display: inline-block; margin: 6px 8px; padding: 6px 8px; border-radius: 4px; background: transparent; cursor: pointer; color: #333; border: 1px solid transparent; }
.annees-checkbox label input[type="checkbox"] { margin-right: 6px; vertical-align: middle; }
.annees-checkbox label:hover { background: #fafafa; border-color: #f0f0f0; }

input[type="radio"], input[type="checkbox"] { vertical-align: middle; margin-right: 6px; }
label { cursor: pointer; }
#div_tous_les_etudiants, #div_membres_alumni, #div_membres_casuc { padding: 8px 0; }

.profiles-inline { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; overflow: hidden; }
.profiles-inline b { margin-right: 8px; font-weight: 700; }
.profiles-controls { display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; }
.profiles-controls label { margin: 0; font-weight: 600; color: #444; white-space: nowrap; font-size: 0.95em; }
.profiles-controls input[type="checkbox"] { transform: scale(1); margin: 0 6px 0 0; }
@media (max-width: 520px) { .profiles-inline { flex-wrap: wrap; } .profiles-controls { gap: 8px; } }

.wide { width: 100%; box-sizing: border-box; }
.small-input { width: 90px; }
.paybox-block { flex: 1 1 100%; margin-top: 6px; padding: 6px; border: 1px solid #eee; background: #fafafa; }

.meta-list { display: flex; gap: 12px; flex-wrap: wrap; color: #555; margin-top: 6px; }
.meta-list .item { background: #fafafa; padding: 6px 8px; border-radius: 6px; border: 1px solid #f0f0f0; font-size: 0.95em; }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 0.9em; color: #fff; }
.status-confirmed { background: #28a745; }
.status-pending { background: #ffb703; color: #1a1a1a; }
.status-cancel { background: #dc3545; }
.status-unknown { background: #6c757d; }
.card { background: #fff; border: 1px solid #eee; padding: 12px; border-radius: 8px; box-shadow: 0 1px 0 rgba(0,0,0,0.02); }
.actions .submit.small { padding: 6px 10px; font-size: 0.95em; }

.date-list { max-height: 520px; overflow: auto; }
.date-list .date-item { display: flex; align-items: center; justify-content: space-between; padding: 0; border-bottom: 1px solid #efefef; gap: 12px; }
.date-list .date-item .col { flex: 1; }
.date-list .date-item .title { font-weight: 600; font-size: 0.98em; }
.date-list .date-item .meta { font-size: 0.82em; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-list .date-item.past { opacity: 0.75; }
.reserve-label { background: transparent; color: #222; padding: 6px 10px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border: 1px solid #d6d6d6; }
.reserve-label:hover { background: #fafafa; }
.reserve-label.disabled { background: #f3f3f3; color: #888; border-color: #e0e0e0; cursor: not-allowed; }
.reserve-label.checked { background: #007bff; color: #fff; border-color: transparent; }
.reserve-label input { display: none; }
.reserve-label::before { content: ''; width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 2px solid #bbb; background: transparent; box-sizing: border-box; }
.reserve-label.checked::before { background: #fff; border-color: transparent; box-shadow: inset 0 0 0 6px #fff; }
.reserve-label.checked { background: #007bff; }
.date-list .date-meta { margin: 0; font-size: 0.82em; color: #666; }
.small-meta { font-size: 0.86em; color: #4a4a4a; margin-left: 10px; display: inline-block; vertical-align: middle; }
.admin-as { font-size: 0.85em; display: inline-block; margin-left: 8px; }

.authcol33 { width: 32%; background-color: #fff; border: solid 2px var(--appli-primary, #ff5522); padding: 10px; margin: 5px; float: left; min-height: 200px; text-align: center; }
.authbouton { background-color: #444444; border: 1px solid #f4f4f4; text-align: center; color: white; padding: 10px; }
.authprofil { color: var(--appli-primary, #ff5522); font-size: 12pt; height: auto; min-height: 60px; margin: 0px 0px 20px 0px; }
@media only screen and (max-width: 980px) { .authcol33 { width: 100%; float: none; margin-bottom: 10px; } }

@keyframes highlight-pulse {
  0% { background-color: transparent; }
  15% { background-color: #fff3cd; }
  30% { background-color: transparent; }
  45% { background-color: #fff3cd; }
  60% { background-color: transparent; }
  75% { background-color: #fff3cd; }
  100% { background-color: transparent; }
}
.date-item.highlight-error { animation: highlight-pulse 2s ease-in-out; border-left: 4px solid #ffc107; padding-left: 12px; }

/* Legacy galerie */
.galerieprojets_recherche { background-color: #ffffff; text-align: justify; padding: 10px; border-bottom: 10px solid #f4f4f4; }
.galerieprojets_recherche_bloc1 { float: left; width: 30%; }
.galerieprojets_recherche_bloc2 { float: left; width: 70%; }
.galerieprojets_recherche_bloc2 select { background-color: #fff; border: 1px solid #d1d1d1; padding: 10px; display: block; appearance: none; border-radius: 0; width: 100%; margin: 5px 0 5px 0; color: #777; font-weight: 300; font-size: .9em; }
.galerieprojets_recherche_bloc2 input { background-color: #fff; padding: 10px; margin-bottom: 5px; }
.galerieprojets_intertitre { margin: 40px 0 10px 0; padding: 10px 0 0 0; border-top: 1px solid #b4b3b3; text-transform: uppercase; font-family: "Ubuntu", sans-serif; font-weight: 500; letter-spacing: 1px; font-size: 1.2em; color: #111; }
.galerieprojets_intertitre span:before { border-left: 3px solid #767676; content: ""; margin: 0 10px 0 15px; }
.galerieprojets_intertitre span { text-transform: none; font-weight: normal; color: #777777; }
.galerieprojets_liste_legend { position: relative; width: 310px; height: 310px; margin: 10px; float: left; }
.galerieprojets_liste_legend .caption { position: absolute; bottom: 0; left: 0; right: 0; top: 0; z-index: 1; color: white; text-shadow: 1px 1px 8px rgba(0,0,0,.8) !important; will-change: background, opacity; transition: background 0.15s ease, opacity 0.15s ease; }
.galerieprojets_liste_legend .caption:hover { background: var(--appli-primary, #ff5522); opacity: 0.8; }
.galerieprojets_liste_legend .caption:before { content: "\f06e"; position: absolute; top: 50%; left: 50%; margin: -18px 0 0 -18px; font-size: 3em; font-family: "Font Awesome 5 Pro"; line-height: 1; opacity: 0; transition: opacity 0.15s ease; pointer-events: none; }
.galerieprojets_liste_legend .caption:hover:before { opacity: 1; }
.galerieprojets_liste_legend .caption div { position: absolute; bottom: 20px; left: 20px; font-family: "merlo_med", sans-serif; font-size: 1.3em; }
.galerieprojets_liste_legend .caption span { display: block; font-size: 1em; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; font-family: "Ubuntu", sans-serif; font-size: .7em; text-shadow: 1px 1px 8px rgba(0,0,0,1) !important; }
.galerieprojets_liste_img { height: 310px; width: 310px; background-size: cover; background-position: 50% 50%; overflow: hidden; z-index: 0; will-change: transform; }
@media screen and (max-width: 960px) {
  .galerieprojets_recherche_bloc1 { width: 100%; }
  .galerieprojets_recherche_bloc2 { width: 100%; }
}

@media (max-width: 640px) {
  .form-row .col { flex: 1 1 100%; }
  .annees-checkbox label { width: calc(50% - 18px); box-sizing: border-box; }
}