/* AFC des Camélias – gestion + programmation. Toutes les classes sont préfixées afc- */
:root {
	--afc-violet: #93156C;
	--afc-orange: #EB6A28;
	--afc-text: #222;
	--afc-bg: #fff;
	--afc-border: #d9cfd6;
}

.afc-wrap, .afc-prog { font-family: inherit; font-size: 20px; line-height: 1.5; color: var(--afc-text); background: var(--afc-bg); box-sizing: border-box; }
.afc-wrap *, .afc-prog * { box-sizing: border-box; }
.afc-wrap { max-width: 760px; margin: 0 auto; padding: 16px; }

.afc-title { color: var(--afc-violet); font-size: 1.7em; margin: 0 0 .6em; line-height: 1.2; }
.afc-lead { font-size: 1.1em; }

/* Boutons */
.afc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 12px 24px; border: 3px solid var(--afc-violet); border-radius: 12px; background: #fff; color: var(--afc-violet); font-size: 1em; font-weight: 700; text-decoration: none; cursor: pointer; font-family: inherit; line-height: 1.2; text-align: center; }
.afc-btn:hover, .afc-btn:focus { filter: brightness(.95); outline: 3px solid var(--afc-orange); outline-offset: 2px; }
.afc-btn--primary { background: var(--afc-violet); color: #fff; }
.afc-btn--secondary { background: #fff; color: var(--afc-violet); }
.afc-btn--danger { background: #fff; color: #b3261e; border-color: #b3261e; }
.afc-btn--big { min-height: 64px; font-size: 1.1em; }

/* Messages */
.afc-alert { padding: 14px 18px; border-radius: 10px; font-weight: 600; margin: 0 0 20px; }
.afc-alert--ok { background: #e8f6ec; border: 2px solid #2e7d32; color: #1b5e20; }
.afc-alert--error { background: #fdecea; border: 2px solid #b3261e; color: #7a1712; }

/* Liste */
.afc-list { list-style: none; margin: 24px 0 0; padding: 0; }
.afc-list__item { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px; margin-bottom: 14px; border: 2px solid var(--afc-border); border-left: 8px solid var(--afc-orange); border-radius: 12px; }
.afc-list__thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.afc-list__info { flex: 1 1 260px; display: flex; flex-direction: column; }
.afc-list__name { font-size: 1.15em; color: var(--afc-violet); }
.afc-list__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Formulaire */
.afc-field { margin-bottom: 22px; flex: 1 1 220px; }
.afc-field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--afc-violet); }
.afc-field input[type="text"], .afc-field input[type="date"], .afc-field input[type="time"], .afc-field select, .afc-field textarea { display: block; width: 100%; min-height: 56px; padding: 12px 14px; font-size: 1em; font-family: inherit; color: var(--afc-text); background: #fff; border: 3px solid var(--afc-border); border-radius: 10px; }
.afc-field input[type="file"] { display: block; width: 100%; padding: 12px 0; font-size: .95em; }
.afc-field input:focus, .afc-field select:focus, .afc-field textarea:focus { border-color: var(--afc-orange); outline: none; }
.afc-field textarea { min-height: 160px; }
.afc-row { display: flex; flex-wrap: wrap; gap: 0 20px; }
.afc-hint { font-size: .85em; color: #555; margin: 4px 0 0; }
.afc-form__thumb { max-width: 220px; height: auto; border-radius: 10px; margin-bottom: 8px; }
.afc-newlieu { border: 3px dashed var(--afc-orange); border-radius: 12px; padding: 16px 16px 0; margin: 0 0 22px; }
.afc-newlieu[hidden] { display: none; }
.afc-newlieu legend { font-weight: 700; padding: 0 8px; color: var(--afc-orange); }
.afc-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.afc-wrap .login-username input, .afc-wrap .login-password input { width: 100%; min-height: 56px; font-size: 1em; padding: 10px; border: 3px solid var(--afc-border); border-radius: 10px; }
.afc-wrap .login-submit input { min-height: 60px; padding: 12px 24px; font-size: 1.1em; font-weight: 700; color: #fff; background: var(--afc-violet); border: 0; border-radius: 12px; cursor: pointer; }

/* Programmation publique : grille type agenda */
.afc-prog-wrap { --afc-cols: 4; font-family: inherit; font-size: 18px; line-height: 1.45; color: var(--afc-text); box-sizing: border-box; }
.afc-prog-wrap *, .afc-modal * { box-sizing: border-box; }
.afc-prog { display: grid; grid-template-columns: 1fr; gap: 20px; }
.afc-card { margin: 0; }
.afc-card__btn { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; text-align: left; font: inherit; color: inherit; background: #fff; border: 2px solid var(--afc-border); border-top: 6px solid var(--afc-orange); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.afc-card__btn:hover, .afc-card__btn:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(147, 21, 108, .2); outline: 3px solid var(--afc-orange); outline-offset: 2px; }
.afc-card__img { position: relative; display: block; aspect-ratio: 4 / 3; background: #f3e6ef; overflow: hidden; }
.afc-card__img img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.afc-card__noimg { position: absolute; inset: 0; display: block; background: linear-gradient(135deg, var(--afc-violet), var(--afc-orange)); }
.afc-card__badge { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 6px 10px; background: var(--afc-violet); color: #fff; border-radius: 10px; line-height: 1.1; }
.afc-card__day { font-size: 1.5em; font-weight: 800; }
.afc-card__month { font-size: .8em; text-transform: uppercase; letter-spacing: .05em; }
.afc-card__text { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.afc-card__num { align-self: flex-start; background: var(--afc-orange); color: #fff; font-weight: 700; font-size: .8em; padding: 1px 10px; border-radius: 20px; }
.afc-card__title { color: var(--afc-violet); font-size: 1.15em; font-weight: 800; line-height: 1.2; }
.afc-card__when { font-size: .9em; text-transform: capitalize; }
.afc-card__time { font-weight: 700; color: var(--afc-orange); }
.afc-card__more { margin-top: auto; padding-top: 8px; font-weight: 700; font-size: .9em; color: var(--afc-violet); text-decoration: underline; }

/* En-tête et séparation par mois */
.afc-prog__head { text-align: center; margin: 0 0 28px; }
.afc-prog-wrap .afc-prog__h { color: var(--afc-violet); font-size: 2em; line-height: 1.2; margin: 0 0 10px; }
.afc-prog__intro { font-size: 1.05em; margin: 0 auto; max-width: 720px; }
.afc-prog-wrap .afc-prog__month { color: var(--afc-violet); font-size: 1.5em; margin: 36px 0 18px; padding-bottom: 8px; border-bottom: 3px solid var(--afc-orange); line-height: 1.2; }
.afc-prog__head + .afc-prog__month { margin-top: 0; }

/* Fenêtre de détails */
.afc-modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--afc-text); font-size: 18px; line-height: 1.5; overflow: auto; }
.afc-modal::backdrop { background: rgba(30, 10, 25, .65); }
.afc-modal__close { position: sticky; top: 0; display: block; margin: 0 0 0 auto; min-height: 52px; padding: 10px 20px; font: inherit; font-weight: 700; color: #fff; background: var(--afc-violet); border: 0; border-bottom-left-radius: 12px; cursor: pointer; z-index: 2; }
.afc-modal__close:hover, .afc-modal__close:focus-visible { background: var(--afc-orange); outline: none; }
.afc-modal__img { padding: 16px 22px 0; text-align: center; }
.afc-modal__img img { display: inline-block; width: auto; max-width: 100%; height: auto; max-height: 200px; object-fit: contain; border-radius: 10px; }
.afc-modal__body { padding: 20px 22px 26px; }
.afc-prog__num { display: inline-block; background: var(--afc-orange); color: #fff; font-weight: 700; padding: 2px 12px; border-radius: 20px; font-size: .85em; margin-bottom: 8px; }
.afc-prog__title { color: var(--afc-violet); font-size: 1.6em; line-height: 1.2; margin: 0 0 8px; }
.afc-prog__when { margin: 0 0 8px; font-weight: 700; }
.afc-prog__date { text-transform: capitalize; }
.afc-prog__time { color: var(--afc-orange); margin-left: 10px; }
.afc-prog__place { margin: 0 0 10px; color: #555; }
.afc-prog__desc p { margin: 0 0 .8em; }
.afc-prog__prices { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.afc-prog__prices li { background: #f8eef4; border-radius: 10px; padding: 8px 14px; }
.afc-prog__prices span { display: block; font-size: .8em; color: #555; }
.afc-prog__prices strong { color: var(--afc-violet); font-size: 1.1em; }
.afc-prog__empty { font-size: 1.1em; }

/* Survol / focus d'une case : fond violet, tous les textes en blanc (prime sur le thème) */
.afc-prog-wrap .afc-card .afc-card__btn:hover,
.afc-prog-wrap .afc-card .afc-card__btn:focus-visible { background: var(--afc-violet); border-color: var(--afc-violet); color: #fff; }
.afc-prog-wrap .afc-card .afc-card__btn:hover span,
.afc-prog-wrap .afc-card .afc-card__btn:focus-visible span { color: #fff; }
.afc-prog-wrap .afc-card .afc-card__btn:hover .afc-card__num,
.afc-prog-wrap .afc-card .afc-card__btn:focus-visible .afc-card__num { background: var(--afc-orange); }
.afc-prog-wrap .afc-card .afc-card__btn:hover .afc-card__badge,
.afc-prog-wrap .afc-card .afc-card__btn:focus-visible .afc-card__badge { background: #fff; color: var(--afc-violet); }
.afc-prog-wrap .afc-card .afc-card__btn:hover .afc-card__badge span,
.afc-prog-wrap .afc-card .afc-card__btn:focus-visible .afc-card__badge span { color: var(--afc-violet); }

/* Bouton d'inscription (fin de la fenêtre de détails) */
.afc-prog__cta { margin: 22px 0 0; text-align: center; }
.afc-modal .afc-prog__signup { display: inline-flex; align-items: center; justify-content: center; min-height: 60px; padding: 12px 28px; background: var(--afc-orange); color: #fff; font-size: 1.05em; font-weight: 800; text-decoration: none; border-radius: 12px; border: 3px solid var(--afc-orange); }
.afc-modal .afc-prog__signup:hover, .afc-modal .afc-prog__signup:focus-visible { background: var(--afc-violet); border-color: var(--afc-violet); color: #fff; outline: none; }

@media (max-width: 519px) { .afc-modal__img img { max-height: 160px; } }
@media (min-width: 520px) { .afc-prog { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 820px) { .afc-prog { grid-template-columns: repeat(min(3, var(--afc-cols)), 1fr); } }
@media (min-width: 1100px) { .afc-prog { grid-template-columns: repeat(var(--afc-cols), 1fr); } }
