/* =========================================
   ASSISTER AUX ÉMISSIONS — v1
   ========================================= */

.ae-body {
  background: #f8fafc;
  padding: 40px 0 64px;
  min-height: 400px;
  font-family: var(--font);
}
.ae-wrap {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* ── Mise en page : photos à gauche, sélection à droite ── */
.ae-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
  margin: 0 0 32px;
}
.ae-layout--no-photos { grid-template-columns: 1fr; }
.ae-layout-main { min-width: 0; }

/* Photos "posées sur la table", légèrement inclinées */
.ae-photo-scatter {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 16px;
  justify-content: center;
  padding: 14px 6px;
}
.ae-layout-photos .ae-photo-scatter {
  flex-direction: column;
  align-items: center;
  flex-wrap: nowrap;
}
.ae-layout-photos .ae-photo-card { width: 100%; max-width: 220px; }
@media (max-width: 860px) {
  .ae-layout { grid-template-columns: 1fr; }
  .ae-layout-photos .ae-photo-scatter { flex-direction: row; flex-wrap: wrap; }
  .ae-layout-photos .ae-photo-card { width: 190px; max-width: none; }
}
.ae-photo-card {
  width: 190px;
  background: #fff;
  padding: 8px 8px 24px;
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(15,23,42,0.16), 0 2px 5px rgba(15,23,42,0.08);
  transform: rotate(-6deg);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ae-photo-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 2px;
  background: #f1f5f9;
}
.ae-photo-card:nth-child(2n) { transform: rotate(5deg); }
.ae-photo-card:nth-child(3n) { transform: rotate(-3deg); }
.ae-photo-card:nth-child(4n) { transform: rotate(7deg); }
.ae-photo-card:nth-child(5n) { transform: rotate(-8deg); }
.ae-photo-card:hover {
  transform: rotate(0deg) scale(1.06);
  box-shadow: 0 16px 32px rgba(15,23,42,0.22);
  z-index: 1;
}
@media (max-width: 560px) {
  .ae-photo-scatter { gap: 14px 8px; }
  .ae-photo-card { width: 130px; }
  .ae-photo-card img { height: 96px; }
}

/* Étapes, en ligne horizontale sur ordinateur */
.ae-howto {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 28px;
}
.ae-howto-step {
  flex: 1 1 0;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ae-howto-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #d91319;
  color: #fff;
  font-weight: 900;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ae-howto-text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}
.ae-howto-arrow {
  flex: 0 0 auto;
  align-self: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: #cbd5e1;
}
@media (max-width: 700px) {
  .ae-howto { flex-wrap: wrap; }
  .ae-howto-step { flex: 1 1 calc(50% - 5px); }
  .ae-howto-arrow { display: none; }
}

/* ── Boutons de date rapide ── */
.ae-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.ae-date-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid rgba(15,23,42,0.1);
  background: #fff;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .1s;
}
.ae-date-btn:hover:not(.is-active) { border-color: #d91319; color: #d91319; }
.ae-date-btn:active { transform: scale(0.97); }
.ae-date-btn.is-active {
  background: #d91319;
  border-color: #d91319;
  color: #fff;
  box-shadow: 0 3px 10px rgba(217,19,25,0.3);
}

/* ── Barre d'outils : filtres ── */
.ae-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
}
.ae-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ae-filter-chip {
  --ae-c: #d91319;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid rgba(15,23,42,0.1);
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.ae-filter-chip:hover:not(.is-active) { border-color: var(--ae-c); color: var(--ae-c); }
.ae-filter-chip.is-active { background: var(--ae-c); border-color: var(--ae-c); color: #fff; }

/* ── Liste ── */
.ae-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ae-card {
  --ae-c: #d91319;
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  border-left: 4px solid var(--ae-c);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.04);
}

.ae-card-logo {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  background: #f1f5f9;
}
.ae-card-logo-ph { opacity: 0.85; }

.ae-card-body { flex: 1 1 auto; min-width: 0; }

.ae-card-emission {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ae-c);
}

.ae-card-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.ae-card-rdv {
  margin: 0 0 4px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}

