/* ==========================================================================
   Faevent — pages du compte : connexion, inscription, mot de passe, messages, affiliation, double authentification
   (refonte UI, lot 1). Pages rendues sans interactivité (Identity) : les réactions à la saisie viennent de
   wwwroot/js/faevent-compte.js. Tout est sous .fe-compte (layouts AccountLayout et AuthMarqueLayout).
   Sections : 1. Tokens et base · 2. Layout carte · 3. Layout marque · 4. Textes · 5. Champs · 6. Boutons et liens ·
   7. Alertes · 8. Messages · 9. Affiliation · 10. Mobile
   ========================================================================== */

/* ---------- 1. Tokens et base ---------- */
.fe-compte {
  --brand: #83000e; --brand-hover: #6a000b; --brand-text: #83000e; --brand-tint: #fbeaec;
  --accent: #f49616; --accent-text: #a35c00; --accent-tint: #fef3e2;
  --ink: #0b0b0d; --ink-subtle: #5b616e; --ink-muted: #6b7280;
  --surface: #ffffff; --surface-alt: #f5f5f7; --night: #0b0b0d;
  --line: #e5e7eb; --line-strong: #8a909c;
  --success: #0f7b4f; --success-tint: #e6f4ee; --error: #b42318; --error-tint: #fdecea;
  --font-display: "Bricolage Grotesque", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  min-height: 100vh; min-height: 100dvh;
  background: var(--surface-alt); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; -webkit-font-smoothing: antialiased;
}
.fe-compte *, .fe-compte *::before, .fe-compte *::after { box-sizing: border-box; }
.fe-compte :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Titre et contenu reçoivent le focus après une navigation (FocusOnNavigate, lien d'évitement) : pas de cadre. */
.fe-compte :is(h1, h2, h3, main):focus,
.fe-compte :is(h1, h2, h3, main):focus-visible { outline: none; }
.fe-compte a { color: var(--brand-text); font-weight: 700; }

/* ---------- 2. Layout carte (AccountLayout) ---------- */
.fe-compte--carte { display: flex; flex-direction: column; align-items: center; padding: 24px 16px 32px; }
.fe-compte__haut { width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.fe-compte__logo img { height: 28px; width: auto; display: block; }
.fe-compte__retour { color: var(--ink-subtle) !important; font-size: 13px; text-decoration: none; }
.fe-compte__retour:hover { color: var(--ink) !important; }
.fe-compte__carte {
  width: 100%; max-width: 480px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
}
.fe-compte__carte-corps { padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.fe-compte__pied { display: flex; gap: 16px; margin-top: 24px; font-size: 13px; font-weight: 600; color: var(--ink-subtle); }
.fe-compte__pied a { color: var(--ink-subtle); font-weight: 600; }

/* ---------- 3. Layout marque (AuthMarqueLayout : connexion, inscription) ---------- */
.fe-compte--marque { display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); background: var(--surface); }
.fe-marque {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100vh; min-height: 100dvh; padding: 48px; background: var(--night); color: #ffffff;
}
.fe-marque__logo img { height: 32px; width: auto; display: block; }
.fe-marque__titre { margin: 0 0 24px; font-family: var(--font-display); font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; max-width: 540px; }
.fe-marque__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.fe-marque__liste li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }
.fe-marque__puce { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(244, 150, 22, .14); color: var(--accent); }
.fe-marque__etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.fe-marque__etapes li { display: flex; gap: 12px; }
.fe-marque__numero { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid #3f3f46; font-weight: 800; }
.fe-marque__etapes li:first-child .fe-marque__numero { background: var(--accent); border-color: var(--accent); color: var(--night); }
.fe-marque__etape-titre { display: block; font-weight: 800; }
.fe-marque__etape-texte { display: block; font-size: 14px; color: #a1a1aa; }
.fe-marque__pied { display: flex; gap: 16px; font-size: 13px; font-weight: 600; color: #a1a1aa; }
.fe-marque__pied a { color: #a1a1aa; font-weight: 600; }

.fe-marque__zone { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 24px 32px; }
.fe-marque__haut { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.fe-marque__haut-logo { display: none; }
.fe-marque__formulaire { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.fe-marque__contenu { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- 4. Textes ---------- */
.fe-compte__entete { display: flex; flex-direction: column; gap: 6px; }
.fe-compte__titre { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1.17; font-weight: 800; letter-spacing: -.01em; }
.fe-compte__sous-titre { margin: 0; font-size: 15px; line-height: 23px; font-weight: 500; color: var(--ink-subtle); }
.fe-compte__sous-titre strong { color: var(--ink); }
.fe-compte__tuile { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-text); }
.fe-compte__note { margin: 0; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-subtle); }
.fe-compte__encart { padding: 12px 14px; border-radius: 12px; background: var(--surface-alt); font-size: 13px; line-height: 20px; font-weight: 600; }

/* ---------- 5. Champs ---------- */
.fe-compte__formulaire { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.fe-champ { display: flex; flex-direction: column; gap: 6px; }
.fe-champ__ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fe-champ__libelle { font-size: 14px; font-weight: 700; }
.fe-champ__libelle a { font-size: 13px; text-decoration: none; }
.fe-champ__saisie {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font: 500 16px var(--font-body); color: var(--ink);
}
.fe-champ__saisie:focus { outline: none; border: 2px solid var(--ink); padding: 0 13px; }
.fe-champ__saisie.invalid { border-color: var(--error); }
.fe-champ__saisie--code { letter-spacing: .4em; font-size: 22px; font-weight: 700; text-align: center; }
.fe-champ__aide { font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.fe-compte .validation-message { font-size: 13px; font-weight: 600; color: var(--error); }

.fe-champ__mdp { position: relative; }
.fe-champ__mdp .fe-champ__saisie { padding-right: 48px; }
.fe-champ__mdp .fe-champ__saisie:focus { padding-right: 47px; }
.fe-champ__oeil {
  position: absolute; top: 4px; right: 4px; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-subtle); cursor: pointer;
  display: grid; place-items: center;
}
.fe-champ__oeil:hover { background: var(--surface-alt); color: var(--ink); }
.fe-champ__oeil .fe-oeil-ferme { display: none; }
.fe-champ__oeil[aria-pressed="true"] .fe-oeil-ouvert { display: none; }
.fe-champ__oeil[aria-pressed="true"] .fe-oeil-ferme { display: block; }

.fe-regles { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; font-size: 13px; font-weight: 600; color: var(--ink-subtle); }
.fe-regles li { display: flex; align-items: center; gap: 6px; }
.fe-regles li::before { content: ""; width: 10px; height: 10px; flex: none; border: 1.5px solid currentColor; border-radius: 50%; }
.fe-regles li.is-ok { color: var(--success); }
.fe-regles li.is-ok::before { width: 12px; height: 7px; border: 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; border-radius: 0; transform: translateY(-2px) rotate(-45deg); }

.fe-case { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; font-weight: 600; cursor: pointer; }
.fe-case input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); flex: none; }

.fe-champs-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---------- 6. Boutons et liens ---------- */
.fe-compte__bouton {
  width: 100%; height: 52px; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--brand); border-radius: 12px; background: var(--brand); color: #ffffff !important;
  font: 700 16px var(--font-body); text-decoration: none; cursor: pointer;
}
.fe-compte__bouton:hover { background: var(--brand-hover); }
.fe-compte__bouton--secondaire { background: var(--surface); color: var(--ink) !important; border-color: var(--line-strong); }
.fe-compte__bouton--secondaire:hover { background: var(--surface-alt); }
.fe-compte__bouton--noir { width: auto; height: 40px; padding: 0 14px; font-size: 14px; background: var(--night); border-color: var(--night); border-radius: 10px; }
.fe-compte__lien-centre { align-self: center; font-size: 14px; text-decoration: none; }
.fe-compte__lien-retour { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; text-decoration: none; }
.fe-compte__liens { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-subtle); }
.fe-compte__liens a { text-decoration: none; }
.fe-compte__changer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin: 0; }
.fe-compte__lien-bouton { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--brand-text); cursor: pointer; }
.fe-compte__lien-bouton:hover { text-decoration: underline; }

/* ---------- 7. Alertes ---------- */
.fe-alerte { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 21px; font-weight: 600; }
.fe-alerte--erreur { background: var(--error-tint); color: var(--error); }
.fe-alerte--succes { background: var(--success-tint); color: var(--success); }
.fe-alerte--info { background: var(--surface-alt); color: var(--ink); }
.fe-alerte a { color: inherit; text-decoration: underline; }
.fe-alerte ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- 8. Messages (MessageCompte) ---------- */
.fe-message { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.fe-message__tuile { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; }
.fe-message__tuile--succes { background: var(--success-tint); color: var(--success); }
.fe-message__tuile--marque { background: var(--brand-tint); color: var(--brand-text); }
.fe-message__tuile--alerte { background: var(--accent-tint); color: var(--accent-text); }
.fe-message__tuile--erreur { background: var(--error-tint); color: var(--error); }
.fe-message__texte { margin: 0; font-size: 15px; line-height: 24px; font-weight: 500; color: var(--ink-subtle); }
.fe-message__astuce { width: 100%; text-align: left; }
.fe-message__actions { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 4px; }

/* ---------- 9. Affiliation ---------- */
.fe-programme { padding: 24px 28px; background: var(--night); color: #ffffff; display: flex; flex-direction: column; gap: 6px; }
.fe-programme__surtitre { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.fe-programme__nom { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.fe-programme__commission { align-self: flex-start; margin-top: 4px; padding: 2px 12px; border-radius: 999px; background: var(--accent); color: var(--night); font-size: 13px; font-weight: 800; }
.fe-lien-copie { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line-strong); border-radius: 12px; }
.fe-lien-copie__texte { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; }
.fe-titre-icone { display: flex; align-items: center; gap: 12px; }
.fe-titre-icone .fe-message__tuile { width: 48px; height: 48px; border-radius: 14px; flex: none; }

/* ---------- 10. Mobile ---------- */
@media (max-width: 959.98px) {
  .fe-compte--marque { display: block; }
  .fe-marque { display: none; }
  .fe-marque__zone { min-height: 100vh; min-height: 100dvh; padding: 16px; }
  .fe-marque__haut { justify-content: space-between; }
  .fe-marque__haut-logo { display: block; }
  .fe-marque__haut-logo img { height: 26px; width: auto; display: block; }
  .fe-marque__formulaire { align-items: flex-start; padding-top: 32px; }
}
@media (max-width: 599.98px) {
  .fe-compte--carte { padding: 16px 12px 24px; }
  .fe-compte__carte-corps { padding: 24px 20px; }
  .fe-compte__titre { font-size: 26px; }
  .fe-champs-deux, .fe-regles { grid-template-columns: minmax(0, 1fr); }
  .fe-programme { padding: 20px; }
}
