/* Carte de fidélité (lib/loyalty.php) : carte et tampons (espace client, aperçu de la gestion), boutons officiels
   Apple Wallet et Google Wallet, écrans Gestion › Fidélité.
   La carte garde le noir bleuté de la marque en clair comme en sombre : c'est un objet de la marque (comme la carte
   rangée dans Wallet), pas une surface de l'interface. Texte blanc 17,9:1, orange de la marque 7,6:1 sur ce fond. */

.loy-card {
    --loy-ink: #09161f;
    --loy-accent: #f38d29;
    position: relative; overflow: hidden;
    background: var(--loy-ink); color: #fff;
    border-radius: var(--radius-lg); padding: 18px 20px 20px;
    box-shadow: var(--shadow-card);
    isolation: isolate;
}
/* Fond : un seul halo discret de l'orange de la marque, derrière le contenu */
.loy-card::before {
    content: ""; position: absolute; z-index: -1; right: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--loy-accent) 22%, transparent), transparent);
}
@media (prefers-color-scheme: dark) { .loy-card { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); } }

.loy-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loy-card__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.loy-card__brand > span { display: flex; flex-direction: column; min-width: 0; }
.loy-card__mark { flex: none; display: block; }
.loy-card__org { font: var(--t-headline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loy-card__kind { font: var(--t-foot); color: rgba(255, 255, 255, .72); }
.loy-card__count { font: 700 28px/1 var(--font); flex: none; }
.loy-card__count span { font: 600 17px/1 var(--font); color: rgba(255, 255, 255, .72); }

.loy-stamps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
/* Une rangée jusqu'à 6 tampons, deux rangées au-delà (7-8 : 4 par rangée, 9-10 : 5) */
.loy-stamps--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.loy-stamps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loy-stamps--4, .loy-stamps--7, .loy-stamps--8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.loy-stamps--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.loy-stamp {
    aspect-ratio: 1; max-width: 56px; width: 100%; justify-self: center; border-radius: 50%;
    display: grid; place-items: center;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .34);
    color: rgba(255, 255, 255, .62); font: 600 15px/1 var(--font); font-variant-numeric: tabular-nums;
}
.loy-stamp.is-on { background: var(--loy-accent); box-shadow: none; color: var(--loy-ink); }
.loy-stamp .icon { width: 55%; height: 55%; stroke-width: 3; }

.loy-card__line { margin: 16px 0 0; font: var(--t-callout); font-weight: 600; text-wrap: pretty; }
.loy-card--ready .loy-card__line { color: var(--loy-accent); }
.loy-card__name { margin: 4px 0 0; font: var(--t-foot); color: rgba(255, 255, 255, .72); }

.loy__ready { margin-top: 12px; }

/* Boutons officiels : jamais modifiés (ni filtre ni effet au survol) ; hauteur 52 px (au moins celle des autres boutons
   de l'espace client, 50 px), 8 px de marge libre au moins autour de chacun */
.loy-wallets { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 16px 0 0; padding: 8px 0; }
.loy-wallet { display: inline-flex; border-radius: 24px; padding: 0; line-height: 0; }
.loy-wallet img { height: 52px; width: auto; max-width: 100%; display: block; }
.loy-wallet:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }

/* ---------- Gestion ---------- */
.loy-admin .loy-card { margin: 0; }
.loy-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 var(--header-gap); }
.loy-head .section__title { margin-bottom: 0; }
.loy-head .seg { flex: none; }
.loy-head .seg > * { flex: 1 0 auto; }
.loy-date { max-width: 11em; }
.loy-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.loy-state .dot { width: 10px; height: 10px; }
.loy-state--ok .dot { color: var(--green); }
.loy-state--late .dot { color: var(--orange); }
.loy-state--off .dot { color: var(--gray); }
.loy-oneline { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loy-break { overflow-wrap: anywhere; }
.loy-mini { display: inline-flex; gap: 3px; }
.loy-mini i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--label-3); }
.loy-mini i.is-on { background: var(--brand-accent, #f38d29); box-shadow: none; }
.loy-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.loy-error { margin-top: 12px; }
.loy-reward form { flex: none; }
.loy-file input[type=file] { font: var(--t-sub); color: var(--label-2); max-width: 55%; min-height: 44px; }
.loy-file input[type=file]::file-selector-button { font: inherit; color: var(--brand-text); background: var(--fill-2); border: 0; border-radius: var(--radius-sm); padding: 8px 12px; margin-right: 8px; cursor: pointer; min-height: 36px; }
.loy-badge-preview { height: 32px; width: auto; display: block; }

.loy-steps { margin: 0; padding: 4px 16px 4px 40px; }
.loy-steps li { padding: 10px 0; font: var(--t-sub); color: var(--label); }
.loy-steps li + li { border-top: var(--hairline) solid var(--separator); }
.loy-steps li::marker { font-weight: 600; color: var(--brand-text); }
.loy-code { display: block; margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--fill); font: 13px/18px var(--font-mono); overflow-wrap: anywhere; color: var(--label); }

@media (max-width: 480px) {
    .loy-head { flex-direction: column; align-items: stretch; }
    .loy-head .seg { width: 100%; }
    .loy-head .seg > * { flex: 1 1 0; }
    .loy-actions .btn { width: 100%; }
    .loy-file { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 10px; padding-bottom: 10px; }
    .loy-file input[type=file] { max-width: none; }
}
