/* Espace Apporteurs — styles front, isolés dans .ea-app pour cohabiter avec n'importe quel thème. */
.ea-app {
  --ea-primary: #1c7869;
  --ea-ink: #14213d;
  --ea-muted: #5b6475;
  --ea-line: #e3e7ef;
  --ea-bg: #f5f7fb;
  --ea-card: #ffffff;
  --ea-ok: #0f8a5f;
  --ea-warn: #b26a00;
  --ea-err: #c0392b;
  --ea-radius: 14px;
  max-width: 920px;
  margin: 0 auto;
  color: var(--ea-ink);
  font-size: 16px;
  line-height: 1.5;
  box-sizing: border-box;
}
.ea-app *, .ea-app *::before, .ea-app *::after { box-sizing: border-box; }
.ea-app h2, .ea-app h3, .ea-app p { margin: 0; }
.ea-app a { color: var(--ea-primary); }
.ea-app strong { font-weight: 700; }

.ea-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ea-primary); margin-bottom: 4px !important; }
.ea-title { font-size: clamp(24px, 4vw, 32px); line-height: 1.15; font-weight: 800; color: var(--ea-ink); }
.ea-muted { color: var(--ea-muted); }
.ea-app img.ea-logo { display: block; height: auto; width: auto; max-width: 100%; border: 0; box-shadow: none; border-radius: 0; }
.ea-app img.ea-logo--hero { max-height: 72px; margin-bottom: 18px; }
.ea-app img.ea-logo--top { max-height: 44px; margin-bottom: 10px; }
.ea-center img.ea-logo { margin-left: auto; margin-right: auto; }
.ea-small { font-size: 13px; }
.ea-center { text-align: center; }

.ea-card { background: var(--ea-card); border: 1px solid var(--ea-line); border-radius: var(--ea-radius); padding: 24px; box-shadow: 0 1px 2px rgba(20, 33, 61, .04); }
.ea-card + .ea-card, .ea-list .ea-card + .ea-card { margin-top: 14px; }
.ea-center.ea-card > * + * { margin-top: 12px; }

/* Notices */
.ea-notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; font-size: 15px; }
.ea-notice--ok { background: #e7f6ef; color: var(--ea-ok); }
.ea-notice--err { background: #fdecea; color: var(--ea-err); }

/* Accueil visiteur */
.ea-hero { padding: 8px 0 24px; }
.ea-intro { margin-top: 10px !important; font-size: 17px; color: var(--ea-muted); max-width: 640px; }
.ea-how { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.ea-how li { display: flex; gap: 12px; align-items: flex-start; background: var(--ea-bg); border-radius: 12px; padding: 14px; margin: 0; }
.ea-how__n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ea-primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.ea-how strong { display: block; font-size: 15px; }
.ea-how p { font-size: 14px; color: var(--ea-muted); margin-top: 2px !important; }

.ea-auth { max-width: 620px; }
.ea-switch { display: flex; gap: 4px; background: var(--ea-bg); padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.ea-switch a { flex: 1; text-align: center; padding: 10px 12px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ea-muted); }
.ea-switch a.is-active { background: #fff; color: var(--ea-ink); box-shadow: 0 1px 3px rgba(20, 33, 61, .12); }

/* Formulaires */
.ea-form { display: flex; flex-direction: column; gap: 14px; }
.ea-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ea-form fieldset + fieldset { border-top: 1px solid var(--ea-line); padding-top: 18px; }
.ea-form legend { font-size: 18px; font-weight: 800; padding: 0; margin-bottom: 12px; color: var(--ea-ink); }
.ea-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ea-field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 400; }
.ea-label { font-size: 14px; font-weight: 600; color: var(--ea-ink); }
.ea-label em { color: var(--ea-err); font-style: normal; }
.ea-hint { font-size: 12.5px; color: var(--ea-muted); }
.ea-app input[type=text], .ea-app input[type=email], .ea-app input[type=tel], .ea-app input[type=password], .ea-app input[type=number], .ea-app select, .ea-app textarea {
  width: 100%; max-width: 100%; margin: 0; padding: 11px 13px; font: inherit; font-size: 16px; color: var(--ea-ink);
  background: #fff; border: 1px solid #cfd5e1; border-radius: 10px; box-shadow: none; height: auto; line-height: 1.4;
}
.ea-app input:focus, .ea-app select:focus, .ea-app textarea:focus { outline: none; border-color: var(--ea-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ea-primary) 20%, transparent); }
.ea-app input[readonly] { background: var(--ea-bg); color: var(--ea-muted); }
.ea-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ea-muted); margin: 0; cursor: pointer; }
.ea-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--ea-primary); }
.ea-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.ea-btn, .ea-app button.ea-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border: 0; border-radius: 10px;
  background: var(--ea-primary); color: #fff !important; font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: filter .15s ease, transform .05s ease; line-height: 1.2; text-transform: none; letter-spacing: 0;
}
.ea-btn:hover { filter: brightness(1.08); }
.ea-btn:active { transform: translateY(1px); }
.ea-btn--block { width: 100%; }
.ea-btn--ghost { background: transparent; color: var(--ea-primary) !important; border: 1px solid currentColor; }

