@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── OVERLAY ── */
#afdiagd-popup-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,0.65);
    z-index:999999; display:flex; align-items:center; justify-content:center;
    padding:15px; backdrop-filter:blur(3px); animation:afdiagdFadeIn 0.2s ease;
}
@keyframes afdiagdFadeIn  { from{opacity:0} to{opacity:1} }
@keyframes afdiagdSlideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }
@keyframes afdiagdBounce  { 0%{transform:scale(.5);opacity:0} 70%{transform:scale(1.15)} 100%{transform:scale(1);opacity:1} }

/* ── BOÎTE POPUP ── */
#afdiagd-popup-box {
    background:#fff; border-radius:16px; width:100%; max-width:560px;
    max-height:90vh; overflow-y:auto; box-shadow:0 25px 80px rgba(0,0,0,.35);
    font-family:'Work Sans',sans-serif; animation:afdiagdSlideUp 0.25s ease;
}

/* ── HEADER ── */
.afdiagd-popup-header {
    display:flex; align-items:center; justify-content:space-between;
    background:linear-gradient(135deg,#274C5B,#1d2130);
    padding:22px 28px; border-radius:16px 16px 0 0; position:sticky; top:0; z-index:2;
}
.afdiagd-popup-header-left { display:flex; align-items:center; gap:14px; }
.afdiagd-popup-logo { font-size:32px; }
.afdiagd-popup-title { color:#fff; font-size:17px; font-weight:800; font-family:'Work Sans',sans-serif; }
.afdiagd-popup-subtitle { color:rgba(255,255,255,.65); font-size:12px; margin-top:2px; }
#afdiagd-popup-close {
    background:rgba(255,255,255,.15); border:none; color:#fff; width:32px; height:32px;
    border-radius:50%; cursor:pointer; font-size:16px; display:flex; align-items:center;
    justify-content:center; transition:background .2s; flex-shrink:0;
}
#afdiagd-popup-close:hover { background:rgba(255,255,255,.3); }

/* ── BODY ── */
.afdiagd-popup-body { padding:28px; }

/* ── FORMULAIRE ── */
.afdiagd-form { font-family:'Work Sans',sans-serif; color:#1d2130; }
.afdiagd-intro {
    font-size:14px; color:#555; line-height:1.7; margin:0 0 22px;
    padding:14px 16px; background:#f8fbfc; border-left:3px solid #E30613; border-radius:0 8px 8px 0;
}

/* ══════════════════════════════════════════════════════
   CHAMP MONTANT — div contenteditable
   Impossible à bloquer par un thème WordPress
   ══════════════════════════════════════════════════════ */
.afdiagd-montant-wrap {
    display:flex; align-items:stretch;
    border:2px solid #e0e0e0; border-radius:10px;
    margin-bottom:18px; background:#fff;
    transition:border-color .2s; cursor:text;
}
.afdiagd-montant-wrap:focus-within { border-color:#E30613; }

.afdiagd-montant-editable {
    flex:1; min-width:0;
    padding:14px 18px;
    font-size:28px; font-weight:700; color:#1d2130;
    font-family:'Work Sans',sans-serif;
    outline:none;
    min-height:60px; line-height:1.2;
    white-space:nowrap; overflow:hidden;
    /* Forcer interactivité — ne peut PAS être bloqué car c'est un div, pas un input */
    cursor:text;
    -webkit-user-select:text; user-select:text;
}
.afdiagd-montant-editable:empty::before {
    content: attr(data-placeholder);
    color:#bbb; font-weight:400; font-size:20px; pointer-events:none;
}
.afdiagd-montant-editable.libre { color:#E30613; caret-color:#E30613; }

.afdiagd-montant-symbol {
    display:flex; align-items:center; justify-content:center;
    background:#E30613; color:#fff;
    font-size:22px; font-weight:700; padding:0 22px;
    border-radius:0 8px 8px 0; flex-shrink:0; pointer-events:none;
}

/* ── PRESETS ── */
.afdiagd-presets { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.afdiagd-preset {
    flex:1; min-width:70px; padding:11px 8px;
    border:2px solid #e0e0e0; border-radius:8px;
    background:#fff; color:#1d2130;
    font-size:13px; font-weight:700; cursor:pointer;
    text-align:center; transition:all .18s;
    font-family:'Work Sans',sans-serif; line-height:1.3;
}
.afdiagd-preset:hover { border-color:#274C5B; color:#274C5B; }
.afdiagd-preset.active { background:#E30613; border-color:#E30613; color:#fff; }

/* ── DÉDUCTION ── */
.afdiagd-deduction-preview {
    display:flex; align-items:center; justify-content:space-between;
    background:#fce6e7; border-radius:8px; padding:11px 15px;
    margin-bottom:22px; font-size:13px; flex-wrap:wrap; gap:6px; color:#274C5B; font-weight:500;
}
.afdiagd-cout-reel { color:#E30613; font-weight:800; font-size:15px; }

/* ── SECTION LABEL ── */
.afdiagd-section-label {
    font-size:12px; font-weight:700; color:#274C5B; text-transform:uppercase;
    letter-spacing:1px; border-bottom:2px solid #E30613; padding-bottom:8px; margin-bottom:15px;
}

/* ── GATEWAYS ── */
.afdiagd-gateways { display:flex; flex-direction:column; gap:8px; margin-bottom:22px; }
.afdiagd-gateway-item { display:flex; align-items:center; cursor:pointer; }
.afdiagd-gateway-item input[type=radio] {
    margin:0 10px 0 0; accent-color:#E30613; width:16px; height:16px; flex-shrink:0;
}
.afdiagd-gateway-label { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:500; }
.afdiagd-gateway-icon { font-size:18px; }

/* ── ÉTAPE 2 ── */
.afdiagd-step-back { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; flex-wrap:wrap; gap:8px; }
.afdiagd-btn-back { background:none; border:none; color:#274C5B; font-size:13px; font-weight:600; cursor:pointer; padding:0; text-decoration:underline; font-family:'Work Sans',sans-serif; }
.afdiagd-recap-montant { font-size:18px; font-weight:800; color:#E30613; }

/* ── CHAMPS FORM ── */
.afdiagd-row-3 { display:flex; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.afdiagd-field { margin-bottom:14px; }
.afdiagd-col-grow { flex:1; min-width:120px; }
.afdiagd-field label { display:block; font-size:12px; font-weight:700; color:#274C5B; margin-bottom:6px; text-transform:uppercase; letter-spacing:.4px; }
.afdiagd-input {
    width:100%; padding:11px 14px; border:1.5px solid #e0e0e0; border-radius:8px;
    font-size:14px; color:#1d2130; font-family:'Work Sans',sans-serif;
    box-sizing:border-box; transition:border-color .2s; background:#fff;
}
.afdiagd-input:focus { border-color:#E30613; outline:none; box-shadow:0 0 0 3px rgba(227,6,19,.08); }
.afdiagd-input[readonly] { background:#f8f9fa; color:#555; }
.req { color:#E30613; margin-left:2px; }

/* ── LOGIN HINT ── */
.afdiagd-login-hint { font-size:12px; color:#666; margin-bottom:18px; }
.afdiagd-login-hint.success { color:#27ae60; font-weight:600; }
.afdiagd-login-hint a { color:#E30613; }

/* ── TOTAL BAR ── */
.afdiagd-total-bar {
    display:flex; align-items:center; justify-content:space-between;
    background:#1d2130; border-radius:10px; padding:16px 22px; margin-bottom:18px;
}
.afdiagd-total-label { color:#fff; font-size:15px; font-weight:700; }
.afdiagd-total-montant { color:#E30613; font-size:22px; font-weight:800; }

/* ── BOUTONS ── */
.afdiagd-btn-primary {
    width:100%; padding:15px; background:#E30613; color:#fff; border:none; border-radius:50px;
    font-size:15px; font-weight:700; cursor:pointer; font-family:'Work Sans',sans-serif;
    text-transform:uppercase; letter-spacing:.8px; transition:all .2s; display:block;
}
.afdiagd-btn-primary:hover:not(:disabled) { background:#b8000f; transform:translateY(-1px); box-shadow:0 6px 20px rgba(227,6,19,.3); }
.afdiagd-btn-primary:disabled { opacity:.6; cursor:not-allowed; }
.afdiagd-btn-secondary {
    display:inline-block; padding:12px 28px; border:2px solid #274C5B; color:#274C5B;
    border-radius:50px; background:#fff; font-size:14px; font-weight:600; cursor:pointer; transition:all .2s;
}
.afdiagd-btn-secondary:hover { background:#274C5B; color:#fff; }

/* ── RÉSULTATS ── */
.afdiagd-result { padding:14px 18px; border-radius:10px; font-size:14px; font-weight:600; margin-bottom:18px; }
.afdiagd-result.success { background:#e8f5e9; border:1.5px solid #27ae60; color:#2e7d32; }
.afdiagd-result.error   { background:#fce6e7; border:1.5px solid #E30613; color:#c0392b; }
.afdiagd-legal { font-size:11px; color:#999; text-align:center; margin-top:12px; line-height:1.6; }

/* ── SUCCÈS ── */
.afdiagd-success-step { text-align:center; padding:20px 0; }
.afdiagd-success-icon { font-size:64px; margin-bottom:16px; animation:afdiagdBounce 0.6s ease; }
.afdiagd-success-step h3 { font-size:22px; font-weight:800; color:#274C5B; margin:0 0 10px; }
.afdiagd-success-msg { font-size:14px; color:#555; margin-bottom:20px; line-height:1.6; }
.afdiagd-success-recap { background:#e8f5e9; border:1.5px solid #27ae60; border-radius:10px; padding:15px 20px; margin-bottom:20px; font-size:14px; color:#2e7d32; text-align:left; }

/* ── BOUTON DÉCLENCHEUR ── */
.afdiagd-open-popup {
    background:#E30613; color:#fff; border:none; border-radius:50px; padding:14px 32px;
    font-size:15px; font-weight:700; cursor:pointer; font-family:'Work Sans',sans-serif;
    text-transform:uppercase; letter-spacing:.8px; transition:all .2s; display:inline-block;
}
.afdiagd-open-popup:hover { background:#b8000f; transform:translateY(-2px); box-shadow:0 8px 25px rgba(227,6,19,.35); }

/* ── INLINE ── */
.afdiagd-inline-wrap { max-width:560px; margin:0 auto; background:#fff; border:1.5px solid #fce6e7; border-radius:16px; padding:30px; font-family:'Work Sans',sans-serif; }

/* ── RESPONSIVE ── */
@media (max-width:560px) {
    .afdiagd-popup-header { padding:18px 20px; }
    .afdiagd-popup-body   { padding:20px; }
    .afdiagd-presets      { gap:6px; }
    .afdiagd-preset       { min-width:55px; font-size:12px; padding:9px 5px; }
    .afdiagd-row-3        { flex-direction:column; }
    .afdiagd-montant-editable { font-size:22px; }
}
/* ══════════════════════════════════════════════════════
   BOUTON "FAIRE UN DON" DANS UBERMENU
   Même style que butt-adherer
   ══════════════════════════════════════════════════════ */
li.afdiagd-menu-item {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
}

#afdiagd-header-btn {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
    background-color: #E30613 !important;
    padding: 15px 10px !important;
    outline: none !important;
    border: none !important;
    border-radius: 15px !important;
    width: 140px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    font-family: inherit !important;
    transition: background-color 0.2s ease !important;
}
#afdiagd-header-btn:hover {
    background-color: #b8000f !important;
    color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════
   LOUPE : la déplacer visuellement ENTRE ADHÉRER et DON
   Elle est dans #site-extras-navigation, séparé du menu.
   On la cache de sa position actuelle et on l'affiche
   entre les deux boutons via le JS.
   ══════════════════════════════════════════════════════ */

/* Loupe clonée injectée dans le menu par le JS */
#afdiagd-search-clone {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
    cursor: pointer !important;
}
#afdiagd-search-clone a,
#afdiagd-search-clone svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    color: inherit !important;
}
/* ══════════════════════════════════════════════════════
   BOUTON FAIRE UN DON — dans UberMenu
   ══════════════════════════════════════════════════════ */
li.afdiagd-menu-item {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
}

#afdiagd-header-btn {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
    background-color: #E30613 !important;
    padding: 15px 10px !important;
    border: none !important;
    border-radius: 15px !important;
    width: 140px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    font-family: inherit !important;
    outline: none !important;
    transition: background-color 0.2s !important;
}
#afdiagd-header-btn:hover { background-color: #b8000f !important; color: #fff !important; }

/* ══════════════════════════════════════════════════════
   PICTO LOUPE dans UberMenu — simple et discret
   ══════════════════════════════════════════════════════ */
li.afdiagd-loupe-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    list-style: none !important;
    padding: 0 10px !important;
}
a.afdiagd-loupe-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: inherit !important;
    text-decoration: none !important;
    line-height: 1 !important;
    padding: 5px !important;
}
a.afdiagd-loupe-trigger svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
}
a.afdiagd-loupe-trigger:hover { opacity: 0.7 !important; }
