/* Devenir Guide : la section de Spiritime, la carte « Mon statut Spiritime », la page de candidature et le bloc « Mes espaces » des Guides.
   Se charge après theme.css et n'emploie que ses couleurs et ses composants. Toutes les règles portent le préfixe .gp-. */

/* ---------- Ancres : le lien arrive juste au-dessus de la section ---------- */
#devenir-guide, #statut-spiritime, #candidature, #communaute, #gpProfile { scroll-margin-top: 16px; }

/* ---------- Message évolutif, jauge, phrase de cadrage ---------- */
.gp-section { margin-top: 56px; }
.gp-section .section-head { margin-bottom: 24px; max-width: 46rem; }
.gp-panel { display: grid; gap: 18px; }
.gp-panel > .acct-h { margin-bottom: 0; }
/* Le contenu d'une carte rendue par script (statut dans Mon compte, profil Guide) : un même espacement entre ses blocs. */
.gp-body { display: grid; gap: 14px; }
.gp-body > * { min-width: 0; }
.gp-live { margin-top: 10px; min-height: 0; }
.gp-message { font: 600 clamp(1.3rem, 4.4vw, 1.75rem)/1.35 var(--font-display); color: var(--forest); overflow-wrap: anywhere; }

.gp-gauge { display: grid; gap: 8px; }
.gp-track { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gp-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); transition: width .4s ease; }
.gp-gauge-line { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: .9375rem; color: var(--ink-2); }
.gp-gauge-line strong { color: var(--ink); font-variant-numeric: lining-nums; }
.gp-quizlink { margin: 0; }
.gp-quizlink a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.gp-framing {
  margin: 0; padding: 12px 14px; border-radius: 14px; background: #eef4ee; border: 1px solid var(--line);
  font-size: .9375rem; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere;
}

.gp-actions .btn { flex: 1 1 220px; }
.gp-card .btn, .gp-panel .btn, .gp-dialog .btn, .gp-spaces-card .btn { line-height: 1.25; padding-block: 10px; }
.gp-brief { margin: 0; }

