/* ─── ALISRAEL PRIVATE FINANCE — Espace Client : styles partagés ──────────────
   RESKIN "Apple Finance" (Direction B validée) — Étape 15. Palette et
   typographie remplacées ; TOUS les sélecteurs existants sont conservés à
   l'identique (classes, structure) pour qu'aucun script (portal-dashboard.js,
   portal-documents.js, inline <script> de index.html/documents.html) n'ait
   besoin d'être modifié pour cette passe visuelle — seule l'apparence change.
   La cascade de variables CSS ci-dessous recolore automatiquement la quasi-
   totalité du fichier (toutes les règles qui suivent consomment déjà ces
   tokens). Mobile-first, aucun débordement horizontal possible. ───────────── */

:root {
  --portal-bg:            #F3F3F5;
  --portal-bg-soft:       #FFFFFF;
  --portal-card-bg:       #FFFFFF;
  --portal-navy:          #1C1C1E;      /* ex-navy — sert d'"encre" (texte fort, boutons primaires) */
  --portal-navy-soft:     #2C2E36;
  --portal-gold:          #3659C9;      /* ex-or — accent Apple Finance (bleu), jamais flashy */
  --portal-gold-soft:     #EBEEFB;
  --portal-border:        #E4E4E8;
  --portal-text:          #1C1C1E;
  --portal-text-muted:    #6E6E73;
  /* Erreur réelle (mot de passe invalide, validation de formulaire) — reste
     un vrai rouge, distinct de l'ambre "attention document" ci-dessous :
     deux sémantiques différentes, jamais confondues sous un même token. */
  --portal-error-bg:      #FBEAEA;
  --portal-error-border:  #E7B9B9;
  --portal-error-text:    #C0392B;
  /* "Attention document" (à remplacer / non conforme / action requise) —
     ambre B, jamais confondu avec une erreur de formulaire. */
  --portal-warn-bg:       #FBEEE0;
  --portal-warn-border:   #F0D5B0;
  --portal-warn-text:     #C9752F;
  --portal-success-bg:    #E7F3EC;
  --portal-success-border:#BFE0CC;
  --portal-success-text:  #2E9452;
  --portal-radius:        20px;
  --portal-radius-sm:     12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body.portal-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  overflow-x: hidden;
}

/* ── En-tête — identité de marque minimale, jamais une barre d'outils ── */

.portal-header {
  padding: clamp(0.875rem, 3vw, 1.25rem) clamp(1rem, 5vw, 2rem);
  display: flex;
  justify-content: center;
}

.portal-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.portal-brand-name {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 700;
  color: var(--portal-navy);
  letter-spacing: 0.14em;
  line-height: 1;
}

.portal-brand-sub {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--portal-gold);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  line-height: 1;
}

/* ── Contenu principal — une seule carte centrée, jamais de dashboard ── */

.portal-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem clamp(1rem, 5vw, 2rem) 2.5rem;
}

.portal-card {
  width: 100%;
  max-width: 420px;
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: clamp(1.75rem, 6vw, 2.5rem) clamp(1.5rem, 6vw, 2.25rem);
  box-shadow: 0 20px 60px rgba(10, 22, 40, 0.08);
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--portal-gold), var(--portal-navy));
}

.portal-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 600;
  color: var(--portal-navy);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.portal-subtitle {
  font-size: 0.875rem;
  color: var(--portal-text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.portal-identifiant {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-navy);
  background: var(--portal-gold-soft);
  border-left: 3px solid var(--portal-gold);
  border-radius: var(--portal-radius-sm);
  padding: 0.625rem 0.875rem;
  margin: -0.75rem 0 1.5rem 0;
}

/* ── Champs ── */

.portal-group { margin-bottom: 1.125rem; }

.portal-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.portal-input-wrap { position: relative; }

.portal-input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  background: var(--portal-bg-soft);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  color: var(--portal-navy);
  font-size: 1rem; /* 16px minimum : évite le zoom auto iOS au focus */
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

.portal-input::placeholder { color: #A8B0C2; }

.portal-input:focus {
  border-color: var(--portal-gold);
  background: var(--portal-gold-soft);
}

.portal-input:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 1px; }

.portal-input-wrap.has-toggle .portal-input { padding-right: 3rem; }

.portal-toggle-visibility {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.5rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--portal-text-muted);
  cursor: pointer;
  border-radius: var(--portal-radius-sm);
}

.portal-toggle-visibility:hover { color: var(--portal-navy); }
.portal-toggle-visibility:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 1px; }

/* ── Bouton principal ── */

.portal-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem 1rem;
  min-height: 48px; /* cible tactile confortable sur iPhone */
  background: var(--portal-navy);
  color: #FFFFFF;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.portal-btn:hover:not(:disabled) { background: var(--portal-navy-soft); }
.portal-btn:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 2px; }
.portal-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.portal-link-btn {
  display: inline-block;
  margin-top: 1rem;
  background: none;
  border: none;
  padding: 0.4rem 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--portal-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.portal-link-btn:hover { color: var(--portal-navy); }
.portal-link-btn:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 2px; }

/* ── Messages ── */

.portal-message {
  margin-top: 1.125rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--portal-radius-sm);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.portal-message-error {
  background: var(--portal-error-bg);
  border: 1px solid var(--portal-error-border);
  color: var(--portal-error-text);
}

.portal-message-success {
  background: var(--portal-success-bg);
  border: 1px solid var(--portal-success-border);
  color: var(--portal-success-text);
}

.portal-message-info {
  background: var(--portal-gold-soft);
  border: 1px solid var(--portal-border);
  color: var(--portal-text);
}

.portal-hidden { display: none !important; }

.portal-centered-text { text-align: center; }

/* ── Pied de page ── */

.portal-footer {
  padding: 1.25rem clamp(1rem, 5vw, 2rem);
  text-align: center;
}

