/* ============================================================
   Carte du membre — styles du poste member_pwa (/carte/, offline.html)
   Jetons --ide-* uniquement (app.css), tailles en rem, ≥ 18 px, cibles ≥ 48 px.
   ============================================================ */

.ide-member { width: 100%; }

/* Direction C « Comptoir » : le bandeau de l'entreprise devient une pastille arrondie posée sur
   la brume (formes rondes, C8/C9), à la largeur de l'écran membre. Couleurs = --brand-bg/--brand-fg
   (contraste garanti par le poste companies). */
.ide-member > .ide-company-bar {
  max-width: 26.25rem; /* largeur de la carte (.ide-card) */
  margin: var(--ide-space-3) var(--ide-gutter) 0;
  padding: var(--ide-space-2) var(--ide-space-4) var(--ide-space-2) var(--ide-space-2);
  border-radius: var(--ide-radius-pill);
  box-shadow: var(--ide-shadow-sm);
  font-size: var(--ide-fs-comfort); line-height: 1.25;
}
@media (min-width: 28.25rem) {
  .ide-member > .ide-company-bar { margin-inline: auto; }
}
/* Logo dans un rond blanc : lisible sur toute couleur d'entreprise */
.ide-member > .ide-company-bar img {
  flex: none; height: 2.25rem; width: auto; max-width: 6rem;
  padding: .2rem; background: var(--ide-surface); border-radius: var(--ide-radius-pill);
}
.ide-member > .ide-company-bar .ide-company-bar__name { padding-block: var(--ide-space-1); }

/* Textes secondaires (18 px, taille confort des écrans membre) */
.ide-mpwa-muted { margin: 0; color: var(--ide-muted); font-size: var(--ide-fs-comfort); }
.ide-mpwa-muted .ide-icon { vertical-align: -.2em; }
.ide-mpwa-email { margin: 0; font-weight: 700; }
/* L'adresse saisie : jamais de césure ni de coupure au milieu ; elle passe entière à la ligne
   (inline-block) et ne se coupe (sans tiret) que si elle est plus large que l'écran */
.ide-mpwa-email__addr { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }

/* « ou » + bouton Face ID sous le formulaire email */
.ide-mpwa-alt { display: grid; gap: var(--ide-space-2); }
.ide-mpwa-or {
  display: flex; align-items: center; gap: var(--ide-space-3);
  margin: 0; color: var(--ide-muted); font-size: 1rem;
}
.ide-mpwa-or::before, .ide-mpwa-or::after { content: ""; flex: 1 1 0; border-top: 1px solid var(--ide-line); }

/* Bandeau hors ligne (carte affichée depuis le cache) */
.ide-offline-bar {
  display: flex; align-items: flex-start; gap: var(--ide-space-3);
  padding: var(--ide-space-3) var(--ide-gutter);
  max-width: 26.25rem; margin: var(--ide-space-3) var(--ide-gutter) 0;
  background: var(--ide-warn-soft); color: var(--ide-ink);
  border: 1px solid var(--ide-line-strong); border-radius: var(--ide-radius-lg);
  font-size: var(--ide-fs-comfort);
}
@media (min-width: 28.25rem) {
  .ide-offline-bar { margin-inline: auto; }
}
.ide-offline-bar p { margin: 0; }
.ide-offline-bar .ide-icon { flex: 0 0 auto; color: var(--ide-warn); width: 1.5rem; height: 1.5rem; }

/* Onglets (plusieurs cartes, une par entreprise) */
.ide-mpwa-tabs { padding: var(--ide-space-3) var(--ide-gutter) 0; }
.ide-mpwa-tabs ul {
  display: flex; flex-wrap: wrap; gap: var(--ide-space-2);
  max-width: 34rem; margin: 0 auto; padding: 0; list-style: none;
}
.ide-mpwa-tabs li { flex: 1 1 auto; }
.ide-mpwa-tabs a {
  display: flex; align-items: center; justify-content: center; gap: var(--ide-space-2);
  min-height: 3rem; padding: var(--ide-space-2) var(--ide-space-3);
  background: var(--ide-surface); color: var(--ide-ink); text-decoration: none; font-weight: 700;
  border: 2px solid var(--ide-line); border-radius: var(--ide-radius-pill);
  overflow-wrap: anywhere;
}
.ide-mpwa-tabs a:hover { border-color: var(--ide-primary); }
.ide-mpwa-tabs a.is-active { border-color: var(--ide-primary); background: var(--ide-primary-soft); }

