/* * CARTE BUILDER PRO - STYLE PRINCIPAL
 * Version: 3.9.5 (Fix: List View 6cm & Title Truncation)
 */

/* --- LAYOUT GENERAL --- */
.cb-dashboard-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    box-sizing: border-box;
}

.cb-dashboard-title { 
    font-size: 1.75rem; 
    font-weight: 800; 
    color: #0f172a; 
    margin: 0; 
    letter-spacing: -0.02em; 
}

.cb-cartes-grid { 
    display: grid; 
    gap: 24px; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    margin-top: 20px;
    justify-content: center;
}

/* --- CARTE DESIGN --- */
.cb-carte {
    
    background: #fff; 
    border: 1px solid #e2e8f0; 
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02);
    display: flex; 
    flex-direction: column; 
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative; 
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
}

.cb-carte:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 12px 20px -5px rgba(0,0,0,0.08); 
    border-color: #cbd5e1; 
    z-index: 50;
}

/* Header (Rounded Top) */
.cb-carte-head { 
    padding: 16px 24px; 
    background: #fff; 
    border-bottom: 1px solid #f1f5f9; 
    border-radius: 20px 20px 0 0; 
    min-width: 0; /* Vital pour le flexbox enfant */
}

.cb-head-top { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 12px; 
    align-items: center; 
}

