/* ========================================================================== */
/* FlexiCash UX pass — parcours client clair, cohérent et sans actifs cassés. */
/* Cette couche ne change aucune règle financière ni aucun appel Supabase.     */
/* ========================================================================== */

/* `[hidden]` a été déplacé dans reset.css : les pages d'administration ne
   chargent pas cette feuille et perdaient donc la règle. */

:root {
  --fx-content-max: 1180px;
  --fx-card-pad: clamp(18px, 2.2vw, 28px);
}

body { min-height: 100dvh; }

/* Marques et icônes de fournisseurs : remplace les images absentes par des
   repères visuels locaux, accessibles et toujours disponibles hors ligne. */
.provider-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  inline-size: 48px;
  block-size: 48px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  color: var(--emerald-600);
  box-shadow: 0 8px 18px -16px rgba(6, 69, 47, .55);
}
.provider-mark .lucide { inline-size: 22px; block-size: 22px; }
.provider-mark--moncash { background: #edf9f2; color: #08783f; }
.provider-mark--natcash { background: #fff7dc; color: #8a6200; }
.provider-mark--paypal { background: #eef5ff; color: #1556a8; }
.provider-mark--bank { background: #f0f4f8; color: #30485d; }
.provider-mark--generic { background: var(--bg-sunken); color: var(--text-muted); }

.ux-loading {
  display: grid;
  place-items: center;
  min-height: min(52vh, 430px);
  padding: 32px;
  text-align: center;
}
.ux-loading-card {
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.ux-loading-card .spinner { margin-inline: auto; }
.ux-loading-card strong { display: block; margin-top: 14px; font-size: 1rem; }
.ux-loading-card p { margin: 7px 0 0; color: var(--text-muted); line-height: 1.55; }

.flow-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}
.flow-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text-muted);
}
.flow-progress-item > span {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg-sunken);
  color: var(--text);
  font-weight: 800;
}
.flow-progress-item strong,
.flow-progress-item small { display: block; }
.flow-progress-item strong { color: var(--text); font-size: .84rem; }
.flow-progress-item small { margin-top: 2px; font-size: .7rem; line-height: 1.35; }
.flow-progress-item.is-done { border-color: #bfe4ce; background: #f4fbf7; }
.flow-progress-item.is-done > span { background: var(--emerald-100); color: var(--emerald-600); }
.flow-progress-item.is-current { border-color: var(--emerald-500); box-shadow: 0 0 0 3px rgba(16,163,90,.09); }
.flow-progress-item.is-current > span { background: var(--emerald-600); color: #fff; }

/* Auth -------------------------------------------------------------------- */
.auth-shell { min-height: 100dvh; grid-template-columns: minmax(360px, .82fr) minmax(520px, 1.18fr); }
.auth-side { min-height: 100dvh; padding: clamp(32px, 4vw, 58px); }
.auth-side .pitch { margin-block: auto; padding-block: 44px; }
.auth-side .pitch h2 { max-width: 12ch; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.02; }
.auth-side .pitch p { font-size: 1rem; }
.auth-side .quotes { margin-top: 0; }
.auth-side .quote { display: grid; gap: 11px; }
.auth-side .quote .who { margin-top: 0; }
.auth-panel { place-items: start center; min-height: 100dvh; padding: 32px 24px; overflow: visible; }
.auth-card { max-width: 520px; margin: auto; padding: clamp(24px, 3vw, 38px); }
.auth-form { margin-top: 22px; gap: 14px; }
.auth-form .field { gap: 7px; }
.auth-form .input { min-height: 48px; }
.auth-form .checkbox {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  line-height: 1.5;
}
.auth-form .checkbox input { margin-top: 3px; }
.auth-form .checkbox a { display: inline; white-space: normal; }
.auth-trust-list { display: grid; gap: 11px; margin: 18px 0 0; padding: 0; list-style: none; }
.auth-trust-list li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,.82); font-size: .9rem; line-height: 1.5; }
.auth-trust-list li::before { content: "✓"; display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.12); color: #ffd34e; font-weight: 900; }

/* Onboarding --------------------------------------------------------------- */
.onb-body { place-items: start center; padding: clamp(36px, 7vh, 76px) 20px; }
.onb-card { max-width: 680px; }
.onb-card > .card { padding: var(--fx-card-pad); }
.onb-title { font-size: clamp(1.85rem, 4vw, 2.55rem); line-height: 1.12; }
.onb-sub { max-width: 62ch; line-height: 1.65; }
.onb-summary-card { margin-top: 24px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-sm); }
.onb-summary-card ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.onb-summary-card li { display: flex; gap: 11px; align-items: flex-start; color: var(--text-muted); line-height: 1.5; }
.onb-summary-card li::before { content: "✓"; flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 9px; background: var(--emerald-100); color: var(--emerald-600); font-weight: 900; }