.portal-footer-brand {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.portal-footer-legal {
  font-size: 0.6875rem;
  color: #9AA3B8;
}

/* ── Petits écrans — marges resserrées, jamais de débordement ── */

@media (max-width: 380px) {
  .portal-card { padding: 1.5rem 1.25rem; }
}

/* ─── Accueil / Ma demande (portal/index.html) ───────────────────────────────
   Mise en page différente de .portal-main/.portal-card (une seule carte
   centrée) : ici, plusieurs cartes empilées en colonne, largeur fluide,
   jamais un dashboard technique — juste l'accueil + "Ma demande" + un
   aperçu Documents encore inerte (Partie 2). ────────────────────────────── */

.portal-dash-main {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0.25rem clamp(1rem, 5vw, 1.5rem) 5.25rem; /* marge basse : laisse la place à la nav fixe */
  display: flex;
  flex-direction: column;
  gap: 1rem; /* resserré (BÊTA 1.0.1) : moins de "grande colonne" sur mobile */
}

.portal-dash-loading,
.portal-dash-denied {
  text-align: center;
  color: var(--portal-text-muted);
  padding: 3rem 1rem;
}
.portal-dash-denied p { margin-bottom: 1rem; }

/* Retouche : #portal-docs-view-dashboard (greeting / bannière alerte / grille
   4 cartes / activités) empilait ses sections avec 0 marge — elles ne sont
   PAS des enfants directs de .portal-dash-main (qui porte le gap), mais de
   ce conteneur intermédiaire. Mis en colonne avec le même gap que le reste
   du portail, pour que les cartes ne se touchent plus jamais. Aucune autre
   page ne porte cet id — portée strictement locale. */
#portal-docs-view-dashboard { display: flex; flex-direction: column; gap: 1rem; }

.portal-dash-greeting { padding: 0.25rem 0.25rem 0; }
.portal-dash-greeting h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  font-weight: 600;
  color: var(--portal-navy);
  margin-bottom: 0.2rem;
}
.portal-dash-greeting p {
  font-size: 0.8125rem;
  color: var(--portal-text-muted);
  line-height: 1.45;
}

.portal-dash-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 1.125rem clamp(1.1rem, 5vw, 1.5rem);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.04); /* ombre extrêmement légère, pas de bling-bling */
  position: relative;
  overflow: hidden;
}

/* ── Hiérarchie des cartes (BÊTA 1.0.1) — financement > documents > actions
   (fonctionnel) > conseiller (relationnel). Jamais de cartes identiques. ── */

/* Financement = carte principale ; "Votre projet" partage la même classe
   --primary (hiérarchie) mais reste une carte blanche normale — seule
   .portal-fin-card (ci-dessous) devient la carte graphite "hero" B. */
.portal-dash-card--primary {
  padding-top: 1.375rem;
  padding-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(20, 20, 30, 0.05);
}

/* ── "Votre financement" — carte graphite B (reprend fidèlement .card de la
   maquette validée : dégradé sombre, reflet radial, texte clair). ───────── */
.portal-fin-card {
  background: linear-gradient(150deg, #363A44 0%, #1E2026 62%, #15161A 100%);
  border-color: transparent;
  color: #FFFFFF;
}
.portal-fin-card::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%; width: 70%; height: 90%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 68%);
  pointer-events: none;
}
.portal-fin-card .portal-dash-card-title { color: rgba(255,255,255,.58); }
.portal-fin-card .portal-fin-edit-btn { color: rgba(255,255,255,.85); }
.portal-fin-card .portal-dash-row-value,
.portal-fin-card .portal-dash-row-value--unknown { color: #FFFFFF; }
.portal-fin-card .portal-dash-row-label { color: rgba(255,255,255,.58); }
.portal-fin-card .portal-fin-secondary .portal-dash-row + .portal-dash-row { border-left-color: rgba(255,255,255,.18); }
.portal-fin-card .portal-dash-breakdown-bar { background: rgba(255,255,255,.18); }
.portal-fin-card .portal-dash-breakdown-seg--emprunt { background: #FFFFFF; }
.portal-fin-card .portal-dash-breakdown-seg--apport  { background: rgba(255,255,255,.5); }
.portal-fin-card .portal-dash-breakdown-legend { color: rgba(255,255,255,.65); }
.portal-fin-card .portal-dash-breakdown-legend-item--emprunt::before { background: #FFFFFF; }
.portal-fin-card .portal-dash-breakdown-legend-item--apport::before { background: rgba(255,255,255,.5); }
.portal-fin-card .portal-dash-fill-btn { color: rgba(255,255,255,.85); }
.portal-fin-card .portal-fin-accepted { background: rgba(255,255,255,.1); }
.portal-fin-card .portal-fin-accepted-icon { color: rgba(255,255,255,.7); }
.portal-fin-card .portal-fin-accepted-label,
.portal-fin-card .portal-fin-accepted-hint { color: rgba(255,255,255,.6); }
.portal-fin-card .portal-fin-accepted-status { color: #FFFFFF; }
.portal-fin-card .portal-card-icon { filter: brightness(0) invert(1); opacity: .9; }

/* Documents = deuxième importance : traitement neutre, déjà le standard. */
.portal-dash-card--secondary { /* par défaut — aucune surcharge nécessaire */ }

/* Actions = fonctionnel : plus compact, moins de respiration verticale. */
.portal-dash-card--compact { padding-top: 1rem; padding-bottom: 1rem; }

/* Conseiller = relationnel : fond légèrement chaleureux (ivoire), jamais
   blanc pur comme les autres — différencie sans ajouter de contraste dur. */
.portal-dash-card--relationship { background: var(--portal-bg-soft); }

.portal-dash-card-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--portal-gold);
  margin-bottom: 1rem;
}

/* ── "Votre financement" — en-tête de carte + action "Modifier" discrète ── */
.portal-fin-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.portal-fin-card-header .portal-dash-card-title { margin-bottom: 0; }

.portal-fin-edit-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.25rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-gold);
  cursor: pointer;
}
.portal-fin-edit-btn:hover { text-decoration: underline; }
.portal-fin-edit-btn:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 2px; }

.portal-fin-saved-toast {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-success-text);
}

.portal-dash-row { padding: 0.75rem 0; }
.portal-dash-row + .portal-dash-row { border-top: 1px solid var(--portal-border); }

.portal-dash-row-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}

.portal-dash-row-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--portal-navy);
}

.portal-dash-row-value--unknown {
  font-size: 0.9375rem;
  font-weight: 500;
  font-style: italic;
  color: var(--portal-text-muted);
}

/* ── Montant principal (BÊTA 1.0.1) — "hero" ──────────────────────────────
   Le markup place déjà la valeur AVANT le libellé (voir portal/index.html) :
   ici, on inverse seulement l'ORDRE DE LECTURE VISUEL comme le ferait une
   vraie appli bancaire — chiffre d'abord, immense ; libellé ensuite, en
   petite légende discrète. Aucune bordure, aucun aspect "ligne de champ". */
