/* =====================================================================
   WB Web — espace client (s'appuie sur base.css)
   ===================================================================== */

body { min-height: 100vh; display: flex; flex-direction: column; }
:root { --brand: #f2d64b; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 { font-size: 15px; letter-spacing: -0.01em; }

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

/* ---------- En-tête ---------- */
.portal-header { position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 10, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.portal-header-inner { height: 60px; display: flex; align-items: center; gap: 28px; }
.logo em {
    font-style: normal; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); padding: 3px 7px; border: 1px solid var(--line-strong); margin-left: 6px; letter-spacing: .1em; align-self: center;
}
.portal-nav { display: flex; align-self: stretch; margin-left: auto; }
.portal-nav a {
    display: flex; align-items: center; padding: 0 12px; margin-bottom: -1px; white-space: nowrap;
    text-decoration: none; color: var(--muted); font-size: 14px; border-bottom: 1px solid transparent; transition: color .15s;
}
.portal-nav a:hover { color: var(--white); }
.portal-nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--white); }
.portal-logout { margin: 0; }
.portal-logout button { font: inherit; font-size: 14px; color: var(--subtle); background: none; border: 0; cursor: pointer; padding: 6px 0; }
.portal-logout button:hover { color: var(--white); }
.portal-back { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 14px; }
.portal-back:hover { color: var(--white); }

