/* ==========================================================================
   Crédit Express — feuille de style (thème finance)
   ========================================================================== */

:root {
  --encre: #0a1120;          /* fond sombre principal */
  --marine: #0f1b33;
  --marine-clair: #17284a;
  --ardoise: #23345a;

  --accent: #10b981;         /* émeraude : croissance, action principale */
  --accent-fonce: #059669;
  --accent-clair: #34d399;
  --accent-pale: #e6f8f1;

  --texte: #101828;
  --texte-doux: #667085;
  --bordure: #e4e7ec;
  --fond: #f3f5f9;
  --blanc: #ffffff;

  --rouge: #d92d20;
  --rouge-pale: #fdecea;
  --vert: #067647;
  --vert-pale: #e3f6ec;
  --orange: #b54708;
  --orange-pale: #fef0d9;

  --rayon: 12px;
  --rayon-petit: 8px;
  --ombre: 0 1px 2px rgba(10, 17, 32, .05), 0 4px 16px rgba(10, 17, 32, .05);
  --ombre-forte: 0 2px 4px rgba(10, 17, 32, .06), 0 16px 40px rgba(10, 17, 32, .12);

  --police: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.55;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
}

main { flex: 1; }

h1, h2, h3 {
  font-family: var(--police);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--encre);
  margin: 0 0 .5em;
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.lien {
  color: var(--accent-fonce);
  font-weight: 600;
  border-bottom: 1px solid transparent;
}
.lien:hover { border-bottom-color: currentColor; }

.texte-doux { color: var(--texte-doux); }
.centre { text-align: center; }

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 17, 32, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}

.entete-interieur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
}

.logo-marque {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-fonce));
  color: var(--encre);
  font-size: 1rem;
  font-weight: 800;
}

.entete .actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entete .utilisateur {
  display: none;
  font-size: .88rem;
  color: #98a2b3;
  margin-right: 6px;
}

.entete form { margin: 0; }

.entete .btn-contour { border-color: rgba(255, 255, 255, .28); color: #fff; }
.entete .btn-contour:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.entete .btn-marine { background: rgba(255, 255, 255, .1); color: #fff; }
.entete .btn-marine:hover { background: rgba(255, 255, 255, .18); }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--rayon-petit);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-accent { background: var(--accent); color: var(--encre); box-shadow: 0 4px 14px rgba(16, 185, 129, .3); }
.btn-accent:hover { background: var(--accent-clair); }

.btn-marine { background: var(--marine); color: #fff; }
.btn-marine:hover { background: var(--marine-clair); }

.btn-contour { background: transparent; border-color: var(--bordure); color: var(--encre); }
.btn-contour:hover { border-color: var(--encre); background: var(--encre); color: #fff; }

.btn-contour-clair { background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; }
.btn-contour-clair:hover { background: rgba(255, 255, 255, .1); }

.btn-desactive { opacity: .45; cursor: not-allowed; }
.btn-desactive:hover { transform: none; background: var(--marine); }

.btn-petit { padding: 6px 13px; font-size: .84rem; }
.btn-plein { width: 100%; }
.btn-grand { padding: 13px 26px; font-size: 1rem; }

/* --------------------------------------------------------------------------
   Messages flash
   -------------------------------------------------------------------------- */
.messages { margin-top: 20px; display: grid; gap: 10px; }

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--rayon-petit);
  border: 1px solid transparent;
  border-left-width: 4px;
  font-size: .94rem;
}
.message-succes { background: var(--vert-pale); color: var(--vert); border-color: #b9e6cd; }
.message-erreur { background: var(--rouge-pale); color: var(--rouge); border-color: #f6c9c5; }
.message-info   { background: var(--orange-pale); color: var(--orange); border-color: #f5d9a3; }

/* --------------------------------------------------------------------------
   Accueil
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #e4e7ec;
  padding: 88px 0 0;
  background:
    radial-gradient(800px 380px at 90% -10%, rgba(16, 185, 129, .22), transparent 60%),
    radial-gradient(600px 340px at 0% 100%, rgba(59, 100, 210, .25), transparent 60%),
    var(--encre);
}

/* quadrillage discret façon terminal de marché */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}

.hero-courbe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 46%;
  pointer-events: none;
}

.hero-contenu { position: relative; max-width: 760px; margin: 0 auto; padding: 0 24px; text-align: center; }

.hero .surtitre {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(52, 211, 153, .35);
  background: rgba(16, 185, 129, .08);
  border-radius: 999px;
  color: var(--accent-clair);
  letter-spacing: .12em;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.hero .surtitre::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-clair);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .2);
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  letter-spacing: -.03em;
  margin: 22px 0 16px;
}
.hero h1 em { font-style: normal; color: var(--accent-clair); }