.portal-dash-row--hero {
  padding: 0.125rem 0 1rem;
  border-top: none !important; /* jamais le filet de séparation des lignes de formulaire */
}
.portal-dash-row--hero .portal-dash-row-value,
.portal-dash-row--hero .portal-dash-row-value--unknown {
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}
.portal-dash-row--hero .portal-dash-row-value--unknown { font-size: clamp(1.0625rem, 4vw, 1.1875rem); }
.portal-dash-row--hero .portal-dash-row-label {
  margin-bottom: 0;
  font-weight: 600;
}
/* "+ Renseigner" devient une petite action secondaire discrète, jamais un
   gros bouton de formulaire — déjà un lien texte, ici simplement resserré
   contre le libellé plutôt qu'isolé sous la valeur. */
.portal-dash-row--hero .portal-dash-fill-btn { margin-top: 0.3rem; font-size: 0.75rem; }

/* ── Apport / Prix du bien (BÊTA 1.0.1) — stats secondaires compactes,
   côte à côte, séparées par un filet VERTICAL discret (jamais une ligne
   de formulaire horizontale empilée). ──────────────────────────────────── */
.portal-fin-secondary {
  display: flex;
  gap: 1.25rem;
  padding: 0.625rem 0 0.25rem;
}
.portal-fin-secondary .portal-dash-row {
  flex: 1;
  min-width: 0;
  padding: 0;
  border-top: none !important;
}
.portal-fin-secondary .portal-dash-row + .portal-dash-row {
  border-top: none !important;
  border-left: 1px solid var(--portal-border);
  padding-left: 1.25rem;
}
.portal-dash-row--stat .portal-dash-row-value,
.portal-dash-row--stat .portal-dash-row-value--unknown { font-size: 1rem; }
.portal-dash-row--stat .portal-dash-row-label { font-size: 0.6875rem; margin-bottom: 0.2rem; }
.portal-dash-row--stat .portal-dash-fill-btn { font-size: 0.6875rem; }

/* ── Financement accepté (BÊTA 1.0.1) — zone séparée, jamais une ligne de
   formulaire : fond neutre, icône de statut discrète, aucune bordure
   partagée avec les lignes ci-dessus. ──────────────────────────────────── */
.portal-fin-accepted {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1.125rem;
  padding: 0.75rem 0.875rem;
  background: var(--portal-bg-soft);
  border-radius: var(--portal-radius-sm);
}
.portal-fin-accepted-icon {
  flex-shrink: 0;
  font-size: 0.625rem;
  color: var(--portal-gold);
}
.portal-fin-accepted-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.portal-fin-accepted-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--portal-text-muted);
}
.portal-fin-accepted-status {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-navy);
}

/* ── Visualisation financière — barre de répartition compacte ───────────── */

.portal-dash-breakdown { margin-top: 0.25rem; }

/* Petite barre de répartition premium — jamais un gros donut. */
.portal-dash-breakdown-bar {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--portal-border);
}

.portal-dash-breakdown-seg { height: 100%; transition: width 0.3s ease; }
.portal-dash-breakdown-seg--emprunt { background: var(--portal-navy); }
.portal-dash-breakdown-seg--apport  { background: var(--portal-gold); }

.portal-dash-breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-text-muted);
}

.portal-dash-breakdown-legend-item { display: flex; align-items: center; gap: 0.375rem; }
.portal-dash-breakdown-legend-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.portal-dash-breakdown-legend-item--emprunt::before { background: var(--portal-navy); }
.portal-dash-breakdown-legend-item--apport::before  { background: var(--portal-gold); }

.portal-dash-fill-btn {
  display: inline-block;
  margin-top: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-gold);
  cursor: pointer;
}
.portal-dash-fill-btn:hover { text-decoration: underline; }
.portal-dash-fill-btn:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 2px; }

.portal-dash-inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.625rem;
  flex-wrap: wrap;
}
.portal-dash-inline-form .portal-input { flex: 1 1 140px; margin: 0; }
.portal-dash-inline-unit { font-size: 0.9375rem; font-weight: 600; color: var(--portal-text-muted); }
.portal-dash-inline-actions { display: flex; gap: 0.5rem; width: 100%; margin-top: 0.4rem; }

.portal-dash-btn-sm {
  flex: 1;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--portal-radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
}
.portal-dash-btn-sm--primary { background: var(--portal-navy); color: #fff; }
.portal-dash-btn-sm--primary:hover:not(:disabled) { background: var(--portal-navy-soft); }
.portal-dash-btn-sm--primary:disabled { opacity: 0.55; cursor: not-allowed; }
.portal-dash-btn-sm--ghost { background: #fff; color: var(--portal-text-muted); border-color: var(--portal-border); }
.portal-dash-btn-sm--ghost:hover { border-color: var(--portal-gold); color: var(--portal-navy); }

.portal-dash-inline-error {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--portal-error-text);
}

.portal-dash-card-text {
  font-size: 0.875rem;
  color: var(--portal-text-muted);
  line-height: 1.55;
  margin-bottom: 0.875rem;
}

.portal-dash-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--portal-gold);
  text-decoration: none;
  cursor: pointer;
}
.portal-dash-link-btn:hover { text-decoration: underline; }
/* Emplacement encore inerte (ex. Partie 3 à venir) — pas de lien mort. */
.portal-dash-link-btn[disabled],
.portal-dash-link-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

.portal-dash-signout-wrap { text-align: center; padding: 0.5rem 0 1rem; }
.portal-dash-signout-link {
  background: none;
  border: none;
  padding: 0.4rem;
  font-size: 0.75rem;
  color: var(--portal-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.portal-dash-signout-link:hover { color: var(--portal-navy); }

/* ── Navigation basse — barre d'onglets B (6 sections, mobile uniquement à
   partir de 900px — voir .portal-sidebar ci-dessous pour tablette/desktop). ── */

.portal-dash-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--portal-border);
  padding: 0.55rem clamp(0.5rem, 3vw, 1rem) calc(0.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 20;
}

.portal-dash-nav-item {
  flex: 1;
  text-align: center;
  padding: 0.3rem 0.15rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--portal-text-muted);
  background: none;
  border: none;
  min-height: 44px;
}

