/* LoyaltyHub — front-widget.css
   Widget flottant (widget.tpl, hookDisplayFooter).
   Genere depuis front.css — ne pas editer a la main. */
.lh-floating {
    --lh-brand: #6366f1;
    --lh-brand-soft: color-mix(in srgb, var(--lh-brand) 12%, white);
    --lh-fg: #0f172a;
    --lh-fg-muted: #64748b;
    --lh-bg: #ffffff;
    --lh-surface: #f8fafc;
    --lh-border: #e2e8f0;
    --lh-shadow: 0 24px 60px -15px rgba(15, 23, 42, 0.25), 0 12px 24px -12px rgba(15, 23, 42, 0.15);
    --lh-radius: 18px;
    --lh-radius-sm: 12px;

    position: fixed;
    inset: auto 20px 20px auto;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--lh-fg);
    line-height: 1.4;
}
.lh-fab {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--lh-brand) 0%, color-mix(in srgb, var(--lh-brand) 70%, #000) 100%);
    color: #fff;
    box-shadow: var(--lh-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease;
    padding: 0;
}
.lh-fab:hover { transform: scale(1.06); }
.lh-fab:active { transform: scale(0.96); }
.lh-fab:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--lh-brand) 50%, white);
    outline-offset: 3px;
}
.lh-fab__icon {
    display: inline-flex;
    width: 26px;
    height: 26px;
}
.lh-fab__icon svg { width: 100%; height: 100%; }
.lh-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f43f5e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.4);
    border: 2px solid #fff;
    line-height: 1;
}
.lh-floating.is-open .lh-fab {
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
}
.lh-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 240ms ease;
    z-index: 99989;
}
.lh-floating.is-open .lh-backdrop { opacity: 1; }
.lh-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    background: var(--lh-bg);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.9) translateY(8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease;
    z-index: 99991;
}
.lh-floating.is-open .lh-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.lh-panel[hidden] { display: flex; }
.lh-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--lh-brand) 0%, color-mix(in srgb, var(--lh-brand) 75%, #000) 100%);
    color: #fff;
    flex-shrink: 0;
}
.lh-panel__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.lh-panel__brand-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.lh-panel__brand-icon svg { width: 100%; height: 100%; }
.lh-panel__title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0;
}
.lh-panel__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease;
    padding: 0;
}
.lh-panel__close:hover { background: rgba(255, 255, 255, 0.28); }
.lh-panel__close svg { width: 16px; height: 16px; }
.lh-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.lh-panel__body::-webkit-scrollbar { width: 8px; }
.lh-panel__body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
.lh-balance {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--lh-brand-soft);
    border-radius: var(--lh-radius-sm);
}
.lh-balance__main { display: flex; flex-direction: column; min-width: 0; }
.lh-balance__value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: var(--lh-brand);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.lh-balance__label {
    font-size: 12px;
    color: var(--lh-fg-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.lh-balance__meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.lh-balance__meta-label {
    font-size: 11px;
    color: var(--lh-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.lh-balance__meta-value {
    font-size: 16px;
    color: var(--lh-fg);
    font-variant-numeric: tabular-nums;
}
.lh-tier__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.lh-tier__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--lh-surface);
    border: 1px solid var(--lh-border);
    border-radius: 999px;
    padding: 4px 10px 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--lh-fg);
}
.lh-tier__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lh-tier-color, var(--lh-brand));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lh-tier-color, var(--lh-brand)) 20%, transparent);
}
.lh-tier__hint {
    font-size: 11px;
    color: var(--lh-fg-muted);
}
.lh-tier__hint strong { color: var(--lh-fg); font-weight: 700; }
.lh-tier__bar {
    height: 6px;
    background: var(--lh-surface);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.lh-tier__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lh-tier-color, var(--lh-brand)), color-mix(in srgb, var(--lh-tier-color, var(--lh-brand)) 70%, var(--lh-brand)));
    border-radius: 999px;
    transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lh-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: var(--lh-surface);
    border-radius: var(--lh-radius-sm);
    padding: 4px;
}
.lh-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: var(--lh-fg-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    font-size: 11px;
    font-weight: 600;
}
.lh-tab svg { width: 18px; height: 18px; }
.lh-tab:hover { color: var(--lh-fg); }
.lh-tab.is-active {
    background: #fff;
    color: var(--lh-brand);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.lh-tab-panel { display: none; }
.lh-tab-panel.is-active { display: block; }
.lh-tab-panel[hidden] { display: none; }
.lh-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lh-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-sm);
    background: #fff;
    transition: border-color 150ms ease, transform 150ms ease;
}
.lh-list__item:hover { border-color: var(--lh-brand); }
.lh-list__item.is-locked { opacity: 0.6; }
.lh-list__icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--lh-brand-soft);
    color: var(--lh-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lh-list__icon svg { width: 18px; height: 18px; }
.lh-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lh-list__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--lh-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.lh-list__sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.lh-list__locked {
    font-size: 10px;
    color: #b91c1c;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lh-list__item.is-done { background: rgba(16, 185, 129, 0.04); border-color: rgba(16, 185, 129, 0.18); }
.lh-list__item.is-done .lh-list__icon { background: rgba(16, 185, 129, 0.12); color: #047857; }
.lh-list__item.is-done .lh-list__title { color: var(--lh-fg-muted); }
.lh-list__cta {
    flex-shrink: 0;
    border: none;
    background: var(--lh-brand);
    color: #fff;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, transform 100ms ease;
    white-space: nowrap;
}
.lh-list__cta:hover:not(:disabled) {
    background: color-mix(in srgb, var(--lh-brand) 85%, #000);
}
.lh-list__cta:active:not(:disabled) { transform: scale(0.96); }
.lh-list__cta:disabled { opacity: 0.5; cursor: not-allowed; }
.lh-list__cta--alt { background: var(--lh-fg); }
.lh-list__cta--alt:hover:not(:disabled) {
    background: color-mix(in srgb, var(--lh-fg) 85%, #000);
}
.lh-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 12px;
    color: var(--lh-fg-muted);
    gap: 10px;
}
.lh-empty svg { width: 36px; height: 36px; opacity: 0.5; }
.lh-empty p { margin: 0; font-size: 13px; }
.lh-referral { display: flex; flex-direction: column; gap: 12px; }
.lh-referral__intro {
    font-size: 13px;
    color: var(--lh-fg);
    margin: 0;
    line-height: 1.5;
}
.lh-referral__intro strong { color: var(--lh-brand); font-weight: 700; }
.lh-referral__row {
    display: flex;
    gap: 6px;
    background: var(--lh-surface);
    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-sm);
    padding: 4px;
}
.lh-referral__input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--lh-fg);
    outline: none;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}
.lh-referral__copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: var(--lh-brand);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease;
    flex-shrink: 0;
}
.lh-referral__copy:hover { background: color-mix(in srgb, var(--lh-brand) 85%, #000); }
.lh-referral__copy svg { width: 14px; height: 14px; }
.lh-referral__copy.is-copied { background: #10b981; }
.lh-referral__hint { font-size: 11px; color: var(--lh-fg-muted); margin: 0; }
.lh-panel__footer {
    flex-shrink: 0;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--lh-border);
    background: var(--lh-bg);
}
.lh-panel__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--lh-fg);
    color: #fff !important;
    border-radius: var(--lh-radius-sm);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: background 150ms ease, transform 100ms ease;
    border: none;
    cursor: pointer;
}
.lh-panel__cta:hover,
.lh-panel__cta:focus,
.lh-panel__cta:visited {
    background: color-mix(in srgb, var(--lh-fg) 85%, #000);
    color: #fff !important;
    text-decoration: none !important;
}
.lh-panel__cta:active { transform: scale(0.98); }
.lh-panel__cta svg { width: 16px; height: 16px; transition: transform 200ms ease; }
.lh-panel__cta:hover svg { transform: translateX(2px); }
.lh-panel__body--guest {
    display: flex;
    align-items: center;
    justify-content: center;
}
.lh-guest {
    text-align: center;
    padding: 16px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lh-guest__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--lh-brand-soft);
    color: var(--lh-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lh-guest__icon svg { width: 28px; height: 28px; }
.lh-guest__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--lh-fg);
    margin: 0;
    letter-spacing: -0.01em;
}
.lh-guest__text {
    font-size: 13px;
    color: var(--lh-fg-muted);
    margin: 0;
    max-width: 280px;
    line-height: 1.5;
}
.lh-list__item.is-redeemed {
    flex-wrap: wrap;
}
.lh-referral__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0 8px;
}
.lh-referral__list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.lh-referral__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 13px;
}
.lh-referral__item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.lh-referral__item-name {
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lh-referral__item-date {
    font-size: 11px;
    color: #64748b;
}
.lh-referral__item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.lh-referral__item-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}
.lh-referral__item-status.is-success {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}
.lh-referral__item-status.is-progress {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}
.lh-referral__item-status.is-rejected {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}
.lh-referral__item-points {
    font-size: 12px;
    font-weight: 700;
    color: #047857;
}
.lh-referral__more {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    text-decoration: underline;
    color: var(--lh-brand, #6366f1);
}
.lh-list__item.is-oos {
    opacity: 0.7;
    filter: saturate(0.7);
}
.lh-list__item.is-oos:hover {
    
    border-color: var(--lh-border);
}
.lh-list__locked--oos {
    background: rgba(100, 116, 139, 0.14) !important;
    color: #475569 !important;
    font-weight: 600;
    
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
}
.lh-list__medal {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: radial-gradient(
        circle at 30% 28%,
        color-mix(in srgb, var(--lh-medal-color, #6366f1) 25%, white) 0%,
        var(--lh-medal-color, #6366f1) 55%,
        color-mix(in srgb, var(--lh-medal-color, #6366f1) 70%, black 30%) 100%
    );
    background-color: var(--lh-medal-color, #6366f1);
    box-shadow:
        0 3px 8px rgba(0,0,0,0.15),
        inset 0 1px 1px rgba(255,255,255,0.5);
}
.lh-list__medal svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
.lh-list__medal.is-locked {
    background: #e2e8f0;
    color: var(--lh-medal-color, #6366f1);
    border: 2px dashed color-mix(in srgb, var(--lh-medal-color, #6366f1) 50%, #94a3b8);
    box-shadow: none;
}
.lh-list__medal.is-locked svg { opacity: 0.65; }
.lh-list__locked--tier {
    background: color-mix(in srgb, var(--lh-medal-color, #6366f1) 14%, transparent) !important;
    color: var(--lh-medal-color, #6366f1) !important;
    font-weight: 600;
    
    background-color: rgba(99, 102, 241, 0.14);
}
.lh-list__item.is-tier-locked {
    
    opacity: 0.82;
}
.lh-pill--counter {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    font-variant-numeric: tabular-nums;
}
.lh-pill--counter svg { width: 11px; height: 11px; }

@supports not (background: color-mix(in srgb, red 10%, white)) {
.lh-floating { --lh-brand-soft: rgba(99, 102, 241, 0.12); }
}

@media (max-width: 480px) {
.lh-floating { inset: auto 16px 16px auto; }
.lh-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        border-radius: var(--lh-radius) var(--lh-radius) 0 0;
        transform: translateY(100%);
        transform-origin: bottom center;
    }
.lh-floating.is-open .lh-panel { transform: translateY(0); }
.lh-panel__body { padding: 16px; }
.lh-balance__value { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
.lh-fab,
    .lh-panel,
    .lh-tier__bar-fill,
    .lh-list__item,
    .lh-list__cta,
    .lh-panel__cta,
    .lh-backdrop {
        transition: none !important;
    }
}