/* ---------- Critères ---------- */
.gp-criteria { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gp-crit { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.gp-mark {
  flex: none; width: 1.6em; text-align: center; font-size: 1.2rem; line-height: 1.4;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", var(--font-body); font-variant-emoji: text;
}
.gp-mark[data-ok="true"] { color: var(--ok); font-weight: 700; }
.gp-mark[data-ok="false"] { color: var(--ink-2); }
.gp-crit-text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.gp-crit-label { line-height: 1.4; }
.gp-crit-detail { color: var(--ink-2); font-size: .875rem; }
.gp-sub { font-size: 1.35rem; margin: 8px 0 0; }

.gp-facts { margin: 0; display: grid; }
.gp-fact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.gp-fact dt { color: var(--ink-2); font-size: .9375rem; }
.gp-fact dd { margin: 0; }

/* ---------- Page de candidature ---------- */
.gp-page { max-width: 760px; min-width: 0; }
.gp-stack { display: grid; gap: 16px; }
.gp-stack > .card + .card { margin-top: 0; }
.gp-card { min-width: 0; }
.gp-three { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.gp-crit-big { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.gp-crit-big > div { min-width: 0; overflow-wrap: anywhere; }
.gp-crit-big h3 { font-size: 1.4rem; margin-bottom: 4px; }
.gp-crit-big p { color: var(--ink-2); }
.gp-crit-big p + p { margin-top: 6px; }
.gp-crit-big .gp-mark { font-size: 1.5rem; width: 1.5em; }

/* Frise des statuts : en colonne sur téléphone, en ligne dès que la place le permet. */
.gp-timeline { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; }
.gp-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; align-items: start; padding-bottom: 18px; }
.gp-step:last-child { padding-bottom: 0; }
.gp-step::after { content: ""; position: absolute; inset-inline-start: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--line-2); }
.gp-step:last-child::after { display: none; }
.gp-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .9375rem; border: 2px solid var(--line-2); background: #fff; color: var(--ink-2);
}
.gp-step-text { display: grid; gap: 2px; padding-top: 5px; min-width: 0; overflow-wrap: anywhere; }
.gp-step-text b { font-weight: 600; color: var(--ink-2); }
.gp-step-text small { color: var(--ink-2); font-size: .875rem; }
.gp-step[data-state="done"] .gp-dot { background: var(--forest); border-color: var(--forest); color: var(--gold-soft); }
.gp-step[data-state="done"]::after { background: var(--forest); }
.gp-step[data-state="done"] b, .gp-step[data-state="current"] b { color: var(--ink); }
.gp-step[data-state="current"] .gp-dot { border-color: var(--gold); background: #fbf1d4; color: var(--forest); box-shadow: 0 0 0 4px rgba(231, 178, 74, .3); }
.gp-step[data-state="current"] b { font-weight: 700; }
.gp-step[data-state="refused"] .gp-dot { border-color: var(--err); background: #fdecea; color: var(--err); }
.gp-step[data-state="refused"] b { color: var(--err); }
@media (min-width: 720px) {
  .gp-timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .gp-step { grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding-bottom: 0; justify-items: start; }
  .gp-step::after { inset-inline-start: 42px; inset-inline-end: -10px; top: 16px; bottom: auto; width: auto; height: 2px; }
  .gp-step-text { padding-top: 0; }
}

.gp-decision { margin: 0 0 14px; overflow-wrap: anywhere; }
.gp-retry { margin: 0 0 14px; font-weight: 600; }
.gp-withdraw { margin-bottom: 18px; }

/* ---------- Formulaire ---------- */
.gp-form .gp-all { border: 0; margin: 0; padding: 0; min-width: 0; }
.gp-form .form-row > * { min-width: 0; }
.gp-intro { margin: 0 0 22px; }
.gp-fs { margin-bottom: 30px; }
.gp-fs > .small { margin-top: 0; }
.gp-group { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.gp-group legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .96875rem; }
.gp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; max-width: 100%; padding: 6px 16px 6px 12px;
  border: 1.5px solid var(--line-2); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 500; line-height: 1.3;
}
.gp-chip input { margin: 0; }
.gp-chip span { min-width: 0; overflow-wrap: anywhere; }
.gp-chip:has(input:checked) { background: #eef4ee; border-color: var(--forest); }
.gp-form .check { padding-block: 9px; min-height: 44px; margin-bottom: 6px; }
.gp-form .check input { margin-top: 2px; }
.gp-short input { max-width: 180px; }
.gp-count { display: block; margin-top: 6px; font-size: .875rem; color: var(--ink-2); }
.gp-count[data-ok="true"] { color: var(--ok); }
.gp-ref { border: 1px solid var(--line); border-radius: 16px; background: #fbfdfb; padding: 14px 16px 6px; margin: 0 0 14px; min-width: 0; }
.gp-ref legend { padding: 0 6px; font-weight: 700; }
.gp-ref .link-btn { margin: 0 0 8px; }
.gp-consent-note { margin: 4px 0 14px; }
.gp-rules { margin-bottom: 14px; }

.gp-form .check + .gp-field-error { margin: -2px 0 16px; }
.gp-field-error { display: block; margin-top: 6px; color: var(--err); font-weight: 600; font-size: .9375rem; }
.gp-form input[aria-invalid="true"], .gp-form textarea[aria-invalid="true"], .gp-form select[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px rgba(179, 38, 30, .15); }

.gp-formbar { display: grid; gap: 12px; margin-top: 8px; }
.gp-formbar .status { margin-top: 0; }
.gp-formbar .cta-row .btn { flex: 1 1 220px; }
.gp-help { padding: 14px 16px; border-radius: 14px; background: #fbf3de; border: 1px solid #ecd9a3; color: #4a3608; overflow-wrap: anywhere; }
.gp-help:empty { display: none; }
.gp-help p { margin: 0; }
.gp-help ul { margin: 6px 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.gp-help .btn { margin-top: 8px; }
.gp-help-title { font-weight: 700; }
.gp-errors { padding: 14px 16px; border-radius: 14px; background: #fdecea; border: 1px solid #f3c1bc; color: #7a1c14; overflow-wrap: anywhere; }
.gp-errors[hidden] { display: none; }
.gp-errors p, .gp-errors-title { margin: 0; font-weight: 700; }
.gp-errors ul { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; }

/* ---------- Deux espaces d'accompagnement (Spiritime) ---------- */
.gp-spaces-block { margin-top: 36px; }
.gp-spaces-block > h3 { margin-bottom: 18px; }
.gp-spaces { display: grid; gap: 16px; }
@media (min-width: 880px) { .gp-spaces { grid-template-columns: 1fr 1fr; } }
.gp-space { display: grid; gap: 12px; align-content: start; }
.gp-space + .gp-space { margin-top: 0; }
.gp-space h4 { margin: 0; font: 600 1.55rem/1.15 var(--font-display); }
.gp-space p { margin: 0; }
.gp-space .checks { margin: 2px 0; }
.gp-principle { margin-top: 16px; }

/* ---------- Bloc « Mes espaces » de l'espace Guide ---------- */
.gp-space-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.gp-space-item { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfb; }
.gp-space-item span { color: var(--ink-2); font-size: .9375rem; }
.gp-spaces-card .btn { min-height: 44px; }
.gp-spaces-card .ws-actions-row .btn { flex: 1 1 220px; }

/* ---------- Fenêtre de confirmation ---------- */
.gp-modal { overflow-y: auto; }
.gp-dialog { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.gp-dialog .cta-row .btn { flex: 1 1 200px; }

@media (prefers-reduced-motion: reduce) { .gp-fill { transition: none; } }

/* ---------- Page « Je suis pasteur ou guide » : la porte vers le parcours Spiritime ---------- */
.gp-guides-note a { display: inline-block; padding-block: 10px; font-weight: 600; }