.hero p { color: #98a2b3; font-size: 1.1rem; margin-bottom: 32px; }
.hero .boutons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* bandeau d'indicateurs */
.indicateurs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 64px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-bottom: none;
  border-radius: var(--rayon) var(--rayon) 0 0;
  background: rgba(15, 27, 51, .7);
  backdrop-filter: blur(6px);
}
.indicateur { padding: 22px 24px; text-align: left; }
.indicateur + .indicateur { border-left: 1px solid rgba(255, 255, 255, .08); }
.indicateur-valeur {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.02em;
}
.indicateur-valeur .haut { color: var(--accent-clair); }
.indicateur-libelle { margin-top: 2px; font-size: .8rem; color: #98a2b3; }

.section { padding: 72px 0 8px; }
.section-titre { text-align: center; max-width: 560px; margin: 0 auto 40px; }
.section-titre h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-titre p { color: var(--texte-doux); }

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.carte {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 26px;
  box-shadow: var(--ombre);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: var(--accent); }
.carte h3 { font-size: 1.08rem; margin-bottom: 8px; }
.carte p { color: var(--texte-doux); margin: 0; font-size: .94rem; }

.icone {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-pale);
  color: var(--accent-fonce);
}
.icone svg { width: 22px; height: 22px; }

.etapes { counter-reset: etape; }
.etape { position: relative; padding-top: 62px; }
.etape::before {
  counter-increment: etape;
  content: '0' counter(etape);
  position: absolute;
  top: 24px;
  left: 26px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-fonce);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent);
}

.bandeau-cta {
  position: relative;
  overflow: hidden;
  margin: 72px 0 0;
  padding: 48px 32px;
  border-radius: var(--rayon);
  text-align: center;
  color: #fff;
  background:
    radial-gradient(500px 240px at 100% 0%, rgba(16, 185, 129, .25), transparent 65%),
    linear-gradient(135deg, var(--encre), var(--marine-clair));
}
.bandeau-cta h2 { color: #fff; }
.bandeau-cta p { color: #98a2b3; }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.formulaire {
  max-width: 460px;
  margin: 56px auto;
  padding: 36px;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-top: 3px solid var(--accent);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-forte);
}
.formulaire h2 { text-align: center; font-size: 1.6rem; }
.formulaire .sous-titre { text-align: center; color: var(--texte-doux); margin-bottom: 26px; font-size: .94rem; }

.champ { margin-bottom: 18px; }
.champ label { display: block; margin-bottom: 6px; font-size: .85rem; color: var(--texte); font-weight: 600; }

.champ input:not([type=checkbox]), .champ select, .champ textarea,
.barre-recherche input, .barre-recherche select {
  width: 100%;
  padding: 10px 13px;
  font: inherit;
  font-size: .94rem;
  color: var(--texte);
  background: var(--blanc);
  border: 1.5px solid var(--bordure);
  border-radius: var(--rayon-petit);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.champ input:focus, .champ select:focus, .barre-recherche input:focus, .barre-recherche select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .18);
}
.champ.a-erreur input { border-color: var(--rouge); }

.champ .aide { margin-top: 6px; font-size: .8rem; color: var(--texte-doux); }
.champ .aide ul { margin: 0; padding-left: 18px; }
.erreur { color: var(--rouge); font-size: .85rem; margin-top: 6px; font-weight: 500; }
.erreurs-globales { margin-bottom: 18px; }

.devise-apercu {
  margin: -8px 0 18px;
  padding: 9px 13px;
  border-radius: var(--rayon-petit);
  background: var(--accent-pale);
  color: var(--accent-fonce);
  font-size: .88rem;
  font-weight: 600;
}
.devise-apercu[hidden] { display: none; }

.formulaire-pied { text-align: center; margin: 22px 0 0; font-size: .92rem; color: var(--texte-doux); }

/* --------------------------------------------------------------------------
   Pages internes
   -------------------------------------------------------------------------- */
.page { padding: 36px 0 24px; }

.page-entete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}
.page-entete h2 { margin: 0; font-size: 1.7rem; }
.page-entete p { margin: 4px 0 0; color: var(--texte-doux); }

.retour {
  display: inline-block;
  margin-bottom: 18px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--texte-doux);
}
.retour:hover { color: var(--accent-fonce); }