/* Choix du type de projet */
.ea-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ea-choice { position: relative; margin: 0; cursor: pointer; }
.ea-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ea-choice__box { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 14px; border: 1.5px solid var(--ea-line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; }
.ea-choice__box strong { font-size: 15px; }
.ea-choice__box small { font-size: 13px; color: var(--ea-muted); line-height: 1.35; }
.ea-choice__prime { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--ea-ok); }
.ea-choice input:checked + .ea-choice__box { border-color: var(--ea-primary); background: color-mix(in srgb, var(--ea-primary) 6%, #fff); box-shadow: 0 0 0 1px var(--ea-primary); }
.ea-choice input:focus-visible + .ea-choice__box { outline: 3px solid color-mix(in srgb, var(--ea-primary) 35%, transparent); outline-offset: 2px; }

/* Espace connecté */
.ea-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.ea-logout { font-size: 14px; color: var(--ea-muted) !important; white-space: nowrap; }
.ea-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.ea-stat { background: var(--ea-bg); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.ea-stat__v { font-size: 22px; font-weight: 800; line-height: 1.2; }
.ea-stat__l { font-size: 13px; color: var(--ea-muted); }
.ea-stat--accent { background: var(--ea-primary); color: #fff; }
.ea-stat--accent .ea-stat__l { color: rgba(255, 255, 255, .85); }

.ea-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ea-line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.ea-tabs a { padding: 10px 14px; text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ea-muted) !important; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ea-tabs a.is-active { color: var(--ea-ink) !important; border-bottom-color: var(--ea-primary); }

/* Suivi des recommandations */
.ea-lead__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ea-lead h3 { font-size: 18px; font-weight: 800; }
.ea-lead .ea-muted { font-size: 14px; }
.ea-badge { flex: none; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--ea-bg); color: var(--ea-muted); }
.ea-badge--nouveau { background: #eef2ff; color: #3949ab; }
.ea-badge--contacte, .ea-badge--etude { background: #fff4e0; color: var(--ea-warn); }
.ea-badge--accord { background: #e6f4ff; color: #0b63a8; }
.ea-badge--signe { background: #e7f6ef; color: var(--ea-ok); }
.ea-badge--perdu { background: #f1f2f5; color: #7a8190; }

.ea-steps { list-style: none; display: flex; margin: 18px 0 4px; padding: 0; counter-reset: step; }
.ea-steps li { flex: 1; position: relative; text-align: center; font-size: 12px; color: var(--ea-muted); margin: 0; padding-top: 22px; }
.ea-steps li::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: #d5dae4; z-index: 1; }
.ea-steps li::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: #d5dae4; }
.ea-steps li:first-child::after { display: none; }
.ea-steps li.is-done::before, .ea-steps li.is-current::before { background: var(--ea-primary); }
.ea-steps li.is-done::after, .ea-steps li.is-current::after { background: var(--ea-primary); }
.ea-steps li.is-current::before { width: 16px; height: 16px; top: 2px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ea-primary) 20%, transparent); }
.ea-steps li.is-current { color: var(--ea-ink); font-weight: 700; }
.ea-lost { margin-top: 14px !important; font-size: 14px; color: var(--ea-muted); background: var(--ea-bg); padding: 10px 12px; border-radius: 10px; }
.ea-lead__prime { margin-top: 14px !important; padding-top: 12px; border-top: 1px dashed var(--ea-line); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ea-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ea-bg); color: var(--ea-muted); }
.ea-pill--validee { background: #e6f4ff; color: #0b63a8; }
.ea-pill--versee { background: #e7f6ef; color: var(--ea-ok); }
.ea-pill--annulee { background: #f1f2f5; color: #9097a5; text-decoration: line-through; }

.ea-empty { text-align: center; }
.ea-empty > * + * { margin-top: 10px !important; }

/* Primes */
.ea-gains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.ea-gains > div { background: var(--ea-bg); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; }
.ea-gains strong { font-size: 22px; font-weight: 800; }
.ea-gains small { font-size: 12.5px; color: var(--ea-muted); }
.ea-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.ea-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0; border: 0; }
.ea-table th, .ea-table td { text-align: left; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--ea-line); background: none; }
.ea-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ea-muted); font-weight: 700; }
.ea-table tr.is-muted td { color: #9aa1ae; }

/* Mobile */
@media (max-width: 720px) {
  .ea-card { padding: 18px 16px; }
  .ea-how { grid-template-columns: 1fr; }
  .ea-grid { grid-template-columns: 1fr; }
  .ea-stats { grid-template-columns: 1fr 1fr; }
  .ea-gains { grid-template-columns: 1fr; }
  .ea-choices { grid-template-columns: 1fr 1fr; }
  .ea-steps li span { display: none; }
  .ea-steps li.is-current span { display: block; position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
  .ea-steps { margin-bottom: 22px; }
  .ea-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-bottom: 0; }
  .ea-tabs a { text-align: center; background: var(--ea-bg); border-radius: 10px; border-bottom: 0; margin: 0; font-size: 14px; padding: 10px 8px; }
  .ea-tabs a.is-active { background: var(--ea-primary); color: #fff !important; }
}
@media (max-width: 420px) {
  .ea-choices { grid-template-columns: 1fr; }
}

/* Bandeau « Installer l'application » : affiché d'office sur téléphone, sans attendre le script */
.ea-install { display: none; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 18px; background: #fff; border: 1px solid var(--ea-line); border-left: 4px solid var(--ea-primary); border-radius: 12px; box-shadow: 0 2px 10px rgba(20, 33, 61, .06); }
@media (max-width: 1024px) and (pointer: coarse), (max-width: 600px) { .ea-install { display: flex; } }
.ea-install.is-on { display: flex; }
.ea-install.is-off { display: none !important; }
.ea-app img.ea-install__icon { flex: none; width: 48px; height: 48px; border-radius: 11px; margin: 0; }
.ea-install__body { flex: 1; min-width: 0; }
.ea-install__body strong { display: block; font-size: 15px; line-height: 1.3; }
.ea-install__txt { display: none; font-size: 13.5px; color: var(--ea-muted); margin-top: 2px !important; line-height: 1.5; }
.ea-install__share { vertical-align: -3px; color: var(--ea-primary); }
.ea-install[data-mode="generic"] .ea-install__txt[data-mode="generic"],
.ea-install[data-mode="prompt"] .ea-install__txt[data-mode="prompt"],
.ea-install[data-mode="ios"] .ea-install__txt[data-mode="ios"],
.ea-install[data-mode="android"] .ea-install__txt[data-mode="android"] { display: block; }
.ea-install__actions { display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex: none; }
.ea-app button.ea-install__go { display: none; padding: 9px 16px; font-size: 14px; }
.ea-install[data-mode="prompt"] button.ea-install__go { display: inline-flex; }
.ea-app button.ea-install__close { background: none !important; border: 0 !important; box-shadow: none !important; padding: 4px !important; font: inherit; font-size: 13px; color: var(--ea-muted) !important; cursor: pointer; text-decoration: underline; }
.ea-install.is-flash { animation: ea-flash 1.2s ease; }
@keyframes ea-flash { 0%, 100% { box-shadow: 0 2px 10px rgba(20, 33, 61, .06); } 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ea-primary) 35%, transparent); } }
@media (max-width: 480px) {
  .ea-install { flex-wrap: wrap; }
  .ea-install__body { flex-basis: calc(100% - 60px); }
  .ea-install__actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}
.ea-top__links { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ea-app a.ea-install-link { font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ea-intro-link { margin-top: 10px !important; }
/* Déjà installée : rien à proposer */
@media (display-mode: standalone) { .ea-install, .ea-install-link, .ea-intro-link { display: none !important; } }
/* Dans l'application installée : un peu plus d'air en haut */
.ea-standalone .ea-app { padding-top: env(safe-area-inset-top); }

/* Bandeau flottant sur la page de présentation */
.ea-app--floating { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 99999; max-width: 560px; margin: 0 auto; }
.ea-app--floating .ea-install { margin: 0; box-shadow: 0 8px 30px rgba(20, 33, 61, .22); }
.ea-app a.ea-install__open { font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; padding: 4px; }