/* Application -------------------------------------------------------------- */
.app-main > .page { width: min(100%, calc(var(--fx-content-max) + 56px)); margin-inline: auto; }
.page-head { align-items: flex-start; }
.page-head > div:first-child { max-width: 760px; }
.page-head h1 { letter-spacing: -.035em; }
.page-head .muted { line-height: 1.55; }
.page-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card);
}
.page-context-bar-copy { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-context-bar-copy strong,
.page-context-bar-copy span { display: block; }
.page-context-bar-copy span { margin-top: 2px; color: var(--text-muted); font-size: .78rem; }
.profile-switcher { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-sunken); }
.profile-switcher .btn { min-height: 34px; padding: 7px 13px; box-shadow: none; }

/* Tableau de bord */
#top-grid, #activity-row { align-items: stretch; }
#top-grid .card, #activity-row .card { height: 100%; }
.dashboard-status-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.balance-card { min-height: 100%; }
.balance-card .amt { line-height: 1.05; }
.balance-card .meta { grid-template-columns: repeat(2, minmax(0,1fr)); }
.balance-card .meta .m { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.balance-card .meta .m span:first-child { max-width: 22ch; }
.quick-actions { align-content: start; }
.qa { min-height: 88px; }
.account-promo-card { border: 1px solid var(--border); border-left: 4px solid var(--emerald-500); }

/* Dépôt, retrait et moyens de paiement ------------------------------------ */
.funding-page-head { margin-bottom: 16px; }
.funding-profile-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(135deg, #fff, #f4fbf7);
}
.funding-profile-banner strong,
.funding-profile-banner span { display: block; }
.funding-profile-banner span { margin-top: 3px; color: var(--text-muted); font-size: .78rem; }
.funding-profile-banner .provider-mark { width: 42px; height: 42px; }
.funding-flow-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.funding-flow-step { display: flex; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.funding-flow-step > span { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; background: var(--emerald-100); color: var(--emerald-600); font-weight: 900; }
.funding-flow-step strong,
.funding-flow-step small { display: block; }
.funding-flow-step strong { font-size: .82rem; }
.funding-flow-step small { margin-top: 3px; color: var(--text-muted); font-size: .7rem; line-height: 1.35; }
.funding-channel-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.funding-channel { min-height: 82px; padding: 14px; }
.funding-channel-icon { overflow: visible; border: 0; background: transparent; }
.funding-channel-icon img { display: none !important; }
.funding-form-card, .funding-summary-card, .funding-methods-card { border-radius: 20px; }
.funding-form-card h2, .funding-summary-card h2, .funding-methods-card h2 { margin-top: 4px; }
.funding-destination { align-items: flex-start; }
.funding-destination > div { min-width: 0; }
.funding-destination strong { overflow-wrap: anywhere; }
.funding-quote { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-sunken); }
.funding-summary-card { position: sticky; top: calc(var(--topbar-h) + 18px); align-self: start; }
.payment-method-help { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.payment-method-help > div { padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.payment-method-help strong, .payment-method-help span { display: block; }
.payment-method-help span { margin-top: 5px; color: var(--text-muted); font-size: .76rem; line-height: 1.45; }
.payment-method-card { border-left: 4px solid var(--emerald-500); }

/* Activation --------------------------------------------------------------- */
.activation-shell { max-width: 1280px; }
.activation-layout { grid-template-columns: minmax(280px,.72fr) minmax(0,1.28fr); gap: clamp(22px,3vw,38px); }
.activation-aside { padding: clamp(22px,2.5vw,30px); }
.activation-aside h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); }
.activation-aside > p { font-size: .94rem; }
.activation-steps li { align-items: flex-start; }
.activation-workspace { min-height: 0; }
.activation-method-symbol img,
.activation-selected-symbol img { display: none !important; }
.activation-method-card { min-height: 82px; }
.activation-method-copy small { line-height: 1.45; }
.activation-form-panel { box-shadow: none; }
.activation-online-points { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
.activation-online-points li { display: flex; gap: 9px; align-items: flex-start; color: var(--text-muted); font-size: .8rem; line-height: 1.45; }
.activation-online-points li::before { content: "✓"; color: var(--emerald-600); font-weight: 900; }

/* Profil professionnel ----------------------------------------------------- */
.business-intro-grid { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 22px; align-items: start; }
.business-benefits { display: grid; gap: 11px; margin-top: 18px; }
.business-benefit { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.business-benefit .provider-mark { width: 38px; height: 38px; border-radius: 12px; }
.business-benefit strong,
.business-benefit span { display: block; }
.business-benefit span { margin-top: 3px; color: var(--text-muted); font-size: .76rem; line-height: 1.45; }

/* Pages de statut */
.status-timeline { display: grid; gap: 12px; margin-top: 24px; }
.status-step { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.status-step-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--bg-sunken); color: var(--text); font-weight: 900; }
.status-step.is-current { border-color: var(--emerald-500); box-shadow: 0 0 0 3px rgba(16,163,90,.08); }
.status-step.is-current .status-step-number { background: var(--emerald-600); color: #fff; }
.status-step strong, .status-step p { display: block; }
.status-step p { margin: 4px 0 0; color: var(--text-muted); font-size: .8rem; line-height: 1.45; }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: minmax(320px,.72fr) minmax(480px,1.28fr); }
  .business-intro-grid { grid-template-columns: 1fr; }
  .funding-summary-card { position: static; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-panel { place-items: start center; min-height: 100dvh; padding: 28px 16px; }
  .auth-card { margin: auto; padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
  .activation-layout { grid-template-columns: 1fr; }
  .activation-aside { position: relative; top: auto; }
  .activation-aside h1 { max-width: 24ch; }
}

@media (max-width: 700px) {
  .flow-progress,
  .funding-flow-guide,
  .payment-method-help { grid-template-columns: 1fr; }
  .flow-progress-item { min-height: 52px; }
  .page-context-bar,
  .funding-profile-banner { align-items: flex-start; flex-direction: column; }
  .profile-switcher { width: 100%; }
  .profile-switcher .btn { flex: 1; }
  .balance-card .meta { grid-template-columns: 1fr; }
  .activation-aside { border-radius: 20px; }
  .activation-aside .activation-steps { grid-template-columns: 1fr; }
  .activation-fee-card { flex-direction: row; align-items: center; }
  .activation-fee-card small { text-align: right; }
  .status-step { grid-template-columns: 38px minmax(0,1fr); }
  .status-step > .badge { grid-column: 2; justify-self: start; }
}

@media (max-width: 480px) {
  .auth-panel { padding: 16px 12px 28px; }
  .auth-card { padding: 20px 16px; border-radius: 20px; }
  .auth-card h1 { font-size: 1.55rem; }
  .auth-form { gap: 13px; }
  .onb-body { padding: 30px 14px 46px; }
  .onb-title { font-size: 1.72rem; }
  .activation-shell { padding: 14px 12px 28px; }
  .activation-topbar { margin-bottom: 16px; }
  .activation-aside { padding: 20px 17px; }
  .activation-aside h1 { font-size: 1.72rem; }
  .activation-fee-card { margin: 20px 0; }
  .activation-workspace { padding: 16px; border-radius: 20px; }
  .activation-method-card { min-height: 72px; }
  .funding-channel-grid { grid-template-columns: 1fr; }
  .funding-form-card, .funding-summary-card, .funding-methods-card { padding: 16px; }
}

/* Ajustements de cohérence ajoutés après l’audit page par page. */
.business-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.business-benefits > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 11px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card);
}
.business-benefits > div > .lucide { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--emerald-600); }
.business-benefits > div strong,
.business-benefits > div span { display: block; }
.business-benefits > div span { color: var(--text-muted); font-size: .76rem; line-height: 1.4; }
.account-status-timeline { display: grid; gap: 12px; }
.account-status-timeline .card { border-left: 4px solid var(--border); }
.account-status-timeline .card:nth-child(2),
.account-status-timeline .card:nth-child(3),
.account-status-timeline .card:nth-child(4) { border-left-color: var(--emerald-500); }
.activation-method-symbol .provider-mark,
.activation-selected-symbol .provider-mark { width: 44px; height: 44px; border-radius: 13px; }
.activation-method-symbol,
.activation-selected-symbol { overflow: visible; }
.profile-switcher .btn .lucide { width: 15px; height: 15px; }
.page-head .dashboard-status-row { max-width: none; }