.portal-main { flex: 1; padding: 44px 0 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { color: var(--muted); margin-top: 8px; }
.page-head .muted.small a { text-decoration: none; }
.page-head .muted.small a:hover { color: var(--white); }

/* ---------- Cartes : grilles jointes à traits fins ---------- */
.grid { display: grid; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; background: var(--bg-raised); border: 1px solid var(--line); padding: 24px; }
.grid > .card { border-width: 0 1px 1px 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head a { color: var(--muted); font-size: 13px; text-decoration: none; }
.card-head a:hover { color: var(--white); }
.card-label { font-family: var(--mono); font-size: 11.5px; color: var(--subtle); margin-bottom: 10px; }
.card-value { font-size: 1.65rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; color: var(--white); }
.card-value.warn { color: var(--warning); }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.card-sub a { text-decoration: none; }
.card-sub a:hover { color: var(--white); }

/* Carte principale : quadrillage discret, comme sur le site */
.card-hero { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 28px; overflow: hidden; }
.card-hero::before, .welcome::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 40px 40px; background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(ellipse 50% 120% at 100% 0%, #000 10%, transparent 70%);
    mask-image: radial-gradient(ellipse 50% 120% at 100% 0%, #000 10%, transparent 70%);
}
.card-hero > *, .welcome > * { position: relative; }
.site-domain { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.035em; color: var(--white); margin: 4px 0 12px; }
.hero-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }

.site-status {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--line-strong);
    font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.site-status i { width: 6px; height: 6px; background: var(--subtle); }
.site-status.up { color: var(--success); border-color: rgba(62, 207, 142, .4); }
.site-status.up i { background: var(--success); box-shadow: 0 0 0 3px rgba(62, 207, 142, .16); }
.site-status.down { color: var(--error); border-color: rgba(240, 82, 79, .45); }
.site-status.down i { background: var(--error); }
.site-status.unknown { color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }
.list a { text-decoration: none; }
.list a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.empty { color: var(--subtle); padding: 4px 0; }
.empty a { color: var(--text); }

/* Étiquettes de statut */
.badge-envoye, .badge-open, .badge-nouvelle { color: #aab9ff; border-color: rgba(91, 124, 250, .45); }
.badge-accepte, .badge-paid, .badge-active, .badge-terminee { color: var(--success); border-color: rgba(62, 207, 142, .4); }
.badge-refuse, .badge-uncollectible, .badge-unpaid, .badge-past_due, .badge-expire, .badge-failed { color: var(--error); border-color: rgba(240, 82, 79, .45); }
.badge-en_cours, .badge-trialing, .badge-incomplete, .badge-pending, .badge-paused { color: var(--warning); border-color: rgba(245, 165, 36, .4); }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.label-link { color: var(--muted); font-weight: 400; font-size: 12.5px; text-decoration: none; }
.label-link:hover { color: var(--white); }
.readonly-field { display: grid; gap: 3px; padding: 12px 14px; border: 1px dashed var(--line-strong); font-size: 14px; }
.readonly-field span { font-family: var(--mono); font-size: 11.5px; color: var(--subtle); }
.readonly-field strong { color: var(--white); font-weight: 500; }
.readonly-field a { color: var(--text); }

/* ---------- Connexion / inscription ---------- */
.auth { max-width: 420px; margin: 6vh auto 0; }
.auth-wide { max-width: 560px; }
.auth .card { padding: 32px; }
.auth h1 { font-size: 1.7rem; margin-bottom: 8px; }
.auth p.muted { margin-bottom: 24px; }
.auth-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); background: var(--bg); margin-bottom: 22px; }
.auth-icon .icon { width: 20px; height: 20px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-switch { text-align: center; margin-top: 20px; color: var(--subtle); font-size: 14px; }
.auth-switch a { color: var(--text); }

/* ---------- Devis, factures, reçus (document papier) ---------- */
.quote-paper { background: #fff; color: #18181b; padding: 44px; border-top: 3px solid #0a0a0a; }
.quote-paper h1, .quote-paper h2, .quote-paper h3 { color: #0a0a0a; }
.quote-paper .muted { color: #71717a; }
.quote-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; font-size: 14px; }
.quote-parties strong { display: block; margin-bottom: 4px; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.quote-table th { text-align: left; font-weight: 600; font-size: 12px; color: #52525b; padding: 10px 8px; border-bottom: 2px solid #0a0a0a; }
.quote-table td { padding: 12px 8px; border-bottom: 1px solid #e4e4e7; }
.quote-table .num { text-align: right; white-space: nowrap; font-family: inherit; }
.quote-totals { margin: 20px 0 0 auto; max-width: 320px; font-size: 15px; }
.quote-totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.quote-totals .grand { font-weight: 700; font-size: 1.1rem; border-top: 2px solid #0a0a0a; margin-top: 6px; padding-top: 10px; }
.quote-terms { margin-top: 24px; padding: 12px 14px; border-left: 3px solid #0a0a0a; background: #f4f4f5; font-size: 14px; color: #27272a; }
.quote-notes { margin-top: 28px; font-size: 14px; color: #3f3f46; white-space: pre-line; }
.quote-legal { margin-top: 28px; font-size: 12px; color: #71717a; }
.quote-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.quote-actions form { margin: 0; }

/* ---------- Mon site ---------- */
.uptime-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; height: 44px; }
.uptime-bars i { background: var(--surface-2); }
.uptime-bars i.ok { background: var(--success); opacity: .85; }
.uptime-bars i.partial { background: var(--warning); }
.uptime-bars i.down { background: var(--error); }
.uptime-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.uptime-legend span { display: inline-flex; align-items: center; gap: 6px; }
.uptime-legend i { width: 9px; height: 9px; background: var(--surface-2); }
.uptime-legend i.ok { background: var(--success); }
.uptime-legend i.partial { background: var(--warning); }
.uptime-legend i.down { background: var(--error); }

.included { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; }
.included li { display: flex; gap: 10px; align-items: flex-start; color: #d6d6d6; }
.included .icon { color: var(--accent); margin-top: 3px; }

/* ---------- Accueil d'un nouveau compte ---------- */
.welcome { padding: 32px; overflow: hidden; }
.welcome h2 { font-size: 1.45rem; letter-spacing: -0.03em; margin-bottom: 10px; }
.welcome > p { max-width: 640px; }
.welcome-steps { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); counter-reset: step; }
.welcome-steps li { counter-increment: step; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 4px; background: var(--bg); }
.welcome-steps li::before { content: "0" counter(step); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--subtle); margin-bottom: 14px; }
.welcome-steps li:first-child::before { color: var(--white); }
.welcome-steps span { color: var(--muted); font-size: 14px; }

/* ---------- Paiement sur le site ---------- */
.invoice-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.invoice-side { display: grid; gap: 12px; position: sticky; top: 80px; }
.pay-card { display: grid; gap: 12px; }
.pay-card h2 { font-size: 1.15rem; letter-spacing: -0.02em; }
.stripe-element { min-height: 120px; }
.secure-note { display: flex; gap: 8px; align-items: flex-start; }
.secure-note .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--success); }
.pm-list li { align-items: flex-start; }
.pm-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pm-actions form { margin: 0; }

/* ---------- À faire : la prochaine étape, bien visible ---------- */
.next-step {
    display: flex; justify-content: space-between; align-items: center; gap: 20px 32px; flex-wrap: wrap;
    padding: 22px 24px; margin-bottom: 16px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-left: 3px solid var(--brand);
}
.next-step > div { flex: 1 1 420px; }
.next-step h2 { font-size: 1.12rem; letter-spacing: -0.02em; margin-bottom: 6px; }
.next-step p { color: var(--muted); font-size: 14px; max-width: 640px; }
.next-step .btn { flex-shrink: 0; }
.next-step-action { background: linear-gradient(90deg, rgba(242, 214, 75, .07), transparent 60%), var(--bg-raised); }
.next-step-danger { border-left-color: var(--error); background: linear-gradient(90deg, rgba(240, 82, 79, .08), transparent 60%), var(--bg-raised); }
.next-step-info { border-left-color: var(--accent); }

/* ---------- Mon offre : ce que le client paie ---------- */
.offer { background: var(--bg-raised); border: 1px solid var(--line); margin: 16px 0; }
.offer-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.offer-head .card-label { margin-bottom: 6px; }
.offer-head h2 { font-size: 1.35rem; letter-spacing: -0.03em; }
.offer-terms { color: var(--muted); font-size: 13.5px; }
.offer-terms a { color: var(--text); }
.offer-rows { display: grid; grid-template-columns: repeat(3, 1fr); }
.offer-rows-2 { grid-template-columns: repeat(2, 1fr); }
.offer-row { padding: 20px 24px 22px; border-right: 1px solid var(--line); min-width: 0; }
.offer-row:last-child { border-right: 0; }
.offer-value { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.03em; color: var(--white); line-height: 1.2; overflow-wrap: anywhere; }
.offer-note { display: flex; gap: 9px; align-items: baseline; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.offer-note i { flex-shrink: 0; width: 7px; height: 7px; background: var(--subtle); transform: translateY(-1px); }
.offer-note.tone-ok i { background: var(--success); }
.offer-note.tone-warn i { background: var(--brand); }
.offer-note a { color: var(--text); white-space: nowrap; }
.offer-foot { display: flex; gap: 10px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); color: #9ee8c4; font-size: 14px; }
.offer-foot .icon { width: 16px; height: 16px; color: var(--success); }
.home-lists { margin-top: 16px; }

/* ---------- Paiement en une étape (page Paiement) ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.checkout-summary h2 { font-size: 1.35rem; letter-spacing: -0.03em; margin: 2px 0 18px; }
.checkout-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.checkout-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.checkout-lines strong { display: block; color: var(--white); font-weight: 600; }
.checkout-lines span { color: var(--muted); font-size: 13px; }
.checkout-lines b { white-space: nowrap; color: var(--white); font-weight: 600; }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 18px 0 6px; }
.checkout-total span { color: var(--muted); }
.checkout-total strong { font-size: 1.7rem; letter-spacing: -0.03em; color: var(--white); }
.checkout-then { color: var(--muted); font-size: 14px; }
.checkout-promises { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 9px; color: var(--muted); font-size: 13.5px; }
.checkout-promises li { display: flex; gap: 10px; align-items: center; }
.checkout-promises .icon { width: 15px; height: 15px; color: var(--success); flex-shrink: 0; }
.checkout-pay h2 { font-size: 1.1rem; letter-spacing: -0.02em; margin-bottom: 14px; }
.quote-pay { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.quote-pay .alert { flex-basis: 100%; margin: 0; }

/* ---------- Détail replié ---------- */
.more-details { margin-top: 16px; }
.more-details summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.more-details summary::-webkit-details-marker { display: none; }
.more-details summary::before { content: "+"; font-family: var(--mono); color: var(--muted); width: 12px; }
.more-details[open] summary::before { content: "−"; }
.more-details[open] summary { margin-bottom: 16px; }

/* ---------- Explication en 3 étapes (moyen de paiement) ---------- */
.explain { margin-bottom: 16px; }
.explain h2 { margin-bottom: 12px; }
.explain ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); counter-reset: step; }
.explain li { counter-increment: step; display: grid; gap: 4px; align-content: start; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-raised); }
.explain li::before { content: "0" counter(step); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--brand); margin-bottom: 10px; }
.explain span { color: var(--muted); font-size: 14px; }

.auth-icon-ok { color: var(--success); border-color: rgba(62, 207, 142, .45); }

/* ---------- Pied de page ---------- */
.portal-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--subtle); font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; }
.portal-footer .portal-container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.portal-footer a { text-decoration: none; }
.portal-footer a:hover { color: var(--white); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .grid-3, .grid-2, .form-row { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
    .welcome-steps, .explain ol { grid-template-columns: 1fr; }
    .offer-rows, .offer-rows-2 { grid-template-columns: 1fr; }
    .checkout { grid-template-columns: 1fr; }
    .offer-row { border-right: 0; border-bottom: 1px solid var(--line); }
    .offer-row:last-child { border-bottom: 0; }
    .next-step .btn { width: 100%; }
    .portal-header-inner { height: auto; flex-wrap: wrap; padding-top: 14px; gap: 10px 16px; }
    .portal-nav { order: 3; width: calc(100% + 24px); margin: 0 -12px; overflow-x: auto; height: 46px; }
    .portal-logout { margin-left: auto; }
    .logo em { display: none; }
    .quote-paper { padding: 24px; }
    .quote-parties { grid-template-columns: 1fr; }
    .invoice-layout { grid-template-columns: 1fr; }
    .invoice-side { position: static; }
}
@media (max-width: 520px) {
    .portal-container { padding: 0 16px; }
    .grid-4 { grid-template-columns: 1fr; }
    .included { grid-template-columns: 1fr; }
    .card { padding: 20px; }
    .offer-head, .offer-row, .offer-foot, .next-step { padding-left: 18px; padding-right: 18px; }
}

@media print {
    body { background: #fff; }
    .portal-header, .portal-footer, .quote-actions, .no-print, .alert { display: none !important; }
    .portal-main { padding: 0; }
    .quote-paper { padding: 0; border: 0; }
}

/* Demandes : conversation avec WB Web */
.requests-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.conversations { display: grid; gap: 16px; }
.conversation.is-unread { border-color: var(--accent); }
.conversation-status { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.new-reply { padding: 3px 8px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }
.thread { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.msg { max-width: 92%; padding: 10px 12px; border: 1px solid var(--line-strong); }
.msg-client { justify-self: end; }
.msg-admin { justify-self: start; background: var(--surface-2); border-left: 3px solid var(--accent); }
.msg-meta { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.msg-body { white-space: pre-line; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.reply-form { display: grid; gap: 8px; }
.reply-form .btn { justify-self: start; }
@media (max-width: 860px) { .requests-layout { grid-template-columns: 1fr; } }

/* Portefeuille du client (Moyens de paiement) : liste des cartes à gauche, la carte choisie à droite */
.wallet-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -12px 0 20px; overflow-x: auto; }
.wallet-tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.wallet-tabs a:hover { color: var(--text); }
.wallet-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
.wallet { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.wallet-side { display: grid; gap: 16px; }
.wallet-box { background: var(--bg-raised); border: 1px solid var(--line); padding: 20px; }
.wallet-box-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.wallet-box-head h2 { margin: 0; font-size: 16px; }
.wallet-add { color: var(--brand); text-decoration: none; font-size: 14px; white-space: nowrap; }
.wallet-add:hover { text-decoration: underline; }
.wallet-list { list-style: none; margin: 0 -20px -20px; padding: 0; }
.wallet-list li + li { border-top: 1px solid var(--line); }
.wallet-list a { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: var(--text); text-decoration: none; border-left: 2px solid transparent; }
.wallet-list a:hover { background: var(--surface); }
.wallet-list a[aria-current="true"] { background: var(--surface); border-left-color: var(--brand); }
.wallet-item { display: grid; gap: 2px; min-width: 0; flex: 1; font-size: 13px; color: var(--muted); }
.wallet-item strong { color: var(--text); font-size: 14.5px; font-weight: 600; }
.wallet-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-chevron { color: var(--subtle); font-size: 22px; line-height: 1; }
.wallet-card { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.wallet-card h2 { margin: 0 0 4px; font-size: 20px; }
.wallet-card p { margin: 0; }
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.wallet-actions form { margin: 0; }
.wallet-actions .btn { width: 100%; justify-content: center; }
.wallet-prefs { border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: 14px; }
.wallet-prefs h3 { margin: 0 0 10px; font-size: 15px; }
.wallet-toggle { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0; }
.wallet-toggle small { display: block; color: var(--subtle); font-size: 12.5px; margin-top: 2px; }
.switch { flex: none; position: relative; width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2, #1a1a1a); cursor: pointer; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background-color .15s ease; }
.switch[aria-checked="true"] { background: var(--success); border-color: var(--success); cursor: default; }
.switch[aria-checked="true"] span { transform: translateX(20px); background: #fff; }
.switch:disabled { opacity: 1; }

/* La carte bancaire dessinée, aux couleurs de sa marque */
.pay-card { position: relative; flex: none; display: block; width: 58px; height: 38px; border-radius: 5px; overflow: hidden;
    background: linear-gradient(135deg, #3a3d44, #1c1d21); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 2px 6px rgba(0, 0, 0, .35); color: #fff; }
.pay-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0, rgba(255, 255, 255, .16), transparent 55%); }
/* Même vignette pour toutes les cartes : Stripe ne donne pas l'image réelle de la carte, on n'invente pas sa couleur */
.pay-card-expired { opacity: .55; }
.pay-card-contactless { position: absolute; left: 58px; top: 30px; width: 20px; height: 22px; z-index: 1; opacity: .8; }
.pay-card-funding { position: absolute; right: 16px; top: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; opacity: .75; z-index: 1; }
.pay-card-chip { position: absolute; left: 7px; top: 9px; width: 10px; height: 8px; border-radius: 2px; background: linear-gradient(135deg, #e8cf88, #b8953f); }
.brand-logo { position: absolute; right: 6px; bottom: 4px; font: italic 800 10px/1 system-ui, sans-serif; letter-spacing: .02em; z-index: 1; }
.mc-logo { position: absolute; right: 5px; bottom: 5px; display: flex; z-index: 1; }
.mc-logo i { width: 11px; height: 11px; border-radius: 50%; background: #eb001b; }
.mc-logo i + i { margin-left: -5px; background: #f79e1b; opacity: .9; }
.pay-card-large { width: 210px; height: 132px; border-radius: 12px; }
.pay-card-large .pay-card-chip { left: 18px; top: 30px; width: 30px; height: 22px; border-radius: 4px; }
.pay-card-number { position: absolute; left: 18px; top: 66px; font-family: var(--mono); font-size: 13.5px; letter-spacing: .08em; z-index: 1; }
.pay-card-bottom { position: absolute; left: 18px; right: 70px; bottom: 14px; display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; opacity: .85; z-index: 1; }
.pay-card-bottom span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-card-large .brand-logo { right: 16px; bottom: 12px; font-size: 19px; }
.pay-card-large .mc-logo { right: 14px; bottom: 12px; }
.pay-card-large .mc-logo i { width: 26px; height: 26px; }
.pay-card-large .mc-logo i + i { margin-left: -11px; }

.sub-amount { font-size: 26px; font-weight: 600; margin: 0 0 14px; letter-spacing: -0.02em; }
.sub-amount span { font-size: 14px; color: var(--muted); font-weight: 400; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0 0 14px; }
.dl dt { color: var(--subtle); font-family: var(--mono); font-size: 12px; padding-top: 3px; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.warn-text { color: var(--warning); }
.badge-canceled { color: var(--muted); }
@media (max-width: 860px) {
    .wallet { grid-template-columns: 1fr; }
    /* Téléphone : la carte choisie juste sous la liste, l'abonnement après */
    .wallet-side { display: contents; }
    .wallet-side > :first-child { order: 1; }
    .wallet-detail { order: 2; }
    .wallet-side > .sub-summary { order: 3; }
}
.upcoming li strong { white-space: nowrap; }
@media (max-width: 560px) {
    .dl { grid-template-columns: 1fr; gap: 2px; }
    .dl dd { margin-bottom: 10px; }
    .wallet-card { flex-direction: column; align-items: flex-start; }
    .wallet-actions { grid-template-columns: 1fr; }
    .wallet-box { padding: 16px; }
    .wallet-list { margin: 0 -16px -16px; }
    .wallet-list a { padding: 14px 16px; }
}

/* Accueil : l'essentiel, puis les demandes */
.home-summary .card-value { font-size: 1.35rem; }
.home-summary .card-sub .badge { margin-right: 8px; }
.all-set { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: var(--success); font-size: 14px; }
.all-set .icon { width: 16px; height: 16px; }
.home-requests { margin-top: 24px; }
.wallet-card-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; color: var(--muted); font-size: 14px; }