.portal-dash-nav-item--active { color: var(--portal-gold); }
.portal-dash-nav-item--active .portal-dash-nav-icon svg { color: var(--portal-gold); }
.portal-dash-nav-item[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* ── Coquille d'application — sidebar (tablette/desktop) + colonne
   contenu. Sur mobile, la sidebar reste masquée : seule la barre d'onglets
   basse (.portal-dash-nav, ci-dessus) sert de navigation. ────────────────── */
.portal-app-shell { flex: 1; display: flex; min-height: 0; width: 100%; }
.portal-app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.portal-sidebar {
  display: none;
  flex: none;
  width: 264px;
  background: var(--portal-card-bg);
  border-right: 1px solid var(--portal-border);
  padding: 1.75rem 1.1rem;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}
.portal-sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 0.6rem 1.5rem;
}
.portal-sidebar-brand .portal-brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--portal-navy);
}
.portal-sidebar-brand .portal-brand-sub {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--portal-text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.portal-sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.portal-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.6rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--portal-text-muted);
  text-decoration: none;
  min-height: 44px;
}
.portal-sidebar-link svg { color: var(--portal-text-muted); flex-shrink: 0; }
.portal-sidebar-link--active { background: var(--portal-gold-soft); color: var(--portal-gold); }
.portal-sidebar-link--active svg { color: var(--portal-gold); }
.portal-sidebar-link-badge {
  margin-left: auto;
  background: var(--portal-warn-text);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 6px;
}
.portal-sidebar-sec {
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--portal-text-muted);
  font-weight: 600;
  margin: 1.1rem 0 0.25rem 0.6rem;
}
.portal-sidebar-foot {
  margin-top: auto;
  padding: 0.6rem;
  font-size: 0.6875rem;
  color: var(--portal-text-muted);
}

@media (min-width: 900px) {
  .portal-header.portal-header--top { display: none; } /* la sidebar porte déjà la marque */
  .portal-sidebar { display: flex; }
  .portal-dash-nav { display: none; }
  .portal-app-main > .portal-dash-main,
  .portal-app-main > .portal-docs-main--wide { padding-bottom: 2.5rem; }
}
.portal-dash-nav-item { text-decoration: none; cursor: pointer; } /* un item peut être <a> ou <button> */

/* ─── Mes documents — compteur "hero" de l'accueil (BÊTA 1.0.1) ──────────────
   Spécifique au dashboard (portal/index.html) — documents.html garde son
   propre .portal-docs-progress-text inchangé ci-dessous. */

.portal-docs-count-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.75rem;
}
.portal-docs-count-value {
  font-size: clamp(1.5rem, 6vw, 1.75rem);
  font-weight: 700;
  color: var(--portal-navy);
  line-height: 1;
}
.portal-docs-count-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--portal-text-muted);
}

/* ─── Mes documents (portal/documents.html) ──────────────────────────────── */

.portal-docs-progress-text {
  font-size: 0.875rem;
  color: var(--portal-text-muted);
  margin: 0.5rem 0 0.625rem;
  line-height: 1.5;
}
.portal-docs-progress-text strong { color: var(--portal-navy); font-weight: 700; }

.portal-docs-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--portal-border);
  overflow: hidden;
}
.portal-docs-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--portal-gold), var(--portal-navy));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.portal-doc-row {
  display: flex;
  gap: 0.625rem;
  padding: 0.625rem 0;
}
.portal-doc-row + .portal-doc-row { border-top: 1px solid var(--portal-border); }

.portal-doc-row-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
  width: 1.25rem;
  text-align: center;
}
.portal-doc-row--received .portal-doc-row-icon { color: var(--portal-success-text); }
.portal-doc-row--missing  .portal-doc-row-icon,
.portal-doc-row--partial  .portal-doc-row-icon { color: var(--portal-text-muted); }
/* Statut conseiller (architecture documentaire v2) — À remplacer/Non
   conforme : même ton que les erreurs du portail, jamais confondu avec
   "manquant" (neutre) ni "reçu" (vert) — c'est une action requise. */
.portal-doc-row--attention .portal-doc-row-icon { color: var(--portal-warn-text); }
.portal-doc-row--attention .portal-doc-row-status { color: var(--portal-warn-text); font-weight: 600; }

.portal-doc-row-body { flex: 1; min-width: 0; }
.portal-doc-row-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--portal-navy);
  line-height: 1.4;
}
.portal-doc-row-status {
  display: block;
  font-size: 0.8125rem;
  color: var(--portal-text-muted);
  margin-top: 0.125rem;
}
.portal-doc-row--received .portal-doc-row-status { color: var(--portal-success-text); }
.portal-doc-row--partial .portal-doc-row-status { color: var(--portal-gold); font-weight: 600; }

/* ─── Transmission des documents (Partie 3A) ──────────────────────────────── */

.portal-doc-item { margin-bottom: 0.25rem; }

.portal-doc-upload { margin: 0.5rem 0 0 1.875rem; }

.portal-doc-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  min-height: 40px;
  background: var(--portal-navy);
  color: #fff;
  border-radius: var(--portal-radius-sm);
  border: 1px dashed transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.portal-doc-upload-label:hover { background: var(--portal-navy-soft); }

.portal-doc-upload--dragover .portal-doc-upload-label {
  border-color: var(--portal-gold);
  background: var(--portal-gold-soft);
  color: var(--portal-navy);
}

.portal-doc-upload--busy .portal-doc-upload-label { opacity: 0.6; cursor: not-allowed; }

.portal-doc-upload-status {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--portal-success-text);
}
.portal-doc-upload-status--error { color: var(--portal-error-text); }

/* ─── Section fichiers (correctif multifichier post-test réel) ────────────
   Remplace l'ancienne zone d'upload unique : liste des fichiers déjà
   transmis (consultation individuelle) + zone d'ajout tant que le plafond
   n'est pas atteint. Affichée pour TOUT requirement, quel que soit son
   statut (y compris Reçu / à composants) — voir portal/documents.html. */

.portal-doc-files-section { margin: 0.5rem 0 0 1.875rem; }

.portal-doc-files-counter {
  margin: 0 0 0.375rem 0;
  font-size: 0.75rem;
  color: var(--portal-text-muted);
}

.portal-doc-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.portal-doc-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4375rem 0.625rem;
  background: var(--portal-bg-soft);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
}

.portal-doc-file-name {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--portal-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-doc-file-view {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--portal-gold);
  color: var(--portal-navy);
  border-radius: var(--portal-radius-sm);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.portal-doc-file-view:hover { background: var(--portal-gold-soft); }
.portal-doc-file-view:disabled { opacity: 0.6; cursor: not-allowed; }

.portal-doc-files-full {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--portal-text-muted);
}