@media (max-width: 700px) {
  .business-benefits { grid-template-columns: 1fr; }
  .dashboard-status-row { width: 100%; justify-content: flex-start; }
  .dashboard-status-row > .badge { font-size: .68rem; }
  .topbar [data-environment-badge] { display: none; }
}

/* Repères visuels honnêtes pour les aperçus et l’assistance publique. */
.hero-device { position: relative; }
.hero-demo-label { display:inline-flex; width:max-content; margin:0 0 12px; padding:6px 9px; border-radius:999px; background:rgba(255,255,255,.14); color:rgba(255,255,255,.88); font-size:.66rem; font-weight:800; letter-spacing:.02em; }
.contact-choice-grid { align-items: stretch; }
.contact-choice-card { display:flex; flex-direction:column; align-items:flex-start; gap:10px; min-height:100%; }
.contact-choice-card h2 { font-size:1.1rem; margin:2px 0 0; }
.contact-choice-card p { color:var(--text-muted); line-height:1.65; flex:1; }
.contact-choice-card .btn { width:100%; justify-content:center; }
@media (max-width:800px){ .contact-choice-grid { grid-template-columns:1fr !important; } }


/* Identité et logos officiels des moyens de paiement — Production réelle. */
.provider-mark--logo {
  display:grid; place-items:center; flex:0 0 auto; padding:4px; overflow:hidden;
  background:#fff; border:1px solid rgba(15,23,42,.10); border-radius:13px;
}
.provider-mark--logo .provider-logo,
.funding-channel-icon .provider-logo,
.activation-method-symbol .provider-logo,
.activation-selected-symbol .provider-logo,
.payment-method-logo .provider-logo {
  display:block !important; width:100%; height:100%; object-fit:contain; border-radius:9px; background:#fff;
}
.funding-channel-icon > .provider-mark--logo { width:46px; height:46px; border:0; padding:3px; }
.activation-method-symbol > .provider-mark--logo,
.activation-selected-symbol > .provider-mark--logo { width:48px; height:48px; border:0; padding:3px; }
.payment-method-logo { width:48px; height:48px; }
.payment-method-main { min-width:0; flex:1; }
.payment-method-main > div { min-width:0; }
@media (max-width:560px) { .payment-method-main { width:100%; } }