/* Carte : écran sans hauteur minimale imposée (les sections suivent) */
.ide-mpwa-card { min-height: 0; }
.ide-mpwa-tip { display: flex; align-items: flex-start; justify-content: center; gap: var(--ide-space-2); margin: var(--ide-space-2) auto 0; font-size: 1rem; color: var(--ide-ink); }
.ide-mpwa-tip[hidden] { display: none; }
.ide-mpwa-tip .ide-icon { flex: 0 0 auto; color: var(--ide-primary); }
.ide-mpwa-wallet { display: grid; gap: var(--ide-space-2); }

/* Sections sous la carte : Face ID, offres, commerces, aide, déconnexion */
.ide-mpwa-sections {
  display: grid; gap: var(--ide-space-5);
  width: 100%; max-width: 34rem; margin: 0 auto;
  padding: var(--ide-space-5) var(--ide-gutter) calc(var(--ide-space-6) + env(safe-area-inset-bottom));
}
.ide-mpwa-section h2 {
  display: flex; align-items: center; gap: var(--ide-space-2);
  margin: 0 0 var(--ide-space-3); font-size: var(--ide-fs-h2);
}
/* Pictogramme de section dans un petit rond abricot doux (accent C3, sapin dessus : décor) */
.ide-mpwa-section h2 .ide-icon {
  flex: none; width: 2.25rem; height: 2.25rem; padding: .45rem;
  color: var(--ide-primary); background: var(--ide-accent-soft); border-radius: 50%;
}
.ide-mpwa-section > p { margin: 0 0 var(--ide-space-2); }
.ide-mpwa-section[hidden] { display: none; }
.ide-offer__desc { margin: var(--ide-space-1) 0 0; font-size: var(--ide-fs-comfort); }

.ide-mpwa-passkey {
  padding: var(--ide-space-4) var(--ide-space-5); background: var(--ide-surface);
  border: 1px solid var(--ide-line); border-radius: var(--ide-radius-xl);
  box-shadow: var(--ide-shadow-sm);
}
.ide-mpwa-passkey { margin-top: var(--ide-space-4); border: 2px solid var(--ide-primary); }
.ide-mpwa-passkey[hidden] { display: none; }
.ide-mpwa-passkey__title { font-weight: 700; font-size: var(--ide-fs-comfort); margin-bottom: var(--ide-space-1); }
.ide-mpwa-passkey .ide-icon { color: var(--ide-primary); vertical-align: -.2em; }
.ide-mpwa-passkey__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ide-space-3); }

.ide-mpwa-shops { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ide-space-3); }
.ide-mpwa-shop {
  padding: var(--ide-space-4); background: var(--ide-surface);
  border: 1px solid var(--ide-line); border-radius: var(--ide-radius-lg);
  box-shadow: var(--ide-shadow-sm);
}
.ide-mpwa-shop p { margin: 0; }
.ide-mpwa-shop__name { font-family: var(--ide-font-display); font-weight: 700; font-size: var(--ide-fs-lg); line-height: var(--ide-lh-tight); overflow-wrap: anywhere; }
.ide-mpwa-shop__addr { color: var(--ide-ink); font-size: var(--ide-fs-comfort); }
.ide-mpwa-shop .ide-mpwa-shop__links { display: flex; flex-wrap: wrap; gap: var(--ide-space-4); margin-top: var(--ide-space-2); }
.ide-mpwa-shop__links a {
  display: inline-flex; align-items: center; gap: var(--ide-space-1);
  min-height: 3rem; color: var(--ide-primary); font-weight: 700;
}
.ide-mpwa-contact { display: inline-flex; align-items: center; min-height: 3rem; font-weight: 700; overflow-wrap: anywhere; }
.ide-mpwa-logout form { margin: 0; }