.portal-doc-upload-statuslist { margin-top: 0.375rem; }

.portal-doc-group-items {
  margin: 0.5rem 0 0.25rem 1.875rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--portal-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-doc-subrow { display: flex; flex-direction: column; gap: 0.25rem; }
.portal-doc-subrow-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.portal-doc-subrow-label { font-size: 0.8125rem; font-weight: 700; color: var(--portal-navy); }
.portal-doc-subrow-status { font-size: 0.8125rem; color: var(--portal-text-muted); }
.portal-doc-subrow-status--received { color: var(--portal-success-text); font-weight: 600; }
.portal-doc-subrow-status--attention { color: var(--portal-warn-text); font-weight: 600; }

/* Message du conseiller (architecture documentaire v2) — texte brut,
   structurellement distinct de tout contenu interne (jamais exposé ici). */
.portal-doc-conseiller-message {
  margin: 0.375rem 0 0.5rem 1.875rem;
  padding: 0.5rem 0.75rem;
  background: var(--portal-warn-bg);
  border: 1px solid var(--portal-warn-border);
  border-radius: var(--portal-radius-sm, 6px);
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--portal-warn-text);
}

/* ─── Accueil — aperçu compact "Mes documents" (BÊTA 1) ──────────────────────
   Volontairement différent de la checklist complète de documents.html :
   quelques lignes maximum, aucun groupe, aucun upload — juste un coup d'œil. */

.portal-dash-docs-list { margin: 0.5rem 0 0.25rem; }

/* Pas de filet entre les lignes (BÊTA 1.0.1) — "éviter l'aspect tableau" :
   la respiration verticale seule sépare les lignes, jamais une règle. */
.portal-dash-doc-preview-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}

/* Badge circulaire discret autour de l'icône — davantage "appli bancaire"
   qu'une simple liste à puces. */
.portal-dash-doc-preview-icon-badge {
  flex-shrink: 0;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--portal-success-bg);
}
.portal-dash-doc-preview-row--missing .portal-dash-doc-preview-icon-badge,
.portal-dash-doc-preview-row--partial .portal-dash-doc-preview-icon-badge { background: var(--portal-gold-soft); }

.portal-dash-doc-preview-icon { flex-shrink: 0; font-size: 0.8125rem; line-height: 1; }
.portal-dash-doc-preview-row--received .portal-dash-doc-preview-icon { color: var(--portal-success-text); }
.portal-dash-doc-preview-row--missing  .portal-dash-doc-preview-icon,
.portal-dash-doc-preview-row--partial  .portal-dash-doc-preview-icon { color: var(--portal-gold); }

.portal-dash-doc-preview-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8438rem;
  font-weight: 600;
  color: var(--portal-navy);
  line-height: 1.4;
}

.portal-dash-doc-preview-status {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--portal-text-muted);
}

.portal-dash-docs-more {
  margin: 0.375rem 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-text-muted);
}
/* Deux variantes du même message ("+ X autres documents"), chacune calculée
   pour son propre seuil de troncature (5 en desktop, 3 en mobile) — le choix
   de laquelle afficher est purement CSS, jamais une détection JS du
   viewport. `.portal-hidden` (!important) garde la priorité quand aucun
   reliquat n'existe, quelle que soit la largeur d'écran. */
.portal-dash-docs-more--desktop,
.portal-dash-docs-more--mobile { display: none; }

/* ─── Actions à effectuer (BÊTA 1.0.1) — vraies petites "actions bancaires",
   chacune sa propre mini-carte (fond + coins), jamais une ligne de liste. ── */

.portal-dash-action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--portal-bg-soft);
  border-radius: var(--portal-radius-sm);
  flex-wrap: wrap;
}
.portal-dash-action-row + .portal-dash-action-row { margin-top: 0.625rem; } /* respiration, jamais un filet */

.portal-dash-action-icon { flex-shrink: 0; font-size: 1.0625rem; line-height: 1; }

.portal-dash-action-body {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.portal-dash-action-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--portal-navy);
  line-height: 1.3;
}

.portal-dash-action-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-gold);
}
/* Suivi du financement — différencie Terminé/En cours/À venir (même classe
   partagée que l'ancienne carte "Actions à effectuer", toujours bleue par
   défaut ci-dessus ; ces 3 variantes s'appliquent uniquement sur
   portal/suivi.html). */
.portal-suivi-status--done { color: var(--portal-success-text); }
.portal-suivi-status--current { color: var(--portal-gold); }
.portal-suivi-status--upcoming { color: var(--portal-text-muted); }

.portal-dash-action-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.4rem 0.875rem;
  background: var(--portal-navy);
  color: #fff;
  border-radius: var(--portal-radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.portal-dash-action-btn:hover { background: var(--portal-navy-soft); }

.portal-dash-actions-done {
  padding: 0.75rem 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--portal-success-text);
}

/* ─── Mon conseiller (BÊTA 1.0.1) — avatar/initiales + présentation toujours
   "terminée", même avant configuration complète. ─────────────────────────── */

.portal-dash-advisor-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.125rem;
}

.portal-dash-advisor-avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--portal-navy), var(--portal-navy-soft));
  color: var(--portal-gold);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.portal-dash-advisor-info { min-width: 0; }

.portal-dash-advisor-name {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--portal-navy);
  margin-bottom: 0.1rem;
}

.portal-dash-advisor-firm {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--portal-text-muted);
}

.portal-dash-advisor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/* Boutons conseiller — cible tactile confortable (≥ 44px), jamais trop
   petits au doigt, même sur un écran étroit (320 px). */
.portal-dash-advisor-btn {
  flex: 1 1 auto;
  min-width: 100px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.6rem 0.75rem;
  background: var(--portal-bg-soft);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  color: var(--portal-navy);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.portal-dash-advisor-btn:hover { border-color: var(--portal-gold); background: var(--portal-gold-soft); }

/* ─── Mes informations — nouvelle carte (retour client réel) ──────────────
   Simple liste label/valeur en lecture seule, même langage visuel que les
   autres cartes compactes (actions, conseiller). */
.portal-infos-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.portal-infos-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--portal-border);
}
.portal-infos-row:last-child { border-bottom: none; padding-bottom: 0; }
.portal-infos-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  flex-shrink: 0;
}
.portal-infos-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--portal-navy);
  text-align: right;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 62%;
}
.portal-infos-note {
  margin: 0.875rem 0 0 0;
  font-size: 0.75rem;
  color: var(--portal-text-muted);
}
.portal-infos-note a { color: var(--portal-navy); font-weight: 600; }
.portal-infos-link { margin-top: 0.875rem; font-size: 0.8125rem; }

