/* ── FIX CRITIQUE : position relative sur dir-cover ──
   Sans ce fix, le bouton absolu sort du cover */
.dir-cover { position: relative !important; overflow: hidden !important; }
.dir-body  { position: relative !important; }

/* ══════════════════════════════════════════
   DIS+ Universal Wallet (DUW)
   IMPORTANT: Ne redéfinit AUCUNE classe dir-*
   Uniquement les classes wallet et duw
════════════════════════════════════════════ */

/* ── Bouton favori universel ── */
.wallet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.95);
    color: #bbb;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    z-index: 10;
}
.wallet-btn:hover {
    background: #fff;
    color: #e74c3c;
    transform: scale(1.1);
}
.wallet-btn-active {
    background: #fff0f0 !important;
    color: #e74c3c !important;
}
.wallet-btn-active svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* ── Position du bouton sur les thumbnails annuaire ── */
.dir-wallet-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
}

/* ── Position du bouton sur la vCard ── */
.wallet-btn-vcard {
    width: 44px;
    height: 44px;
}

/* ── Compteur wallet navbar ── */
.duw-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Toast ── */
.wallet-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    pointer-events: none;
}
.wallet-toast a {
    pointer-events: auto;
    color: #ffd700;
    text-decoration: none;
    font-weight: 700;
    margin-left: 8px;
}
.wallet-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Modal limite atteinte ── */
.wallet-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99998;
}
.wallet-modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    background: #fff;
    border-radius: 24px;
    padding: 32px 24px;
    width: calc(100% - 48px);
    max-width: 360px;
    z-index: 99999;
    text-align: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.wallet-modal-show {
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
}
.wallet-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}
.wallet-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}
.wallet-modal-text {
    font-size: 14px;
    color: #777;
    line-height: 1.6;
    margin: 0 0 24px;
}
.wallet-modal-actions {
    display: flex;
    gap: 10px;
}
.wallet-modal-btn-ghost {
    flex: 1;
    padding: 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.wallet-modal-btn-ghost:hover { border-color: #8B0000; color: #8B0000; }
.wallet-modal-btn-primary {
    flex: 1;
    padding: 12px;
    border-radius: 50px;
    background: linear-gradient(135deg, #8B0000, #c0392b);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: transform 0.15s;
}
.wallet-modal-btn-primary:hover { transform: scale(1.03); color: #fff; }

/* ══════════════════════════════════════════
   PAGE DIS+ UNIVERSAL WALLET (DUW)
   Design indépendant — ne touche pas l'annuaire
════════════════════════════════════════════ */

/* Layout page */
.duw-page {
    background: #f2f2f7;
    min-height: 100vh;
    font-family: 'Poppins', -apple-system, sans-serif;
}

/* Header */
.duw-header {
    background: linear-gradient(135deg, #6B0000 0%, #8B0000 50%, #a00000 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(139,0,0,0.4);
}
.duw-header-inner {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
}
.duw-back-btn {
    color: rgba(255,255,255,0.8);
    font-size: 24px;
    text-decoration: none;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}
.duw-back-btn:hover { color: #fff; }
.duw-header-logo {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.duw-header-logo span {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
    display: block;
    letter-spacing: 0.5px;
    line-height: 1;
}
.duw-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.duw-header-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}
.duw-header-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }
.duw-header-btn.primary {
    background: #fff;
    color: #8B0000;
    border-color: #fff;
}
.duw-header-btn.primary:hover { background: #f5f5f5; }

/* Stats bar */
.duw-stats-bar {
    background: rgba(0,0,0,0.2);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.duw-stats-text { font-size: 12px; color: rgba(255,255,255,0.8); }
.duw-stats-pill {
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.duw-stats-pill.warning { background: #e67e22; }

/* Body */
.duw-body { padding: 16px; }

/* CTA créer compte */
.duw-cta {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 4px solid #8B0000;
}
.duw-cta-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B0000, #c0392b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}
.duw-cta-body { flex: 1; }
.duw-cta-title { font-size: 13px; font-weight: 700; color: #1a1a1a; margin: 0 0 2px; }
.duw-cta-sub { font-size: 11px; color: #888; margin: 0; line-height: 1.4; }
.duw-cta-action {
    background: linear-gradient(135deg, #8B0000, #c0392b);
    color: #fff;
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    transition: transform 0.15s;
}
.duw-cta-action:hover { transform: scale(1.05); color: #fff; }

/* Section titre */
.duw-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 10px;
    padding: 0 2px;
}

/* Grille contacts — compact */
.duw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (min-width: 600px)  { .duw-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px)  { .duw-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1200px) { .duw-grid { grid-template-columns: repeat(6, 1fr); } }

/* Card contact compact */
.duw-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px 10px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}
.duw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,0,0,0.12);
}
.duw-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-bottom: 8px;
    flex-shrink: 0;
}
.duw-card-name {
    font-size: 11px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.duw-card-sub {
    font-size: 10px;
    color: #aaa;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.duw-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.06);
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
    padding: 0;
}
.duw-remove-btn:hover { background: #ffe0e0; color: #e74c3c; }

/* Bouton demande carte */
.duw-request-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #6B0000, #8B0000, #a00000);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(139,0,0,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
    letter-spacing: 0.2px;
}
.duw-request-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(139,0,0,0.45);
    color: #fff;
}

/* Bouton explorer annuaire */
.duw-explore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background: #fff;
    color: #8B0000;
    border: 2px solid #8B0000;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 10px;
}
.duw-explore-btn:hover { background: #8B0000; color: #fff; }

/* Empty state */
.duw-empty {
    text-align: center;
    padding: 48px 24px;
}
.duw-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff0f0, #ffe0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(139,0,0,0.15);
}
.duw-empty-title { font-size: 18px; font-weight: 700; color: #2c2c2c; margin: 0 0 8px; }
.duw-empty-sub { font-size: 14px; color: #888; line-height: 1.6; margin: 0 0 28px; max-width: 280px; margin-left: auto; margin-right: auto; }

/* Modals */
.duw-modal { display: none; position: fixed; inset: 0; z-index: 9999; }
.duw-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.duw-sheet {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 8px 20px 32px;
    max-height: 92vh;
    overflow-y: auto;
}
.duw-sheet-handle {
    width: 40px; height: 4px;
    background: #e0e0e0; border-radius: 2px;
    margin: 12px auto 20px;
}
.duw-sheet-title { font-size: 18px; font-weight: 700; color: #1a1a1a; margin: 0 0 4px; }
.duw-sheet-sub { font-size: 13px; color: #888; margin: 0 0 20px; }

/* Inputs */
.duw-field { margin-bottom: 14px; }
.duw-label { font-size: 12px; font-weight: 600; color: #555; display: block; margin-bottom: 5px; }
.duw-input {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid #e8e8e8; border-radius: 12px;
    font-size: 14px; font-family: inherit;
    outline: none; transition: border-color 0.2s;
    box-sizing: border-box; background: #fafafa;
}
.duw-input:focus { border-color: #8B0000; background: #fff; }
.duw-submit {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #8B0000, #c0392b);
    color: #fff; border: none; border-radius: 50px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: transform 0.15s;
    margin-top: 4px;
}
.duw-submit:hover { transform: scale(1.02); }
.duw-note { font-size: 11px; color: #bbb; line-height: 1.5; margin: 0 0 14px; }

/* Auth tabs */
.duw-auth-tabs {
    display: flex; background: #f5f5f5;
    border-radius: 12px; padding: 3px;
    margin-bottom: 20px;
}
.duw-auth-tab {
    flex: 1; padding: 9px; text-align: center;
    font-size: 13px; font-weight: 600;
    border-radius: 10px; cursor: pointer;
    color: #888; border: none; background: none;
    font-family: inherit; transition: all 0.2s;
}
.duw-auth-tab.active { background: #fff; color: #8B0000; box-shadow: 0 1px 6px rgba(0,0,0,0.1); }
.duw-auth-step { display: none; }
.duw-auth-step.active { display: block; }

/* OTP & PIN inputs */
.duw-code-row { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.duw-code-input {
    width: 44px; height: 52px;
    border: 1.5px solid #e0e0e0; border-radius: 12px;
    font-size: 22px; font-weight: 700;
    text-align: center; outline: none;
    transition: border-color 0.2s; font-family: inherit;
    -webkit-text-security: none;
}
.duw-code-input.pin { -webkit-text-security: disc; }
.duw-code-input:focus { border-color: #8B0000; box-shadow: 0 0 0 3px rgba(139,0,0,0.1); }
.duw-phone-row { display: flex; gap: 8px; margin-bottom: 12px; }
.duw-country-sel {
    width: 110px; padding: 11px 8px;
    border: 1.5px solid #e8e8e8; border-radius: 12px;
    font-size: 13px; background: #fafafa;
    outline: none; font-family: inherit;
}
.duw-country-sel:focus { border-color: #8B0000; }
.duw-phone-inp {
    flex: 1; padding: 11px 14px;
    border: 1.5px solid #e8e8e8; border-radius: 12px;
    font-size: 14px; outline: none; font-family: inherit;
    background: #fafafa;
}
.duw-phone-inp:focus { border-color: #8B0000; background: #fff; }
.duw-msg { font-size: 12px; text-align: center; margin: 6px 0; min-height: 16px; }
.duw-msg.error { color: #e74c3c; }
.duw-msg.success { color: #27ae60; }
.duw-auth-logo {
    text-align: center; margin-bottom: 4px;
    font-size: 26px; font-weight: 800; color: #8B0000; letter-spacing: -1px;
}
.duw-auth-tagline { text-align: center; font-size: 12px; color: #aaa; margin-bottom: 20px; }