/* Page hors ligne statique */
.ide-offline__lang { display: grid; gap: var(--ide-space-3); padding-bottom: var(--ide-space-4); border-bottom: 1px solid var(--ide-line); }
.ide-offline__lang:last-child { border-bottom: 0; }
.ide-offline__lang[hidden] { display: none; }
.ide-offline__lang p { margin: 0; }

@media (prefers-contrast: more) {
  .ide-mpwa-tabs a, .ide-mpwa-shop, .ide-mpwa-passkey, .ide-offline-bar { border-width: 2px; border-color: var(--ide-ink); box-shadow: none; }
  .ide-member > .ide-company-bar { box-shadow: none; outline: 2px solid var(--ide-ink); outline-offset: -2px; }
}
@media (forced-colors: active) {
  .ide-mpwa-tabs a.is-active { border-color: Highlight; }
  .ide-offline-bar, .ide-member > .ide-company-bar { border: 2px solid CanvasText; }
}

/* Sans portefeuille : garder la carte sur l'écran d'accueil (consigne par système) */
.ide-mpwa-keep { font-size: var(--ide-fs-comfort); }
.ide-mpwa-keep p { margin: 0 0 var(--ide-space-2); }
.ide-mpwa-keep p:last-child { margin-bottom: 0; }
/* L'adresse de la carte : entière sur sa ligne, coupée (sans tiret) seulement si plus large que l'écran */
.ide-mpwa-keep__addr { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-weight: 600; }

/* Boutons Face ID / empreinte (connexion sous « ou », activation sous la carte) : pictogramme collé
   au texte, le tout centré, même quand le libellé passe sur deux lignes (sinon, en flex, l'icône
   reste seule au bord gauche et le texte flotte au milieu) */
.ide-member .ide-passkey .btn { display: block; width: 100%; text-align: center; }
.ide-member .ide-passkey .btn .ide-icon { display: inline-block; vertical-align: -.2em; margin-inline-end: var(--ide-space-2); }
/* Phrases d'accroche des écrans membre : lignes équilibrées (les autres paragraphes : pretty, app.css) */
.ide-area-member .ide-screen__lead { text-wrap: balance; }
/* Code à 6 chiffres : champ centré (app.css) → libellé et aide centrés avec lui */
.ide-member [data-code-form] .ide-field { text-align: center; }
/* Titres courts qui passent à la ligne : lignes équilibrées, jamais un mot seul (« AG », « main ») */
.ide-member > .ide-company-bar .ide-company-bar__name, .ide-mpwa-tabs a span, .ide-mpwa-keep p:has(> strong:only-child), .ide-mpwa-section h2 { text-wrap: balance; }
/* « Plus tard » centré sous le bouton pleine largeur */
.ide-mpwa-passkey__actions { justify-content: center; }
.ide-mpwa-passkey__actions > .ide-passkey { flex: 1 1 100%; }
/* Contact d'aide en texte (service, n° interne) : passe entier à la ligne, jamais coupé au milieu */
.ide-mpwa-contact__text { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-weight: 700; }

/* Commerces et offres réunis : l'offre en cours s'affiche dans la fiche de son commerce
   (même logique visuelle que l'encadré « Offre à accorder » de l'écran du commerçant). */