/* ═══════════════════════════════════════════════════════════════════════
   Redesign "Proposition 1 — Élégant & Moderne" (maquette validée)
   Hero, stepper, rangées 2col/3col, carte projet, bannière "Prochaine
   étape". Réutilise SYSTÉMATIQUEMENT les classes/ids déjà câblés en JS
   (portal/index.html) — aucune logique dupliquée, uniquement de la
   présentation. ═══════════════════════════════════════════════════════════ */

.portal-dash-main--hero { padding-top: 0.5rem; gap: 1.125rem; }

/* Retouche : sur portal/index.html, les sections réelles (hero, stepper,
   rangées 2col/3col, prochaine étape) sont des enfants de #portal-dash-content,
   pas des enfants directs de .portal-dash-main --- le gap ci-dessus ne
   s'appliquait donc jamais entre elles (0px mesuré, cartes qui se touchent).
   Portée strictement locale à cet id, présent uniquement sur index.html. */
#portal-dash-content { display: flex; flex-direction: column; gap: 1.125rem; }

/* ── Hero ──────────────────────────────────────────────────────────────────
   Reskin B (Étape 15) : B n'utilise jamais de grande bannière photo — une
   simple salutation textuelle, pas de carte, pas de dégradé. La carte
   "Votre financement" ci-dessous (.portal-fin-card) devient le véritable
   "hero" visuel de la page (carte graphite), fidèle à la maquette B. ────── */
.portal-hero {
  position: static;
  margin: 0;
  min-height: 0;
  border-radius: 0;
  overflow: visible;
  background: none;
  display: block;
  padding: 0.25rem 0.25rem 0;
}
.portal-hero-content { max-width: 480px; }
.portal-hero-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--portal-navy);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}
.portal-hero-subtitle {
  font-size: 0.875rem;
  color: var(--portal-text-muted);
  line-height: 1.5;
  max-width: 34ch;
}
.portal-hero-accent { display: none; } /* B : jamais de trait décoratif sous un titre */

/* ── Stepper (étapes du dossier) — carte normale, même langage que les
   autres cartes B (fond blanc, ombre douce, coins arrondis 20px). Ne
   chevauche plus rien (il n'y a plus de bannière à chevaucher). ────────── */
.portal-stepper-card {
  background: var(--portal-card-bg);
  border-radius: var(--portal-radius);
  box-shadow: 0 1px 2px rgba(20, 20, 30, 0.05);
  margin: 0;
  padding: 1.125rem 0.75rem;
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  position: relative;
  z-index: 2;
}
/* Tailles mobile-first volontairement compactes : les 5 étapes + 4
   connecteurs doivent tenir sans défilement horizontal dès 320px — voir
   l'agrandissement au-delà de 481px plus bas. */
.portal-stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  width: 3.5rem;
}
.portal-stepper-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--portal-bg-soft);
  color: var(--portal-text-muted);
  border: 2px solid var(--portal-border);
}
.portal-stepper-step--done .portal-stepper-circle {
  background: var(--portal-navy);
  color: #FFFFFF;
  border-color: var(--portal-navy);
}
.portal-stepper-step--current .portal-stepper-circle {
  background: var(--portal-gold);
  color: #FFFFFF;
  border-color: var(--portal-gold);
}
.portal-stepper-label {
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  text-align: center;
  line-height: 1.15;
}
.portal-stepper-step--done .portal-stepper-label,
.portal-stepper-step--current .portal-stepper-label { color: var(--portal-navy); }
.portal-stepper-connector {
  flex: 1 1 auto;
  min-width: 0.375rem;
  height: 2px;
  background: var(--portal-border);
  margin-top: 10px; /* aligné au centre vertical des cercles (22px) */
}
.portal-stepper-connector--done { background: var(--portal-navy); }

/* Tablette/desktop — plus de place : étapes et cercles plus confortables. */
@media (min-width: 481px) {
  .portal-stepper-step { width: 4.75rem; gap: 0.375rem; }
  .portal-stepper-circle { width: 28px; height: 28px; font-size: 0.75rem; }
  .portal-stepper-label { font-size: 0.6875rem; }
  .portal-stepper-connector { min-width: 0.75rem; margin-top: 13px; }
}

/* ── Rangées 2col / 3col — empilées par défaut (mobile), grilles réelles
   au-delà de 900px (voir media query plus bas dans ce fichier). ──────────── */
.portal-dash-row-2col,
.portal-dash-row-3col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ── Icône décorative en tête de carte (purement visuelle). ─────────────── */
.portal-fin-card-header { align-items: center; gap: 0.625rem; }
.portal-fin-card-header .portal-dash-card-title { flex: 1; margin-bottom: 0; }
.portal-card-icon { font-size: 1.0625rem; flex-shrink: 0; }

.portal-fin-accepted-hint {
  display: block;
  width: 100%;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--portal-text-muted);
}

/* ── Votre projet ─────────────────────────────────────────────────────── */
.portal-project-body { margin-bottom: 0.25rem; }
.portal-project-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.8125rem;
}

/* ── Mon conseiller — boutons ronds (redesign) ───────────────────────────
   Remplace les boutons rectangulaires texte+icône par de simples pastilles
   icône, comme la maquette. aria-label/title portent le texte accessible
   (déjà posés en HTML) — jamais une info perdue pour un lecteur d'écran. */
.portal-dash-advisor-btn--round {
  flex: 0 0 auto;
  min-width: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.125rem;
  background: var(--portal-navy);
  color: #FFFFFF;
  border-color: var(--portal-navy);
}
.portal-dash-advisor-btn--round:hover { background: var(--portal-navy-soft); }

/* ── Prochaine étape — grande bannière pleine largeur (remplace l'ancienne
   carte "Actions à effectuer"). ──────────────────────────────────────────── */
.portal-nextstep-card {
  background: linear-gradient(135deg, var(--portal-bg-soft) 0%, var(--portal-gold-soft) 100%);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 1.25rem clamp(1.1rem, 5vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.portal-nextstep-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--portal-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}
.portal-nextstep-body { flex: 1 1 220px; min-width: 0; }
.portal-nextstep-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--portal-navy);
  margin-bottom: 0.25rem;
}
.portal-nextstep-text { font-size: 0.8125rem; color: var(--portal-text-muted); line-height: 1.45; }
.portal-nextstep-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  background: var(--portal-navy);
  color: #FFFFFF;
  border-radius: var(--portal-radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.portal-nextstep-btn:hover { background: var(--portal-navy-soft); }

/* ── Navigation basse — icône au-dessus du texte (SVG, Style A) ──────────── */
.portal-dash-nav-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 2px; color: inherit; }
.portal-dash-nav-icon svg { width: 21px; height: 21px; display: block; }
.portal-dash-nav-item { display: flex; flex-direction: column; align-items: center; }

