/*
 * Gestion des initiations sportives – styles publics
 * Charte inspirée du site de l'Atlantic Tir Club : vert du club, gris clair, Arial.
 * La couleur principale se règle dans Initiations → Réglages → Général (variables --gi-brand*).
 */
.gi-wrap {
	--gi-brand: #37a935;          /* vert du club : bandeaux, bordures, sélection */
	--gi-brand-strong: #297f28;   /* vert foncé : boutons et textes verts (contraste AA) */
	--gi-brand-tint: #ebf6eb;     /* vert très clair : éléments sélectionnés */
	--gi-on-brand: #fff;
	--gi-text: #1f2a1f;
	--gi-border: #cfd6cf;
	--gi-muted: #555f55;
	--gi-bg: #fff;
	--gi-soft: #f0f0f0;           /* gris des tableaux du site */
	--gi-danger: #c40000;
	--gi-warning: #b34700;        /* orange du site, assombri pour la lisibilité */
	--gi-radius: 6px;
	--gi-font: Arial, Helvetica, sans-serif;
	max-width: 680px;
	margin: 0 auto;
	font-family: var(--gi-font);
	font-size: 15px;
	line-height: 1.45;
	color: var(--gi-text);
}
.gi-wrap *, .gi-wrap *::before, .gi-wrap *::after { box-sizing: border-box; }
.gi-wrap button, .gi-wrap input, .gi-wrap select, .gi-wrap textarea { font-family: var(--gi-font); }

/* Étapes : bandeau vert comme les en-têtes de tableaux du site */
.gi-step { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.gi-step legend { float: left; width: 100%; display: flex; align-items: center; gap: 9px; margin: 0 0 10px; padding: 6px 12px; background: var(--gi-brand); color: var(--gi-on-brand); font-size: 1.05em; font-weight: 700; border-radius: var(--gi-radius); }
.gi-step legend + * { clear: both; }
.gi-step-num { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; background: var(--gi-on-brand); color: var(--gi-brand-strong); font-size: .78em; flex: none; }

.gi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .gi-grid { grid-template-columns: 1fr; } }

.gi-field { margin-bottom: 10px; }
.gi-label { display: block; font-weight: 700; margin-bottom: 3px; font-size: .9em; }
.gi-req { color: var(--gi-danger); }
.gi-input { width: 100%; padding: 6px 10px; border: 1px solid var(--gi-border); border-radius: var(--gi-radius); background: var(--gi-bg); font-size: 1em; color: inherit; min-height: 38px; }
.gi-input:focus { outline: 2px solid var(--gi-brand); outline-offset: 1px; border-color: var(--gi-brand); }
.gi-input.gi-invalid { border-color: var(--gi-danger); }
.gi-field-error { color: var(--gi-danger); font-size: .88em; margin: 4px 0 0; }
.gi-field-error:empty { display: none; }
.gi-muted { color: var(--gi-muted); font-size: .9em; margin: 4px 0; }
.gi-tag { display: inline-block; background: var(--gi-soft); border-radius: 999px; padding: 1px 9px; font-size: .8em; font-weight: 700; margin: 4px 0; }
.gi-discipline-info:empty { display: none; }

/* Sessions */
.gi-sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.gi-sessions > p { grid-column: 1 / -1; }
.gi-slot { position: relative; display: block; cursor: pointer; }
.gi-slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.gi-slot__body { display: flex; flex-direction: column; gap: 1px; height: 100%; padding: 7px 10px; border: 1px solid var(--gi-border); border-left: 4px solid var(--gi-soft); border-radius: var(--gi-radius); background: var(--gi-bg); transition: border-color .15s, background .15s; }
.gi-slot:hover .gi-slot__body { border-color: var(--gi-brand); }
.gi-slot input:focus-visible + .gi-slot__body { outline: 2px solid var(--gi-brand-strong); outline-offset: 2px; }
.gi-slot input:checked + .gi-slot__body { border-color: var(--gi-brand); border-left-color: var(--gi-brand); background: var(--gi-brand-tint); }
.gi-slot__date { font-weight: 700; font-size: .95em; }
.gi-slot__time { font-variant-numeric: tabular-nums; font-size: .92em; }
.gi-slot__places { font-size: .82em; color: var(--gi-brand-strong); font-weight: 700; }
.gi-slot__places--low { color: var(--gi-warning); }
.gi-slot__desc { font-size: .8em; color: var(--gi-muted); }
.gi-group-title { font-weight: 700; margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 2px solid var(--gi-brand); }

