/* ==========================================================
   Bylike — Portefeuille (thème clair, autonome)
   ========================================================== */

body:has(.bw-wallet) {
    background-color: #f5f6fa;
    color: #11151c;
    min-height: 100vh;
}

.bw-wallet {
    --bw-surface: #ffffff;
    --bw-line: #e8ebf2;
    --bw-text: #11151c;
    --bw-muted: #6b7488;
    --bw-blue: #3b6cf0;
    --bw-blue-deep: #1f3fa8;
    --bw-blue-soft: #eef3ff;
    --bw-green: #12915a;
    --bw-green-soft: #e6f6ee;
    --bw-amber: #b7791f;
    --bw-amber-soft: #fdf3df;

    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
    color: var(--bw-text);
    font-feature-settings: "tnum" 1;
}

.bw-wallet *,
.bw-wallet *::before,
.bw-wallet *::after { box-sizing: border-box; }

.bw-wallet p,
.bw-wallet h2,
.bw-wallet ul { margin: 0; }

/* ---------- Carte solde ---------- */

.bw-hero {
    position: relative;
    overflow: hidden;
    padding: 1.75rem 1.5rem 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #1b2b66 0%, #2c4fc4 55%, #4b7bff 100%);
    border-radius: 24px;
    box-shadow: 0 20px 40px -18px rgba(44, 79, 196, 0.55);
}

.bw-hero::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 22rem;
    height: 22rem;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.22), transparent);
    pointer-events: none;
}

.bw-hero > * { position: relative; }

.bw-hero__label {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.bw-hero__value {
    margin-top: 0.5rem;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.bw-hero__value span {
    margin-left: 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.75);
}

.bw-progress {
    height: 8px;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.bw-progress > i {
    display: block;
    height: 100%;
    min-width: 6px;
    background: #fff;
    border-radius: 999px;
    transition: width 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bw-hero__foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
}

.bw-hero__note {
    margin-top: 1.1rem;
    padding-top: 1rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

/* ---------- Sections ---------- */

.bw-section { margin-top: 2rem; }

.bw-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0.25rem 0.75rem;
}

.bw-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ---------- Listes ---------- */

.bw-list {
    list-style: none;
    padding: 0;
    background: var(--bw-surface);
    border: 1px solid var(--bw-line);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(17, 21, 28, 0.04), 0 8px 24px -16px rgba(17, 21, 28, 0.12);
    overflow: hidden;
}

.bw-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    transition: background-color 150ms ease;
}

.bw-row + .bw-row { border-top: 1px solid var(--bw-line); }
.bw-row:hover { background: #fafbfe; }

.bw-row__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
}

.bw-row__title {
    max-width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bw-row__meta { font-size: 0.75rem; color: var(--bw-muted); }

.bw-cap { text-transform: capitalize; }

/* ---------- Pastille A / B ---------- */

.bw-choice {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 12px;
}

.bw-choice--a { color: var(--bw-blue); background: var(--bw-blue-soft); }
.bw-choice--b { color: #7a4ee0; background: #f1ebff; }

/* ---------- Icône transaction ---------- */

.bw-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
}

.bw-icon svg { width: 1.1rem; height: 1.1rem; }
.bw-icon--in  { color: var(--bw-green); background: var(--bw-green-soft); }
.bw-icon--out { color: var(--bw-amber); background: var(--bw-amber-soft); }

/* ---------- Montants ---------- */

.bw-amount {
    flex: none;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.bw-amount--in   { color: var(--bw-green); }
.bw-amount--out  { color: var(--bw-amber); }
.bw-amount--none { color: #b4bccb; font-weight: 500; }

/* ---------- Statut ---------- */

.bw-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.bw-status::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: currentColor;
}

.bw-status--ok   { color: var(--bw-green); }
.bw-status--wait { color: var(--bw-amber); }

/* ---------- État vide ---------- */

.bw-empty {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--bw-muted);
}

/* ---------- Mobile / accessibilité ---------- */

@media (max-width: 480px) {
    .bw-hero { padding: 1.4rem 1.15rem 1.25rem; border-radius: 20px; }
    .bw-hero__value { font-size: 2.5rem; }
    .bw-row { padding: 0.8rem 0.9rem; gap: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .bw-row, .bw-progress > i { transition: none; }
}