/* Carte de solde */
.solde-carte {
  position: relative;
  overflow: hidden;
  padding: 26px 28px;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(360px 200px at 100% 0%, rgba(16, 185, 129, .3), transparent 65%),
    linear-gradient(135deg, var(--encre), var(--marine-clair));
  box-shadow: var(--ombre-forte);
}
.solde-carte::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.solde-carte > * { position: relative; z-index: 1; }
.solde-carte .rang { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.solde-carte .libelle { color: #98a2b3; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.solde-carte .montant {
  margin: 10px 0 14px;
  font-family: var(--mono);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.solde-carte .montant small { font-size: .45em; font-weight: 500; color: var(--accent-clair); margin-left: 6px; letter-spacing: .04em; }
.solde-carte .numero { color: #98a2b3; font-family: var(--mono); font-size: .84rem; letter-spacing: .1em; }

.cartes-comptes { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 36px; }

/* Statistiques */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 26px; }
.stat {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-left: 3px solid var(--accent);
  border-radius: var(--rayon);
  padding: 16px 20px;
  box-shadow: var(--ombre);
}
.stat .stat-libelle { font-size: .74rem; font-weight: 600; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .08em; }
.stat .stat-valeur + .stat-valeur { margin-top: 0; }
.stat .stat-valeur { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; color: var(--encre); margin-top: 4px; }

/* Panneau + tableaux */
.panneau {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
}
.panneau-entete { padding: 16px 22px; border-bottom: 1px solid var(--bordure); }
.panneau-entete h3 { margin: 0; font-size: 1.05rem; }

.tableau-defilant { overflow-x: auto; }

table.historique { width: 100%; border-collapse: collapse; }
table.historique th, table.historique td {
  text-align: left;
  padding: 12px 22px;
  border-bottom: 1px solid var(--bordure);
  font-size: .9rem;
  white-space: nowrap;
}
table.historique th {
  background: #f9fafb;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--texte-doux);
}
table.historique tbody tr:last-child td { border-bottom: none; }
table.historique tbody tr:hover { background: #f9fafb; }
table.historique .droite { text-align: right; }
table.historique .num { font-family: var(--mono); font-size: .86rem; }
table.historique td.libre { white-space: normal; min-width: 160px; }

.vide { padding: 40px 22px; text-align: center; color: var(--texte-doux); }

.montant-depot { color: var(--vert); font-weight: 600; }
.montant-retrait { color: var(--rouge); font-weight: 600; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #eef0f4;
  color: var(--texte-doux);
}
.badge-actif, .badge-depot { background: var(--vert-pale); color: var(--vert); }
.badge-suspendu, .badge-en_attente { background: var(--orange-pale); color: var(--orange); }
.badge-cloture, .badge-retrait, .badge-virement, .badge-refuse { background: var(--rouge-pale); color: var(--rouge); }
.badge-role { background: rgba(255, 255, 255, .14); color: #fff; }

/* Sur fond sombre (carte de solde), les badges restent lisibles */
.solde-carte .badge-actif { background: rgba(52, 211, 153, .18); color: var(--accent-clair); }
.solde-carte .badge-suspendu, .solde-carte .badge-en_attente { background: rgba(251, 191, 36, .16); color: #fbbf24; }
.solde-carte .badge-cloture, .solde-carte .badge-refuse { background: rgba(248, 113, 113, .18); color: #fca5a5; }

/* Décision sur une demande */
.decision { display: inline-flex; gap: 8px; }
.decision form { margin: 0; }
.btn-danger { border-color: var(--rouge); color: var(--rouge); }
.btn-danger:hover { background: var(--rouge); border-color: var(--rouge); color: #fff; }

.pastille {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rouge);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}

/* Recherche */
.barre-recherche { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.barre-recherche input[type=text] { flex: 1 1 260px; width: auto; }
.barre-recherche select { flex: 0 0 auto; width: auto; }

.actions-compte { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 30px; }

/* Résumé de compte dans les formulaires d'opération */
.resume-compte {
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: var(--rayon-petit);
  background: var(--fond);
  border: 1px solid var(--bordure);
  font-size: .92rem;
}
.resume-compte .ligne { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.resume-compte .ligne span:first-child { color: var(--texte-doux); }
.resume-compte .ligne strong { font-family: var(--mono); font-size: .88rem; }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.pied {
  margin-top: 72px;
  padding: 44px 0 30px;
  background: var(--encre);
  color: #98a2b3;
  font-size: .9rem;
}
.pied .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 28px; }
.pied .marque { color: #fff; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.pied strong { color: #fff; display: block; margin-bottom: 8px; }
.pied a { display: block; padding: 2px 0; }
.pied a:hover { color: var(--accent-clair); }
.pied p { margin: 0; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 760px) {
  .entete .utilisateur { display: inline; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .entete-interieur { min-height: 58px; }
  .entete .btn { padding: 7px 11px; font-size: .82rem; }
  .logo { font-size: 1.05rem; }
  .hero { padding-top: 60px; }
  .hero-contenu { padding: 0 16px; }
  .indicateurs { margin-top: 44px; }
  .indicateur { padding: 16px; }
  .indicateur-valeur { font-size: 1.1rem; }
  .formulaire { margin: 28px auto; padding: 26px 20px; }
  .section { padding-top: 52px; }
  .bandeau-cta { padding: 32px 20px; }
  .solde-carte { padding: 22px 20px; }
  .cartes-comptes { grid-template-columns: 1fr; }
  table.historique th, table.historique td { padding: 10px 14px; }
  .actions-compte .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