.cb-status-badge { 
    font-size: 0.7rem; 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
}
.st-online { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.st-draft { background: #fff7ed; color: #9a3412; border: 1px solid #ffedd5; }

.cb-scan-badge { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 0.8rem; 
    background: #f8fafc; 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-weight: 600; 
    color: #475569; 
    border: 1px solid #f1f5f9;
}

/* Ligne Titre + Crayon */
.cb-head-title-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 10px; 
    width: 100%;
}

.cb-carte-title { 
    font-weight: 700; 
    color: #1e293b; 
    font-size: 1.15rem; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; /* Les trois petits points */
    flex: 1; /* Prend toute la place dispo */
    min-width: 0; /* Permet au texte de rétrécir en dessous de sa taille naturelle */
}

/* Crayon (Bouton) */
.cb-edit-icon { 
    appearance: none; -webkit-appearance: none;
    background: transparent; border: none; outline: none;
    cursor: pointer; color: #94a3b8; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    transition: background 0.2s; flex-shrink: 0; /* Ne s'écrase jamais */
    width: 44px; height: 44px; padding: 0; position: relative; z-index: 10;
    touch-action: manipulation;
}
.cb-edit-icon:hover, .cb-edit-icon:active { background: #f1f5f9; color: #2563eb; }
.cb-edit-icon svg { pointer-events: none; }

.cb-title-input { 
    width: 100%; padding: 8px 12px; font-size: 16px; border: 2px solid #2563eb; 
    border-radius: 8px; outline: none; box-sizing: border-box; min-height: 44px; 
}

/* Body */
.cb-carte-body { 
    padding: 24px; 
    background: #f8fafc; 
    display: flex; justify-content: center; 
    overflow: hidden; 
}

.cb-phone-mockup { 
    width: 170px; height: 340px; 
    background: #fff; border-radius: 24px; 
    box-shadow: 0 0 0 5px #334155, 0 15px 30px rgba(0,0,0,0.15); 
    overflow: hidden; position: relative; flex-shrink: 0;
}

.cb-iframe-wrapper { 
    width: 378px; height: 756px; 
    transform: scale(0.45); transform-origin: top left; 
    background: #fff; 
}
.cb-iframe-wrapper iframe { width: 100%; height: 100%; border: none; background: #fff; pointer-events: none; }

.cb-placeholder { 
    width: 100%; height: 100%; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; 
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%); 
    padding: 20px; box-sizing: border-box; 
}
.cb-ph-avatar { width: 56px; height: 56px; background: #cbd5e1; border-radius: 50%; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; color: #fff; }
.cb-ph-line { height: 6px; background: #cbd5e1; border-radius: 3px; margin-bottom: 8px; opacity: 0.6; }
.cb-ph-badge { margin-top: 16px; background: #fff; color: #64748b; padding: 4px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* --- FOOTER & BUTTONS --- */
.cb-carte-footer { 
    padding: 16px 24px; 
    background: #fff; 
    border-top: 1px solid #f1f5f9; 
    display: flex; align-items: center; gap: 12px; 
    justify-content: space-between; border-radius: 0 0 20px 20px; 
}

.cb-btn-icon {
    width: 44px; height: 44px; 
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; 
    cursor: pointer; transition: all 0.2s; position: relative; flex-shrink: 0; padding: 0; line-height: 0;
}
.cb-btn-icon:hover { border-color: #cbd5e1; color: #1e293b; background: #f1f5f9; transform: translateY(-2px); }
.cb-btn-icon svg, .cb-btn-action svg { width: 20px !important; height: 20px !important; min-width: 20px !important; min-height: 20px !important; stroke-width: 2 !important; display: block; }

.cb-btn-action {
    flex-grow: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
    text-decoration: none !important; cursor: pointer; border: none;
    background-color: #2563eb; color: #fff !important; 
    transition: all 0.2s; box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}
.cb-btn-action:hover { background-color: #1d4ed8; transform: translateY(-2px); box-shadow: 0 6px 12px -2px rgba(37, 99, 235, 0.3); color: #fff !important; }

/* TOOLTIP & MODAL (Inchangés) */
.cb-tooltip-wrapper { position: relative; display: inline-block; }
.cb-tooltip-wrapper:hover::after { content: attr(data-tooltip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; white-space: nowrap; pointer-events: none; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); z-index: 999; opacity: 0; animation: fadeIn 0.2s forwards; }
.cb-tooltip-wrapper:hover::before { content: ''; position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: #1e293b transparent transparent transparent; opacity: 0; animation: fadeIn 0.2s forwards; z-index: 999; }
@keyframes fadeIn { to { opacity: 1; } }

.cbp-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px); z-index: 999999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s; }
.cbp-modal-overlay.is-visible { opacity: 1; visibility: visible; }
.cbp-modal-content { background: #fff; width: 90%; max-width: 420px; border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); overflow: hidden; transform: scale(0.95); transition: transform 0.2s; }
.cbp-modal-overlay.is-visible .cbp-modal-content { transform: scale(1); }
.cbp-modal-header { padding: 16px 24px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.cbp-modal-header h3 { margin: 0; font-size: 1.1rem; color: #334155; }
.cbp-close-btn { background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: #94a3b8; padding: 0; }
.cbp-modal-body { padding: 24px; text-align: center; }
.cbp-modal-desc { color: #64748b; font-size: 0.95rem; margin-bottom: 24px; line-height: 1.5; }
.cbp-pin-wrapper { background: #f1f5f9; padding: 16px; border-radius: 12px; margin-bottom: 24px; border: 2px dashed #cbd5e1; }
.cbp-pin-code { font-family: monospace; font-size: 2rem; font-weight: 800; color: #0f172a; letter-spacing: 6px; }
.cbp-label { display: block; font-size: 0.75rem; text-transform: uppercase; color: #64748b; margin-bottom: 8px; font-weight: 700; letter-spacing: 0.05em; }
.cbp-input-group { display: flex; gap: 8px; }
.cbp-input-group input { flex: 1; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; color: #475569; font-size: 0.9rem; outline: none; }
.cbp-input-group input:focus { border-color: #2563eb; background: #fff; }
.cbp-btn-copy { background: #2563eb; color: #fff; border: none; padding: 0 16px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.cbp-btn-copy:hover { background: #1d4ed8; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 600px) {
    .cb-dashboard-title { font-size: 1.5rem; text-align: center; margin-bottom: 10px; }
    .cb-cartes-grid { display: flex; flex-direction: column; align-items: center; grid-template-columns: unset; width: 100%; }
    .cb-carte { width: 100%; max-width: 380px; }
    .cbp-modal-overlay { align-items: center; } 
    .cbp-modal-content { width: 90%; border-radius: 20px; max-width: 100%; }
    .cb-btn-action { width: 100%; }
}

/* ======================================================
   PATCH SPECIFIQUE : VUE LISTE (1 COLONNE) SUR DESKTOP
   ====================================================== */
@media (min-width: 768px) {
    
    /* 1. Configuration de la Grille en Liste */
    .cb-cartes-grid.cb-grid-1 {
        grid-template-columns: 1fr !important; /* Force 1 colonne */
        max-width: 900px;
        margin: 0 auto;
    }

    /* 2. Layout Horizontal de la Carte */
    .cb-cartes-grid.cb-grid-1 .cb-carte {
        display: grid !important; 
        /* LE POINT CLÉ POUR LE NOM (...) : minmax(0, 1fr) */
        /* Cela permet à la colonne de droite de rétrécir pour forcer les points de suspension */
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "body head" "body footer";
        width: 100%; max-width: 100% !important;
        flex-direction: row; /* Fallback */
        align-items: stretch;
    }

    /* 3. Zone Prévisualisation (Gauche) */
    .cb-cartes-grid.cb-grid-1 .cb-carte-body {
        grid-area: body;
        width: 160px !important; /* Espace suffisant pour la carte de 114px */
        padding: 10px !important; /* Padding réduit */
        border-right: 1px solid #f1f5f9;
        display: flex !important; justify-content: center; align-items: center;
    }

    /* 4. MOCKUP 6 CM DE HAUT (227px) - Zoom 0.3 */
    .cb-cartes-grid.cb-grid-1 .cb-phone-mockup {
        width: 114px !important;  /* 378 * 0.3 */
        height: 227px !important; /* 756 * 0.3 (Env. 6cm) */
        box-shadow: 0 0 0 4px #334155, 0 8px 16px rgba(0,0,0,0.15) !important;
        border-radius: 12px !important;
    }

    .cb-cartes-grid.cb-grid-1 .cb-iframe-wrapper {
        display: block !important;
        transform: scale(0.3) !important; /* Facteur de zoom critique */
    }

    /* 5. Zone Contenu (Droite) */
    .cb-cartes-grid.cb-grid-1 .cb-carte-head {
        grid-area: head;
        border-bottom: none !important;
        padding: 20px 30px 5px 30px !important; /* Espaces réduits verticalement */
        display: flex; flex-direction: column; justify-content: center;
        min-width: 0; /* Sécurité flexbox */
    }

    .cb-cartes-grid.cb-grid-1 .cb-carte-footer {
        grid-area: footer;
        border-top: none !important; 
        padding: 5px 30px 20px 30px !important; /* Espaces réduits verticalement */
        display: flex; 
        align-items: center !important; 
        justify-content: flex-start !important;
        gap: 15px;
    }
    
    .cb-cartes-grid.cb-grid-1 .cb-btn-action {
        max-width: 300px !important;
        margin: 0 !important;
    }
}




/* ================================================================================================
   PAGE DE RÉCUPÉRATION (CLAIM / TRANSFERT)
   ========================================= */

/* =========================================
   STYLE PREMIUM & IMPACTANT (Bleu Royal)
   ========================================= */

body.cbp-premium-body {
    /* Fond dégradé riche et coloré pour éviter l'effet "fade" */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.cbp-premium-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    /* Grosse ombre pour détacher la carte du fond */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Petite barre colorée en haut de la carte pour le style */
.cbp-premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
}

.cbp-premium-icon {
    background-color: #eff6ff;
    color: #2563eb;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.cbp-premium-title {
    margin: 0;
    font-size: 26px;
    color: #1e293b;
    font-weight: 800;
}

.cbp-premium-subtitle {
    margin-top: 10px;
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

/* Zone d'erreur */
.cbp-premium-error {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #fecaca;
}

.cbp-premium-form {
    margin-top: 30px;
}

.cbp-input-wrapper {
    margin-bottom: 20px;
}

.cbp-premium-input {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    box-sizing: border-box;
    letter-spacing: 2px; /* Espacer les chiffres pour la clarté */
}

.cbp-premium-input:focus {
    border-color: #2563eb;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.cbp-premium-btn {
    width: 100%;
    padding: 16px;
    /* Dégradé Vert moderne */
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 50px; /* Bords très arrondis (Pill shape) */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); /* Halo lumineux vert */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cbp-premium-btn:hover {
    transform: translateY(-2px); /* Le bouton monte un peu */
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.cbp-premium-btn:active {
    transform: scale(0.98);
}

.cbp-premium-footer {
    margin-top: 30px;
    color: #94a3b8;
    font-size: 13px;
}