/* ============================================================================
 * Auth modal (login / register / OAuth).
 * Desktop / tablette : modal centre, max-width 460-500px.
 * Mobile (<=768px)   : carte centree (meme logique que desktop), max-height
 *                      limitee au viewport pour scroll interne si besoin.
 * ============================================================================ */

.zic-auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--pp-scrim, rgba(11, 11, 20, 0.72));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
  animation: zauthFadeIn 0.2s ease-out;
}

.zic-auth-overlay.is-open {
  display: flex;
}

/* L'ancien gate `.zic-auth-overlay { display: none }` a ete retire : la modal
   est dorenavant utilisable sur mobile (cf. plan landing mobile responsive).
   Les regles plein-ecran mobile vivent dans le bloc @media en bas du fichier. */

@keyframes zauthFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes zauthSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.zic-auth-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--pp-card, #ffffff);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 30px 80px var(--pp-shadow, rgba(0, 0, 0, 0.45)), 0 10px 30px rgba(109, 40, 217, 0.18);
  animation: zauthSlideUp 0.28s cubic-bezier(.2,.9,.3,1.2);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--pp-text, #1A0A3D);
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  .zic-auth-card { max-width: 500px; padding: 32px; }
}

.zic-auth-card *, .zic-auth-card *::before, .zic-auth-card *::after { box-sizing: border-box; }