/* ── Points de repère responsive (320/375/390/430 px, tablette, desktop) ──
   Base mobile-first déjà conforme (clamp(), flex-wrap, aucune largeur
   fixe) ; seuls les ajustements de troncature ci-dessous dépendent d'un
   vrai point de rupture. 480 px sépare proprement les téléphones (y
   compris les plus larges, ~430px) des tablettes/desktop. */
@media (max-width: 480px) {
  .portal-dash-doc-preview-row--extra { display: none; }
  .portal-dash-docs-more--mobile { display: block; }
}
@media (min-width: 481px) {
  .portal-dash-docs-more--desktop { display: block; }
}

/* Très petits téléphones (320 px) — resserre encore un peu les cartes
   principales sans jamais casser la lisibilité des montants. */
@media (max-width: 340px) {
  .portal-dash-card { padding: 1rem; }
  .portal-fin-secondary { gap: 0.875rem; }
}

/* ── Desktop (redesign Proposition 1) — les rangées 2col/3col ci-dessous
   deviennent de vraies grilles ; hero/stepper/prochaine étape restent
   pleine largeur dans les deux cas (empilement naturel, aucun grid-area
   nécessaire). Ne change rien à l'ordre du DOM. Le mobile reste la base
   par défaut ; cette règle n'entre en jeu qu'au-delà de 900 px. ─────────── */
@media (min-width: 900px) {
  .portal-dash-main--hero { max-width: 980px; }
  .portal-dash-row-2col { grid-template-columns: 1fr 1fr; }
  .portal-dash-row-3col { grid-template-columns: 1fr 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Documents (portal/documents.html) — largeur du conteneur, mobile → large
   écran. CAUSE EXACTE DU BUG RÉEL (vérifiée avant toute modification) :
   .portal-dash-main (ci-dessus, ~ligne 294) plafonne TOUJOURS à 480px ;
   seul .portal-dash-main--hero reçoit un palier desktop (980px, règle
   ci-dessus), et UNIQUEMENT pour portal/index.html (le seul gabarit avec
   un hero image). documents.html ne porte pas cette classe (il n'a pas de
   hero) : son <main> restait donc plafonné à 480px sur TOUS les écrans, y
   compris 1600px — exactement le symptôme rapporté (colonne étroite
   centrée, énorme vide latéral). AUCUNE largeur fixe en dur : fluide via
   min(), 3 paliers mobile → tablette → desktop, jamais de saut brutal.
   N'affecte QUE .portal-docs-main--wide (documents.html) — index.html et
   sa règle --hero ci-dessus restent inchangés. ═══════════════════════════ */
@media (min-width: 700px) {
  /* Tablette — grandit avec l'écran jusqu'à un plafond raisonnable, jamais
     plus que l'espace réellement disponible (92vw laisse toujours une
     marge visible des deux côtés, même sur une tablette portrait étroite). */
  .portal-docs-main--wide { max-width: min(92vw, 900px); }
}
@media (min-width: 1100px) {
  /* Desktop — plafond dans la fourchette demandée (1100–1250px). min(92vw, 1180px)
     sature naturellement à 1180px dès que 92vw dépasse cette valeur (donc
     dès ~1283px de large) : AUCUNE règle supplémentaire n'est nécessaire
     pour 1440px/1600px+ — le contenu ne redevient JAMAIS une colonne
     étroite centrée, sans jamais imposer une largeur fixe en dur non plus. */
  .portal-docs-main--wide { max-width: min(92vw, 1180px); }
  /* Les 4 cartes restent en grille 2 colonnes à cette largeur (règle déjà
     existante dès 560px, inchangée) — simplement bien plus larges. */

  /* "Dernières activités" — titre et statut restent sur UNE SEULE ligne,
     chacun à son extrémité, au lieu de se retrouver compressés/empilés
     dans l'ancien conteneur étroit (480px). Aucun changement de structure
     DOM : seul le comportement d'alignement change, à cette largeur. */
  .portal-activity-title-row { justify-content: space-between; flex-wrap: nowrap; }
  .portal-activity-status { white-space: nowrap; }
}

/* ─── Modale "Votre financement" — sheet premium, mobile-first ───────────────
   Mobile : remonte depuis le bas de l'écran (coins arrondis en haut
   uniquement), comme une vraie sheet native. Desktop/tablette (≥ 560px) :
   redevient une modale classique centrée. Jamais de gros donut/graphique
   ici — seulement 3 champs + un bouton. ──────────────────────────────────── */

.portal-fin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}

.portal-fin-modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--portal-card-bg);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem clamp(1.25rem, 6vw, 1.75rem) calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(10, 22, 40, 0.18);
}

.portal-fin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.portal-fin-modal-header h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--portal-navy);
}

.portal-fin-modal-close {
  background: none;
  border: none;
  padding: 0.25rem 0.375rem;
  font-size: 1rem;
  color: var(--portal-text-muted);
  cursor: pointer;
  border-radius: var(--portal-radius-sm);
}
.portal-fin-modal-close:hover { color: var(--portal-navy); }
.portal-fin-modal-close:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 1px; }

.portal-fin-modal-field { margin-bottom: 1.125rem; }
.portal-fin-modal-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.portal-fin-modal-input-wrap { display: flex; align-items: center; gap: 0.5rem; }
.portal-fin-modal-input-wrap .portal-input { flex: 1; margin: 0; }

.portal-fin-modal-sheet .portal-btn { margin-top: 0.25rem; }