.ide-mpwa-shop.has-offer { border-color: var(--ide-valid); }
.ide-mpwa-offers { list-style: none; margin: var(--ide-space-3) 0 0; padding: 0; display: grid; gap: var(--ide-space-2); }
.ide-mpwa-offer {
  display: flex; align-items: flex-start; gap: var(--ide-space-3);
  padding: var(--ide-space-3); background: var(--ide-valid-soft); border-radius: var(--ide-radius-lg);
}
.ide-mpwa-offer__icon { flex: none; width: 2rem; height: 2rem; padding: .375rem; border-radius: 50%; background: var(--ide-surface); color: var(--ide-valid-ink); }
.ide-mpwa-offer > div { min-width: 0; }
.ide-mpwa-shop .ide-mpwa-offer__title { font-family: var(--ide-font-display); font-weight: 700; font-size: var(--ide-fs-lg); line-height: 1.2; color: var(--ide-ink); overflow-wrap: anywhere; }
.ide-mpwa-shop .ide-mpwa-offer__desc { margin-top: var(--ide-space-1); font-size: var(--ide-fs-comfort); }
.ide-mpwa-shop .ide-mpwa-offer__meta { margin-top: var(--ide-space-1); color: var(--ide-muted); font-size: 1rem; }
@media (forced-colors: active) { .ide-mpwa-offer { border: 2px solid CanvasText; } }

/* Photo obligatoire : écran « Ajoutez votre photo » (avant la carte, le QR et le Wallet) */
.ide-mpwa-photo { text-align: center; }
.ide-mpwa-photo__preview {
  display: grid; place-items: center; width: 10rem; aspect-ratio: 1; margin: var(--ide-space-4) auto;
  border-radius: 50%; overflow: hidden; background: var(--ide-brume); border: 4px solid var(--ide-surface); box-shadow: var(--ide-shadow);
}
.ide-mpwa-photo__preview img { width: 100%; height: 100%; object-fit: cover; }
.ide-mpwa-photo__placeholder .ide-icon { width: 4rem; height: 4rem; color: var(--ide-muted); }
.ide-mpwa-photo__tips { list-style: none; margin: 0 auto var(--ide-space-5); padding: 0; display: grid; gap: var(--ide-space-2); max-width: 22rem; text-align: left; }
.ide-mpwa-photo__tips li { display: flex; align-items: center; gap: var(--ide-space-2); }
.ide-mpwa-photo__tips .ide-icon { flex: none; width: 1.75rem; height: 1.75rem; padding: .3rem; border-radius: 50%; background: var(--ide-valid-soft); color: var(--ide-valid-ink); }
.ide-mpwa-photo__form { display: grid; gap: var(--ide-space-3); max-width: 22rem; margin: 0 auto; }
.ide-mpwa-photo__form .ide-bigbtn { width: 100%; justify-content: center; }
/* Sans JS : le champ fichier natif reste visible ; avec JS, le grand bouton (label) le remplace. */
.ide-mpwa-photo__pick { display: none; }
.ide-mpwa-photo__form.is-enhanced .ide-mpwa-photo__pick { display: inline-flex; }
.ide-mpwa-photo__form.is-enhanced .ide-mpwa-photo__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ide-mpwa-photo__form.is-enhanced:has(.ide-mpwa-photo__input:focus-visible) .ide-mpwa-photo__pick { outline: 3px solid var(--ide-focus); outline-offset: 3px; }
.ide-mpwa-photo__note { margin-top: var(--ide-space-4); }

/* Fenêtre « Ajoutez votre carte au portefeuille » (après la photo) */
.ide-wallet-pop { max-width: min(26rem, calc(100vw - 2 * var(--ide-space-4))); padding: var(--ide-space-5); border: 0;
  border-radius: var(--ide-radius-xl); background: var(--ide-surface); color: var(--ide-ink); text-align: center; box-shadow: var(--ide-shadow-lg, 0 1rem 3rem rgba(0,0,0,.25)); }
.ide-wallet-pop::backdrop { background: rgba(0, 0, 0, .55); }
.ide-wallet-pop h2 { font-size: 1.35rem; margin: var(--ide-space-2) 0; }
.ide-wallet-pop .ide-bigbtn { width: 100%; margin-top: var(--ide-space-3); }
.ide-wallet-pop__icon { width: 3rem; height: 3rem; color: var(--ide-primary); }