.zic-auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.zic-auth-tabs {
  display: inline-flex;
  background: var(--pp-card-light, #F7F8FC);
  border: 1px solid var(--pp-border, #E0E5F0);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.zic-auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pp-text-muted, #8E95A9);
  font-family: inherit;
  transition: background 0.18s ease, color 0.18s ease;
}

.zic-auth-tab.is-active {
  background: #6D28D9;
  color: #fff;
}

.zic-auth-close {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pp-text, #2D3142);
  transition: background 0.15s ease;
}

.zic-auth-close:hover { background: var(--pp-overlay, #F2F0F8); }

.zic-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.zic-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zic-auth-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pp-text-muted, #5A6178);
  letter-spacing: 0.02em;
}

.zic-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--pp-card-light, #F7F8FC);
  border: 1.5px solid var(--pp-border, #E0E5F0);
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.zic-auth-input-wrap:focus-within {
  border-color: #6D28D9;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.zic-auth-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--pp-text, #1A0A3D);
  font-family: inherit;
  min-width: 0;
}

.zic-auth-suffix {
  padding-right: 14px;
  font-size: 14px;
  color: var(--pp-text-muted, #8E95A9);
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
}

.zic-auth-toggle {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  color: var(--pp-text-muted, #8E95A9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zic-auth-toggle:hover { color: var(--pp-link, #6D28D9); }

.zic-auth-error {
  min-height: 18px;
  font-size: 12.5px;
  color: #DC2626;
  margin-top: -4px;
}

/* Password strength meter */
.zic-pw-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.zic-pw-bar {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--pp-border, #E0E5F0);
  overflow: hidden;
}

.zic-pw-bar-fill {
  height: 100%;
  width: 0%;
  background: #DC2626;
  transition: width 0.2s ease, background 0.2s ease;
}

.zic-pw-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--pp-text-muted, #8E95A9);
  min-width: 64px;
  text-align: right;
}

.zic-pw-rules {
  background: var(--pp-card-light, #F7F8FC);
  border: 1px solid var(--pp-border, #E0E5F0);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zic-pw-rules-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--pp-text-muted, #5A6178);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.zic-pw-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--pp-text-muted, #8E95A9);
  transition: color 0.18s ease;
}

.zic-pw-rule .zic-pw-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--pp-border-strong, #BFC4D1);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.zic-pw-rule .zic-pw-check svg { grid-area: 1 / 1; opacity: 0; }

.zic-pw-rule.is-valid {
  color: #16A34A;
  text-decoration: line-through;
}

.zic-pw-rule.is-valid .zic-pw-check {
  background: #16A34A;
  border-color: #16A34A;
}

.zic-pw-rule.is-valid .zic-pw-check .zic-pw-icon--check { opacity: 1; }

.zic-pw-rule.is-invalid {
  color: #DC2626;
}

.zic-pw-rule.is-invalid .zic-pw-check {
  background: #DC2626;
  border-color: #DC2626;
}

.zic-pw-rule.is-invalid .zic-pw-check .zic-pw-icon--cross { opacity: 1; }

/* Terms checkbox */
.zic-auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--pp-text-muted, #5A6178);
  line-height: 1.45;
}

.zic-auth-terms input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--pp-border-strong, #BFC4D1);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  margin-top: 1px;
  background: var(--pp-card, #fff);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.zic-auth-terms input[type="checkbox"]:checked {
  background: #6D28D9;
  border-color: #6D28D9;
}

.zic-auth-terms input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px; left: 6px;
  width: 4px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.zic-auth-terms a { color: var(--pp-link, #6D28D9); font-weight: 600; text-decoration: underline; }

/* Submit button */
.zic-auth-submit {
  appearance: none;
  border: none;
  background: #6D28D9;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.18s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
}

.zic-auth-submit:hover:not(:disabled) { background: #5B21B6; }
.zic-auth-submit:active:not(:disabled) { transform: translateY(1px); }

.zic-auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.zic-auth-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: zauthSpin 0.8s linear infinite;
}

@keyframes zauthSpin { to { transform: rotate(360deg); } }

/* Divider */
.zic-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
}

.zic-auth-divider::before,
.zic-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pp-border, #E0E5F0);
}

.zic-auth-divider span {
  font-size: 12.5px;
  color: var(--pp-text-muted, #8E95A9);
}

/* OAuth grid */
.zic-oauth-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 1025px) {
  .zic-oauth-grid { grid-template-columns: repeat(6, 1fr); }
}

.zic-oauth-btn {
  appearance: none;
  border: 1px solid var(--pp-border, #E0E5F0);
  background: var(--pp-card-light, #F7F8FC);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.zic-oauth-btn:hover:not(:disabled) {
  background: var(--pp-card, #fff);
  border-color: #6D28D9;
  transform: translateY(-1px);
}

.zic-oauth-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.zic-oauth-btn img { width: 26px; height: 26px; display: block; }

/* OAuth-in-progress overlay over the modal */
.zic-auth-busy {
  position: absolute;
  inset: 0;
  background: var(--pp-card, rgba(255, 255, 255, 0.94));
  border-radius: inherit;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  z-index: 2;
}

.zic-auth-busy.is-open { display: flex; }

.zic-auth-busy-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 320px;
}

.zic-auth-busy-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(109, 40, 217, 0.18);
  border-top-color: #6D28D9;
  animation: zauthSpin 0.85s linear infinite;
}

.zic-auth-busy-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--pp-text, #2D3142);
}

.zic-auth-busy-hint {
  font-size: 13px;
  color: var(--pp-text-muted, #8E95A9);
  line-height: 1.45;
}

.zic-auth-busy-cancel {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--pp-link, #6D28D9);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
}

/* Voile translucide (et non #F5F0FF) : lisible sous l'accent clair du thème sombre. */
.zic-auth-busy-cancel:hover { background: rgba(109, 40, 217, 0.08); }

/* Top alert (errors / success) */
.zic-auth-alert {
  display: none;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.zic-auth-alert.is-error {
  display: block;
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.zic-auth-alert.is-success {
  display: block;
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

/* ============================================================================
   Mot de passe oublié — sous-vue de la carte (maquette ForgotFlow).
   La carte porte `is-forgot` : la vue connexion / inscription est masquée et
   `.zic-fg` prend sa place. Couleurs via --pp-* (thème sombre des profils
   créateurs) avec replis clairs. Accent : #6D28D9 pour les FONDS sous texte
   blanc ; textes / bordures / icônes via --pp-link (#A78BFA sur la carte
   sombre des profils, #6D28D9 ailleurs — contraste AA).
   ============================================================================ */

.zic-auth-card.is-forgot > .zic-auth-header,
.zic-auth-card.is-forgot > #zauth-title,
.zic-auth-card.is-forgot > [data-zauth-subtitle],
.zic-auth-card.is-forgot > #zauth-alert,
.zic-auth-card.is-forgot > #zauth-form,
.zic-auth-card.is-forgot > .zic-auth-divider,
.zic-auth-card.is-forgot > .zic-oauth-grid {
  display: none;
}

.zic-fg[hidden],
.zic-fg [hidden] {
  display: none !important;
}

/* Lien « Mot de passe oublié ? » sous le champ mot de passe (connexion). */
.zic-auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -14px;
}

.zic-auth-forgot-link {
  appearance: none;
  border: none;
  background: none;
  padding: 2px 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--pp-link, #6D28D9);
}

.zic-auth-forgot-link:hover { text-decoration: underline; }

.zic-fg-step { animation: zauthFadeIn 0.18s ease-out; }

/* En-tête : retour · progression 4 segments · fermer */
.zic-fg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.zic-fg-back {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--pp-text-muted, #6B5FA8);
}

.zic-fg-back:hover:not(:disabled) { color: var(--pp-link, #6D28D9); }
.zic-fg-back:disabled { cursor: default; opacity: 0.6; }

.zic-fg-progress {
  display: flex;
  gap: 4px;
}

.zic-fg-seg {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--pp-border, #E9E4F5);
  transition: background 0.2s ease;
}

.zic-fg-seg.is-on { background: #6D28D9; }

/* Titres et textes d'étape */
.zic-fg-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--pp-text, #1A0A3D);
  outline: none;
}

.zic-fg-desc {
  margin: 6px 0 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--pp-text-muted, #6B5FA8);
}

.zic-fg-desc b { color: var(--pp-text, #1A0A3D); word-break: break-word; }

/* Cartes de choix (email / réseau social) */
.zic-fg-option {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  margin-bottom: 10px;
  border-radius: 14px;
  border: 1.5px solid var(--pp-border, #E9E4F5);
  background: var(--pp-card, #fff);
  color: var(--pp-text, #1A0A3D);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.zic-fg-option:hover,
.zic-fg-option:focus-visible { border-color: var(--pp-link, #6D28D9); outline: none; }

.zic-fg-option-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(109, 40, 217, 0.12);
  color: var(--pp-link, #6D28D9);
}

.zic-fg-option-text { flex: 1; min-width: 0; }

.zic-fg-option-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--pp-text, #1A0A3D);
}

.zic-fg-option-desc {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--pp-text-muted, #6B5FA8);
}

.zic-fg-option-chev { flex-shrink: 0; color: var(--pp-text-muted, #6B5FA8); }

/* Icônes d'état (envoyé / avertissement / terminé) */
.zic-fg-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(109, 40, 217, 0.12);
  color: var(--pp-link, #6D28D9);
}

.zic-fg-ico.is-warn {
  background: rgba(220, 38, 38, 0.12);
  color: #DC2626;
}

.zic-fg-done {
  text-align: center;
  padding: 10px 0 4px;
}

.zic-fg-done-ico {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16A34A;
  color: #fff;
}

.zic-fg-done .zic-fg-title { font-size: 20px; }
.zic-fg-done .zic-fg-desc { margin-bottom: 6px; }
.zic-fg-done .zic-auth-submit { width: 100%; margin-top: 14px; }

/* Boutons d'étape */
.zic-fg-primary { width: 100%; }

.zic-fg-secondary {
  appearance: none;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--pp-link, #6D28D9);
  background: transparent;
  color: var(--pp-link, #6D28D9);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.zic-fg-secondary:hover { background: rgba(109, 40, 217, 0.08); }

.zic-fg-links {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--pp-text-muted, #6B5FA8);
}

.zic-fg-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--pp-link, #6D28D9);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.zic-fg-link:disabled { opacity: 0.6; cursor: default; }
.zic-fg-link-spinner { width: 12px; height: 12px; border-color: rgba(109, 40, 217, 0.3); border-top-color: var(--pp-link, #6D28D9); }
.zic-fg-dot { margin: 0 6px; }

/* Grille des réseaux (2 colonnes) */
.zic-fg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.zic-fg-net {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--pp-border, #E9E4F5);
  background: var(--pp-card, #fff);
  color: var(--pp-text, #1A0A3D);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease;
}

.zic-fg-net:hover:not(:disabled),
.zic-fg-net:focus-visible { border-color: var(--pp-link, #6D28D9); outline: none; }
.zic-fg-net:disabled { opacity: 0.45; cursor: not-allowed; }
.zic-fg-net img { width: 20px; height: 20px; flex-shrink: 0; display: block; }

/* Recherche du compte */
.zic-fg-searching {
  text-align: center;
  padding: 26px 0 18px;
}

.zic-fg-net-ico {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pp-card-light, #F5F0FF);
}

.zic-fg-searching .zic-fg-title { font-size: 18px; }
.zic-fg-searching .zic-fg-desc { margin-bottom: 0; }

.zic-fg-spinner {
  width: 26px;
  height: 26px;
  margin: 18px auto 0;
  border-radius: 50%;
  border: 3px solid var(--pp-border, #E9E4F5);
  border-top-color: var(--pp-link, #6D28D9);
  animation: zauthSpin 0.8s linear infinite;
}

/* Bandeau vert « Compte retrouvé » */
.zic-fg-found {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(22, 163, 74, 0.10);
  border: 1px solid rgba(22, 163, 74, 0.35);
}

.zic-fg-found-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #7B3FF2, #EC4899);
}

.zic-fg-found-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.zic-fg-found-text { flex: 1; min-width: 0; }

.zic-fg-found-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #16A34A;
}

.zic-fg-found-handle {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--pp-text, #1A0A3D);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zic-fg-found-net { flex-shrink: 0; display: block; }

/* Formulaires (email, Bluesky, nouveau mot de passe) */
.zic-fg-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zic-fg-form .zic-auth-error { margin-top: -6px; }
.zic-fg-form .zic-auth-submit { margin-top: 0; }

.zic-fg-help {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--pp-text-muted, #6B5FA8);
}

.zic-fg-help a { color: var(--pp-link, #6D28D9); font-weight: 700; }

.zic-fg-loading {
  margin: -8px 0 14px;
  font-size: 13px;
  color: var(--pp-text-muted, #6B5FA8);
}

/* Session différente ouverte dans ce navigateur */
.zic-fg-switch {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.zic-fg-switch-text {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--pp-text, #1A0A3D);
}

.zic-fg-switch-text b { word-break: break-word; }

/* Pastilles des 5 règles : reveal scoppé par icône (jamais un svg générique) */
.zic-pw-rule.is-valid .zic-pw-check .zic-fg-icon--ok { opacity: 1; }
.zic-pw-rule.is-invalid .zic-pw-check .zic-fg-icon--ko { opacity: 1; }

/* Visuellement masqué (label du champ email, pseudo pour le gestionnaire de
   mots de passe). */
.zic-fg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Nav user menu (when logged in) */
.zic-user-menu {
  position: relative;
}

.zic-user-menu-trigger {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #6D28D9;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.25);
}

.zic-user-menu-trigger img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

.zic-user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--pp-menu-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 16px 40px var(--pp-shadow-soft, rgba(0,0,0,0.25));
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 130;
}

.zic-user-menu.is-open .zic-user-menu-panel { display: flex; }

.zic-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--pp-text, #1A0A3D);
  font-size: 13.5px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.zic-user-menu-item:hover { background: #F5F0FF; color: #6D28D9; }

.zic-user-menu-header {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--pp-border, #F2F0F8);
  margin-bottom: 4px;
}

.zic-user-menu-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pp-text, #2D3142);
}

.zic-user-menu-handle {
  font-size: 12px;
  color: var(--pp-text-muted, #8E95A9);
  margin-top: 2px;
}

/* ============================================================================
   Auth modal — Mobile (<=768px) : carte centree (pas plein ecran), avec
   marges safe-area et hauteur max pour scroll interne si inscription longue.
   ============================================================================ */

@media (max-width: 768px) {
  .zic-auth-overlay {
    padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
    align-items: center;
    justify-content: center;
  }

  .zic-auth-card {
    width: 100%;
    max-width: min(460px, calc(100vw - 32px));
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    height: auto;
    border-radius: 20px;
    padding: 22px 20px 20px;
    box-shadow: 0 30px 80px var(--pp-shadow, rgba(0, 0, 0, 0.45)), 0 10px 30px rgba(109, 40, 217, 0.18);
    animation: zauthSlideUp 0.28s cubic-bezier(.2, 0.9, 0.3, 1.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .zic-auth-header {
    position: relative;
    top: auto;
    margin: 0 0 20px;
    padding: 0;
    background: transparent;
    border-bottom: none;
  }

  .zic-auth-tabs {
    flex: 1;
    justify-content: center;
  }
  .zic-auth-tab {
    flex: 1;
    text-align: center;
    min-height: 44px;
  }
  .zic-auth-close {
    width: 44px;
    height: 44px;
  }

  .zic-auth-form {
    gap: 14px;
  }

  .zic-auth-input {
    /* iOS evite le zoom auto sur focus si font-size >= 16px sur l'input. */
    font-size: 16px;
    padding: 14px;
    min-height: 48px;
  }

  .zic-auth-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
  }

  .zic-oauth-grid {
    gap: 8px;
  }
  .zic-oauth-btn {
    padding: 14px;
    min-height: 56px;
  }

  .zic-pw-rules {
    padding: 10px 12px;
  }

  .zic-auth-busy {
    border-radius: inherit;
  }

  /* Mot de passe oublié : cibles tactiles 44-64 px (inputs 16 px ci-dessus). */
  .zic-fg-back,
  .zic-fg-head .zic-auth-close {
    min-height: 44px;
  }
  .zic-fg-title {
    font-size: 19px;
  }
  .zic-fg-option {
    min-height: 64px;
    padding: 14px;
  }
  .zic-fg-net {
    min-height: 48px;
  }
  .zic-fg-secondary {
    min-height: 52px;
  }
  .zic-fg-link {
    min-height: 44px;
  }
  /* Lien « Mot de passe oublié ? » : cible 44 px ; les marges négatives
     absorbent les 12 px gagnés (espacement erreur ↔ bouton inchangé). */
  .zic-auth-forgot-row {
    margin-top: -20px;
    margin-bottom: -6px;
  }
  .zic-auth-forgot-link {
    min-height: 44px;
    padding: 0 4px;
  }
}

@media (max-width: 360px) {
  .zic-fg-grid {
    grid-template-columns: 1fr;
  }
  .zic-fg-option-ico {
    width: 36px;
    height: 36px;
  }
}