/* Choix de l'arme */
.gi-armes { display: grid; grid-template-columns: repeat(2, minmax(0, 190px)); gap: 10px; }
@media (max-width: 420px) { .gi-armes { grid-template-columns: 1fr 1fr; gap: 8px; } .gi-arme__photo { height: 44px; } .gi-arme__body { min-height: 88px; padding: 20px 6px 6px; } }
.gi-arme { position: relative; display: block; cursor: pointer; }
.gi-arme input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.gi-arme__body { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; padding: 20px 10px 7px; border: 1px solid var(--gi-border); border-radius: var(--gi-radius); background: var(--gi-bg); color: var(--gi-muted); transition: border-color .15s, background .15s, color .15s; }
.gi-arme__photo { display: flex; align-items: center; justify-content: center; width: 100%; height: 50px; }
.gi-arme__photo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform .15s; }
.gi-arme:hover .gi-arme__photo img, .gi-arme input:checked + .gi-arme__body .gi-arme__photo img { transform: scale(1.04); }
.gi-arme__label { font-weight: 700; color: inherit; font-size: .9em; }
.gi-arme__check { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; border: 1.5px solid var(--gi-border); border-radius: 4px; background: var(--gi-bg); }
.gi-arme:hover .gi-arme__body { border-color: var(--gi-brand); }
.gi-arme input:focus-visible + .gi-arme__body { outline: 2px solid var(--gi-brand-strong); outline-offset: 2px; }
.gi-arme input:checked + .gi-arme__body { border-color: var(--gi-brand); box-shadow: inset 0 0 0 1px var(--gi-brand); background: var(--gi-brand-tint); color: var(--gi-brand-strong); }
.gi-arme input:checked + .gi-arme__body .gi-arme__check { background: var(--gi-brand); border-color: var(--gi-brand); }
.gi-arme input:checked + .gi-arme__body .gi-arme__check::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid var(--gi-on-brand); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.gi-armes.gi-invalid .gi-arme__body { border-color: var(--gi-danger); }
.gi-arme-tag { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.gi-arme-tag .gi-icon { height: 18px; width: auto; }
.gi-details__armes { margin-top: 6px !important; }

.gi-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.gi-rgpd { font-size: .8em; color: var(--gi-muted); background: var(--gi-soft); border-left: 4px solid var(--gi-brand); padding: 7px 10px; border-radius: 0 var(--gi-radius) var(--gi-radius) 0; }

/* Boutons */
.gi-actions { margin: 14px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.gi-actions--split form { margin: 0; }
.gi-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 18px; border-radius: var(--gi-radius); border: 2px solid transparent; font-size: .95em; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s, color .15s; }
.gi-btn:disabled { opacity: .6; cursor: progress; }
.gi-btn--primary { background: var(--gi-brand-strong); color: var(--gi-on-brand); }
.gi-btn--primary:hover:not(:disabled) { background: var(--gi-brand); }
.gi-btn--ghost { background: var(--gi-bg); color: var(--gi-text); border-color: var(--gi-border); }
.gi-btn--ghost:hover { border-color: var(--gi-brand-strong); color: var(--gi-brand-strong); }
.gi-btn--danger { background: var(--gi-danger); color: #fff; }
.gi-btn--danger:hover { background: #a00000; }
.gi-btn:focus-visible { outline: 2px solid var(--gi-brand-strong); outline-offset: 2px; }

/* Messages */
.gi-notice { padding: 9px 12px; border-radius: var(--gi-radius); background: var(--gi-soft); margin: 12px 0; }
.gi-notice p { margin: 0 0 .5em; }
.gi-notice p:last-child { margin: 0; }
.gi-notice--error { background: #fdeeee; border-left: 4px solid var(--gi-danger); color: #7a0d0d; }
.gi-notice--success { background: var(--gi-brand-tint); border-left: 4px solid var(--gi-brand); color: #1c4d1b; }

/* Fiches (recherche / confirmation) */
.gi-card { border: 1px solid var(--gi-border); border-top: 5px solid var(--gi-brand); border-radius: var(--gi-radius); padding: 14px 16px; background: var(--gi-bg); margin: 10px 0; }
.gi-card--warning { border-top-color: var(--gi-danger); }
.gi-card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.gi-card__title { font-size: 1.15em; margin: 0 0 6px; }
.gi-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
@media (max-width: 600px) { .gi-details { grid-template-columns: 1fr; } }
.gi-details__block { background: var(--gi-soft); border-radius: var(--gi-radius); padding: 9px 12px; font-size: .95em; }
.gi-details__block p { margin: 0 0 2px; }
.gi-details__name { font-weight: 700; }

.gi-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .82em; font-weight: 700; }
.gi-badge--en_attente { background: #fff1e5; color: #8a3700; }
.gi-badge--validee { background: var(--gi-brand-tint); color: #1c5e1b; }
.gi-badge--annulee { background: #fdeeee; color: #9b0f0f; }

/* Fenêtre de vérification : bandeau vert */
html.gi-modal-open { overflow: hidden; }
.gi-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; font-family: var(--gi-font); }
.gi-modal[hidden] { display: none; }
.gi-modal__backdrop { position: absolute; inset: 0; background: rgba(20, 30, 20, .6); }
.gi-modal__dialog { position: relative; background: var(--gi-bg); color: var(--gi-text); border-radius: 8px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; padding: 0 18px 16px; font-size: 15px; line-height: 1.4; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.gi-modal__dialog:focus { outline: none; }
.gi-modal__title { margin: 0 -18px 12px; padding: 9px 18px; background: var(--gi-brand); color: var(--gi-on-brand); font-size: 1.08em; font-weight: 700; }
.gi-summary { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0 0 12px; border: 1px solid var(--gi-border); border-radius: var(--gi-radius); overflow: hidden; font-size: .92em; }
.gi-summary dt, .gi-summary dd { padding: 4px 10px; border-bottom: 1px solid var(--gi-border); margin: 0; }
.gi-summary dt { font-weight: 700; background: var(--gi-soft); }
.gi-summary dd { overflow-wrap: anywhere; }
.gi-summary dt:nth-last-of-type(1), .gi-summary dd:last-of-type { border-bottom: 0; }
.gi-consent__title { font-weight: 700; margin: 0 0 4px; font-size: .95em; }
.gi-check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: .9em; }
.gi-check input { width: 17px; height: 17px; margin-top: 1px; flex: none; accent-color: var(--gi-brand-strong); }
.gi-modal__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 480px) { .gi-modal__actions .gi-btn { width: 100%; } }
.gi-step[hidden] { display: none !important; }

/* Protection contre les tailles imposées par le thème */
.gi-wrap legend, .gi-wrap label, .gi-wrap select, .gi-wrap input, .gi-wrap button { line-height: 1.3; }
.gi-wrap p { line-height: 1.45; }
@media (max-width: 600px) { .gi-wrap .gi-input, .gi-wrap select { font-size: 16px; } } /* évite le zoom automatique sur iPhone */