@media (min-width: 560px) {
  .portal-fin-modal-overlay { align-items: center; padding: 1rem; }
  .portal-fin-modal-sheet { border-radius: var(--portal-radius); max-height: 90vh; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Redesign "Documents" — espace client bancaire (tableau de bord 4 cartes,
   dernières activités, vues détail). Même langage visuel que le redesign
   "Proposition 1" ci-dessus (cartes blanches, ombres légères, navy/or),
   volontairement simple : peu d'informations affichées simultanément,
   gros boutons tactiles, jamais un aspect "outil interne". ═══════════════
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Bannière d'alerte — visible uniquement si une action est requise ───── */
.portal-docs-alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--portal-warn-bg);
  border: 1px solid var(--portal-warn-border);
  border-radius: var(--portal-radius);
  padding: 1.125rem clamp(1.1rem, 5vw, 1.5rem);
}
.portal-docs-alert-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--portal-warn-text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.0625rem;
}
.portal-docs-alert-body { flex: 1 1 220px; min-width: 0; }
.portal-docs-alert-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--portal-warn-text);
  margin-bottom: 0.2rem;
}
.portal-docs-alert-text { font-size: 0.8125rem; color: var(--portal-text); line-height: 1.4; }
.portal-docs-alert-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.625rem 1.125rem;
  background: var(--portal-warn-text);
  color: #fff;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
}
.portal-docs-alert-btn:hover { opacity: 0.9; }
.portal-docs-alert-btn:focus-visible { outline: 2px solid var(--portal-navy); outline-offset: 2px; }

/* ── 4 cartes résumé — une par ligne en mobile (consigne explicite), grille
   2×2 à partir de 560px (confortable dès les grands téléphones), même
   point de rupture "desktop" (900px) que le reste du redesign. ──────────── */
.portal-doccards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}
@media (min-width: 560px) {
  .portal-doccards-grid { grid-template-columns: 1fr 1fr; }
}

.portal-doccard {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 1.125rem 1.125rem;
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.04);
  cursor: pointer;
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  min-height: 92px; /* cible tactile confortable, cohérent sur les 4 cartes */
  transition: box-shadow 0.15s, border-color 0.15s;
}
.portal-doccard:hover { box-shadow: 0 14px 34px rgba(10, 22, 40, 0.08); }
.portal-doccard:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 2px; }

.portal-doccard-icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.portal-doccard--alert   .portal-doccard-icon-wrap { background: var(--portal-warn-bg); }
.portal-doccard--success .portal-doccard-icon-wrap { background: var(--portal-success-bg); }
.portal-doccard--gold    .portal-doccard-icon-wrap { background: var(--portal-gold-soft); }
.portal-doccard--neutral .portal-doccard-icon-wrap { background: var(--portal-bg-soft); }

.portal-doccard-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--portal-warn-text);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-doccard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.portal-doccard-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--portal-navy);
}
.portal-doccard-count { font-size: 0.8125rem; font-weight: 600; color: var(--portal-text-muted); }
.portal-doccard--alert .portal-doccard-count { color: var(--portal-warn-text); }
.portal-doccard-hint {
  display: none; /* repli mobile compact — voir media query ≥560px */
  font-size: 0.75rem;
  color: var(--portal-text-muted);
  line-height: 1.35;
}
@media (min-width: 560px) {
  .portal-doccard-hint { display: block; }
}

.portal-doccard-chevron {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--portal-text-muted);
}

/* ── Dernières activités ───────────────────────────────────────────────── */
.portal-activity-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.portal-activity-header .portal-dash-card-title { margin-bottom: 0; }

.portal-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 0;
}
.portal-activity-row + .portal-activity-row { border-top: 1px solid var(--portal-border); }

.portal-activity-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--portal-bg-soft);
  color: var(--portal-text-muted);
}
.portal-activity-row--a_remplacer .portal-activity-icon { background: var(--portal-warn-text); color: #fff; }
.portal-activity-row--recu .portal-activity-icon { background: var(--portal-success-text); color: #fff; }
.portal-activity-row--publie .portal-activity-icon { background: var(--portal-gold); color: #fff; }

.portal-activity-body { flex: 1; min-width: 0; }
.portal-activity-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.portal-activity-title { font-size: 0.875rem; font-weight: 700; color: var(--portal-navy); overflow-wrap: anywhere; min-width: 0; }
.portal-activity-status { font-size: 0.75rem; font-weight: 600; color: var(--portal-text-muted); }
.portal-activity-status--a_remplacer { color: var(--portal-warn-text); }
.portal-activity-status--publie { color: var(--portal-gold); }
.portal-activity-detail { margin-top: 0.2rem; font-size: 0.8125rem; color: var(--portal-text-muted); line-height: 1.4; }

.portal-activity-action {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0.4rem 0.875rem;
  border-radius: 18px;
  border: 1px solid var(--portal-border);
  background: var(--portal-card-bg);
  color: var(--portal-navy);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  white-space: nowrap;
}
.portal-activity-row--a_remplacer .portal-activity-action { background: var(--portal-warn-text); color: #fff; border-color: var(--portal-warn-text); }
.portal-activity-action:hover { opacity: 0.85; }
.portal-activity-action:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 2px; }
.portal-activity-action:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Vue détail — bouton retour + titre ───────────────────────────────── */
.portal-docs-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  padding: 0.5rem 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--portal-gold);
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
}
.portal-docs-back-btn:hover { text-decoration: underline; }
.portal-docs-back-btn:focus-visible { outline: 2px solid var(--portal-gold); outline-offset: 2px; }

.portal-docs-detail-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  font-weight: 600;
  color: var(--portal-navy);
  margin-bottom: 0.25rem;
}
.portal-docs-detail-subtitle { font-size: 0.8125rem; color: var(--portal-text-muted); margin-bottom: 1rem; }
.portal-docs-detail-subtitle.portal-hidden { display: none; }

.portal-docs-detail-section.portal-hidden { display: none; }
.portal-docs-detail-section + .portal-docs-detail-section { margin-top: 0.5rem; }

/* ── Badge "Nouveau" (documents publiés par le conseiller) ───────────────── */
.portal-doc-new-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--portal-gold);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* ── "Mes documents envoyés" — liste à plat, libellé logique en premier,
   nom de fichier physique en détail secondaire (jamais l'inverse). ──────── */
.portal-doc-sent-row { align-items: flex-start; }
.portal-doc-sent-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
.portal-doc-sent-label { font-size: 0.875rem; font-weight: 700; color: var(--portal-navy); }
.portal-doc-sent-filename {
  font-size: 0.75rem;
  color: var(--portal-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/* ── Petits écrans (< 360px) — resserre l'en-tête des cartes résumé ──────── */
@media (max-width: 360px) {
  .portal-doccard { padding: 0.875rem; gap: 0.625rem; }
  .portal-doccard-icon-wrap { width: 38px; height: 38px; font-size: 1.0625rem; }
}
