/* =============================================================================
   abonnements.css — ce qui n'appartient qu'aux écrans « abonnements »
   -----------------------------------------------------------------------------
   Charge en DERNIER : tokens.css → components.css → abonnements.css.
   Règle de placement : une brique sans métier va dans components.css ; ici ne
   vivent que les objets qui nomment un concept de facturation — la composition
   d'un abonnement, une facture qui se déplie, un palier, un quota.
   ========================================================================== */

/* --- Bandeau permanent « montants illustratifs » --------------------------- */
.illus {
  display: flex; align-items: center; gap: 11px; padding: 9px 16px; margin-bottom: 16px;
  border-radius: 10px; background: rgba(96, 161, 201, .08);
  border: 1px solid rgba(96, 161, 201, .22); font-size: 12px; color: #3d6d88;
}
.illus strong { color: #2a5b76; }
.illus svg { flex-shrink: 0; }

/* =============================================================================
   LA COMPOSITION D'UN ABONNEMENT — les trois composants, jamais deux
   ========================================================================== */

.bricks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.brick {
  display: flex; flex-direction: column; gap: 9px; padding: 16px 17px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd;
}
.brick.is-off { border-style: dashed; background: var(--white); }
.brick .top { display: flex; align-items: center; gap: 9px; }
.brick .n {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 600;
}
.brick.is-off .n { background: #b6c2cc; }
.brick .t { font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.35; }
.brick .assiette { font-size: 11.5px; color: var(--muted); line-height: 1.55; flex-grow: 1; }
.brick .amt {
  padding-top: 9px; border-top: 1px solid var(--line-soft);
  font-size: 18px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums;
}
.brick .amt small { font-size: 11.5px; font-weight: 400; color: var(--muted); }

/* --- Pastille de palier ---------------------------------------------------- */
.plan-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.plan-tag i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.plan-P0 { background: rgba(194, 24, 91, .10); color: #a3175a; }
.plan-P0 i { background: #c2185b; }
.plan-P1 { background: rgba(184, 132, 92, .14); color: #8a6440; }
.plan-P1 i { background: #b8845c; }
.plan-P2 { background: rgba(232, 161, 58, .16); color: #8f6212; }
.plan-P2 i { background: #e8a13a; }
.plan-P3 { background: rgba(120, 144, 163, .18); color: #4e6377; }
.plan-P3 i { background: #7890a3; }
.plan-P4 { background: rgba(96, 161, 201, .18); color: #2f6685; }
.plan-P4 i { background: #60a1c9; }
.plan-none { background: var(--line-soft); color: var(--muted); }
.plan-none i { background: #c3cdd6; }

/* --- Quota consommé -------------------------------------------------------- */
.quota { display: flex; flex-direction: column; gap: 3px; min-width: 96px; }
.quota .bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.quota .bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.quota .bar i.over { background: var(--red); }
.quota .lbl { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.quota .lbl.over { color: #a33a36; font-weight: 600; }

/* =============================================================================
   LE FIL DES ANNIVERSAIRES — la facturation est calée sur la date anniversaire,
   jamais sur le 1er du mois. Cet écran doit le rendre évident.
   ========================================================================== */

.anniv { display: flex; flex-direction: column; }
.anniv-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.anniv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.anniv-row .day {
  flex-shrink: 0; width: 50px; text-align: center; padding: 5px 0; border-radius: 9px;
  background: var(--bg-soft);
}
.anniv-row .day .d { font-size: 16px; font-weight: 600; color: var(--navy); line-height: 1.1; }
.anniv-row .day .m { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.anniv-row.is-soon .day { background: rgba(255, 165, 88, .18); }
.anniv-row.is-soon .day .d { color: #b06a1c; }
.anniv-row .body { flex-grow: 1; min-width: 0; }
.anniv-row .who { font-size: 13px; font-weight: 500; color: var(--navy); }
.anniv-row .what { font-size: 11.5px; color: var(--muted); }
.anniv-row .amt { text-align: right; flex-shrink: 0; }
.anniv-row .amt .v { font-size: 14px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.anniv-row .amt .k { font-size: 11px; color: var(--muted); }
.anniv-row.is-none .amt .v { color: var(--muted); font-weight: 500; }

/* =============================================================================
   LA FACTURE QUI SE DÉPLIE
   Le parti de l'écran A4 : une seule table. La ligne consolidée que voit le
   client s'ouvre sur le détail en base, jauge par jauge. C'est ce qui rend une
   facture contestée défendable.
   ========================================================================== */

.inv-id {
  display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 14px 18px;
  border-radius: 11px; background: var(--bg-soft);
}
.inv-id .f { display: flex; flex-direction: column; gap: 1px; }
.inv-id .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.inv-id .v { font-size: 13px; font-weight: 500; color: var(--navy); }
.inv-id .v code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 11.5px;
  background: var(--white); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px;
}

.inv { font-size: 12.5px; width: 100%; }
.inv th {
  padding: 0 12px 10px 0; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; border-bottom: 1.5px solid var(--line);
}
.inv td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--text); }
.inv td.num { color: var(--navy); }
.inv .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv tr.l-main > td { color: var(--text); }
.inv tr.l-main .lbl { font-weight: 500; color: var(--navy); }
.inv tr.l-main .kind { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.inv tr.l-sub > td { background: #fafcfd; padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line-soft); }
.inv tr.l-sub .sn {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 11.5px;
  color: var(--navy); font-weight: 500;
}
.inv tr.l-sub .sd { font-size: 11.5px; color: var(--muted); }
.inv tr.l-sub td:first-child { padding-left: 34px; }
.inv .tot td { border-bottom: 0; padding-top: 14px; }
.inv .tot .k { text-align: right; color: var(--muted); }
.inv .tot .v { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.inv .tot.grand td { border-top: 1.5px solid var(--line); }
.inv .tot.grand .k { color: var(--navy); font-weight: 600; font-size: 13px; }
.inv .tot.grand .v { color: var(--navy); font-weight: 600; font-size: 16px; }

/* =============================================================================
   L'APERÇU D'UN MOUVEMENT — ce qui rend le prorata acceptable au lieu de subi
   ========================================================================== */

.delta { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.delta-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 11px 15px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px;
}
.delta-row .k { color: var(--muted); }
.delta-row .v { font-weight: 500; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta-row .v.neg { color: var(--green); }
.delta-row .v.pos { color: var(--navy); }
.delta-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 15px; background: var(--bg-soft); border-bottom: 0;
}
.delta-foot .k { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.delta-foot .swap { display: flex; align-items: center; gap: 10px; }
.delta-foot .was { font-size: 13px; color: var(--muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.delta-foot .now { font-size: 17px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.delta-foot .arrow { color: var(--muted); }

/* --- Note d'explication sous un aperçu ------------------------------------- */
.why {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-soft); font-size: 11.5px; color: var(--muted); line-height: 1.6;
}
.why strong { color: var(--text); }
.why svg { flex-shrink: 0; margin-top: 1px; }

/* =============================================================================
   B1 — « Mon abonnement », la page unique
   ========================================================================== */

.hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 26px;
  flex-wrap: wrap; padding: 22px 24px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); color: #eaf1f7;
}
.hero .l { display: flex; flex-direction: column; gap: 5px; min-width: 240px; }
.hero .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: #9fb2c0; }
.hero .formula { font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.hero .meta { font-size: 12.5px; color: #b6c8d4; }
.hero .r { display: flex; gap: 30px; flex-wrap: wrap; }
.hero .fig { display: flex; flex-direction: column; gap: 2px; }
.hero .fig .v { font-size: 22px; font-weight: 600; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.hero .fig .v small { font-size: 12px; font-weight: 400; color: #9fb2c0; }
.hero .fig .k { color: #9fb2c0; }
.hero .fig.accent .v { color: var(--orange); }

/* --- Widget « Mon abonnement » du tableau de bord -------------------------- */
.widget-abo { border-left: 3px solid var(--orange); }
.widget-sms .gauge-sms { display: flex; align-items: baseline; gap: 8px; }
.widget-sms .gauge-sms .v { font-size: 26px; font-weight: 600; color: var(--navy); letter-spacing: -.5px; }
.widget-sms .gauge-sms .k { font-size: 12.5px; color: var(--muted); }

/* --- Encadré Pack Pilote ---------------------------------------------------- */
.pilot {
  display: flex; align-items: flex-start; gap: 13px; padding: 15px 18px; border-radius: 12px;
  background: rgba(194, 24, 91, .06); border: 1px solid rgba(194, 24, 91, .22);
  font-size: 12.5px; color: #8d1a4f; line-height: 1.6;
}
.pilot .t { font-weight: 600; color: #7a1745; }
.pilot svg { flex-shrink: 0; margin-top: 2px; }

/* --- Les jauges regroupées par palier (écran « Mon abonnement ») ------------ */
.grp { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.grp-row {
  display: flex; align-items: center; gap: 16px; padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.grp-row:last-child { border-bottom: 0; }
.grp-row .h { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 152px; flex-shrink: 0; }
.grp-row .n { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.grp-row .serials { display: flex; flex-wrap: wrap; gap: 5px; flex-grow: 1; min-width: 0; }
.grp-row .amt { font-size: 13.5px; font-weight: 600; color: var(--navy);
  font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.sn-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px;
  background: var(--bg-soft); color: var(--navy); text-decoration: none;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 11px;
}
.sn-chip:hover { background: var(--line); color: var(--navy-deep); }
.sn-chip.over { background: rgba(217, 83, 79, .12); color: #a33a36; font-weight: 600; }

/* --- Bloc « hors périmètre » ------------------------------------------------ */
.oos { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 52px 24px; text-align: center; }
.oos .t { font-size: 16px; font-weight: 600; color: var(--navy); }
.oos .d { font-size: 13px; color: var(--muted); max-width: 520px; line-height: 1.65; }

/* --- Réactif ---------------------------------------------------------------- */
@media (max-width: 1180px) {
  .bricks { grid-template-columns: minmax(0, 1fr); }
  .hero { flex-direction: column; gap: 18px; }
}