.ae-card-meta {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.ae-card-guests {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.ae-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(22,163,74,0.1);
  color: #16a34a;
  font-size: 0.72rem;
  font-weight: 800;
}
.ae-badge--full {
  background: rgba(217,19,25,0.09);
  color: #d91319;
}
.ae-badge--off {
  background: rgba(100,116,139,0.12);
  color: #64748b;
}

.ae-card-cta-wrap { flex: 0 0 auto; }

.ae-card-cta {
  padding: 11px 18px;
  border-radius: 10px;
  border: none;
  background: #d91319;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  font-family: var(--font);
}
.ae-card-cta:hover:not(:disabled) { background: #b8100f; }
.ae-card-cta:active:not(:disabled) { transform: scale(0.97); }
.ae-card-cta:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}
.ae-card-cta--waitlist { background: #0f172a; }
.ae-card-cta--waitlist:hover { background: #1e293b; }

@media (max-width: 560px) {
  .ae-card { flex-wrap: wrap; }
  .ae-card-logo { width: 48px; height: 48px; }
  .ae-card-cta-wrap { flex: 1 1 100%; }
  .ae-card-cta { width: 100%; }
}

/* ── États vides / erreur ── */
.ae-state {
  text-align: center;
  padding: 64px 20px;
}
.ae-state-emoji { font-size: 2.4rem; margin: 0 0 10px; }
.ae-state-title { margin: 0 0 4px; font-weight: 800; color: #0f172a; }
.ae-state-sub { margin: 0; color: #64748b; font-size: 0.9rem; }

/* ── Squelettes ── */
.ae-skel-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 16px;
  padding: 18px 20px;
}
.ae-skel-logo, .ae-skel-line, .ae-skel-cta {
  background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: ae-shimmer 1.4s ease infinite;
  border-radius: 8px;
}
.ae-skel-logo { width: 60px; height: 60px; border-radius: 12px; flex: 0 0 auto; }
.ae-skel-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
.ae-skel-line--lg { height: 16px; width: 60%; }
.ae-skel-line--md { height: 12px; width: 42%; }
.ae-skel-line--sm { height: 12px; width: 26%; }
.ae-skel-cta { width: 130px; height: 38px; flex: 0 0 auto; }
@keyframes ae-shimmer { 0%{background-position:100% 0} 100%{background-position:0 0} }

/* ── Panneau d'inscription inline (fondu, sans overlay) ── */
.ae-form-panel {
  position: relative;
  margin: 0 0 16px;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 20px;
  padding: 28px 26px 26px;
  font-family: var(--font);
  box-shadow: 0 8px 28px rgba(15,23,42,0.12);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease;
}
.ae-form-panel.is-open {
  opacity: 1;
  transform: translateY(0);
}
.ae-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ae-modal-close:hover { background: #e2e8f0; }

.ae-modal-head { margin: 0 0 18px; padding-right: 30px; }
.ae-modal-emission {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d91319;
}
.ae-modal-title { margin: 0 0 4px; font-size: 1.2rem; font-weight: 900; color: #0f172a; }
.ae-modal-meta { margin: 0 0 8px; font-size: 0.85rem; color: #64748b; }
.ae-modal-note {
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(217,19,25,0.08);
  border: 1px solid rgba(217,19,25,0.18);
  color: #b8100f;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.4;
}

.ae-form { display: flex; flex-direction: column; gap: 14px; }
.ae-field-row { display: flex; gap: 12px; }
.ae-field { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; }
.ae-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
}
.ae-field input, .ae-field select {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.92rem;
  font-family: var(--font);
  color: #0f172a;
  background: #fff;
}
.ae-field input:focus, .ae-field select:focus {
  outline: none;
  border-color: #d91319;
}
.ae-field--qty { max-width: 110px; }

.ae-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #475569;
  cursor: pointer;
}
.ae-consent input { margin-top: 2px; accent-color: #d91319; flex: 0 0 auto; }
.ae-consent a { color: #d91319; font-weight: 700; }

.ae-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ae-form-error, .ae-form-success {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.ae-form-error { background: rgba(217,19,25,0.08); color: #b8100f; }
.ae-form-success { background: rgba(22,163,74,0.1); color: #15803d; }

.ae-form-submit {
  margin-top: 4px;
  padding: 13px 18px;
  border-radius: 12px;
  border: none;
  background: #d91319;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s;
  font-family: var(--font);
}
.ae-form-submit:hover:not(:disabled) { background: #b8100f; }
.ae-form-submit:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 480px) {
  .ae-field-row { flex-direction: column; }
}

/* Toute règle de cette feuille qui pose un display sur un élément
   doit rester masquée si l'attribut HTML [hidden] est présent
   (les styles auteur passent devant l'UA stylesheet à spécificité égale). */
[hidden] { display: none; }
