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

*, *::before, *::after { box-sizing: border-box; }

.afdiag-wrap {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Work Sans', sans-serif;
    color: #1d2130;
}

/* ===== COULEURS ===== */
.afdiag-color-blue { color: #274C5B; }
.afdiag-color-red  { color: #E30613; }

/* ===== BADGE PRIX ===== */
.afdiag-badge-prix {
    background: linear-gradient(135deg, #274C5B, #1d2130);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 35px;
    letter-spacing: 0.3px;
}

/* ===== BARRE DE PROGRESSION ===== */
.afdiag-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}
.afdiag-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.afdiag-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}
.afdiag-step-circle.on  { background: #E30613; color: white; }
.afdiag-step-circle.off { background: #fce6e7; color: #999; }
.afdiag-step-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}
.afdiag-step-label.on  { color: #274C5B; }
.afdiag-step-label.off { color: #999; }
.afdiag-step-line {
    height: 2px;
    width: 80px;
    background: #fce6e7;
    margin-bottom: 20px;
}

/* ===== ÉTAPES ===== */
.afdiag-etape         { display: none; }
.afdiag-etape.active  { display: block; }

/* ===== TITRES SECTIONS ===== */
.afdiag-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #274C5B;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid #E30613;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 30px;
    clear: both;
}
.afdiag-section-title:first-child { margin-top: 0; }

/* ===== GRILLE ===== */
.afdiag-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.afdiag-col-full { grid-column: 1 / -1; }

/* ===== CHAMPS ===== */
.afdiag-field {
    display: flex;
    flex-direction: column;
}
.afdiag-field label {
    font-size: 13px;
    font-weight: 500;
    color: #1d2130;
    margin-bottom: 6px;
}
.afdiag-required { color: #E30613; }

.afdiag-input,
.afdiag-select {
    padding: 11px 15px;
    border: 1.5px solid #fce6e7;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Work Sans', sans-serif;
    color: #1d2130;
    background: #fff;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.afdiag-input:focus,
.afdiag-select:focus {
    border-color: #274C5B;
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 76, 91, 0.08);
}
.afdiag-input.err {
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.08);
    background: #fff8f8;
}
.afdiag-input.ok {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.08);
}
.afdiag-input-file {
    padding: 12px;
    border: 2px dashed #E30613;
    border-radius: 8px;
    background: #fce6e7;
    width: 100%;
    font-family: 'Work Sans', sans-serif;
    color: #1d2130;
    cursor: pointer;
}
.afdiag-info {
    font-size: 12px;
    color: #274C5B;
    margin-top: 5px;
    display: block;
}
.afdiag-err-msg {
    font-size: 12px;
    color: #E30613;
    margin-top: 4px;
    font-weight: 500;
}

/* ===== CONSENTEMENTS ===== */
.afdiag-consent-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fce6e7;
    border: 1.5px solid #E30613;
    border-radius: 8px;
    margin-bottom: 15px;
}
.afdiag-consent-box input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #E30613;
}
.afdiag-consent-box label {
    font-size: 13px;
    color: #1d2130;
    line-height: 1.6;
    cursor: pointer;
}

/* ===== BOUTONS ===== */
.afdiag-btn-primary {
    display: inline-block;
    padding: 14px 28px;
    background: #E30613;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    letter-spacing: 0.5px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.3);
    transition: background 0.2s;
}
.afdiag-btn-primary:hover { background: #c0000f; color: white; }
.afdiag-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.afdiag-btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    background: #274C5B;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    text-decoration: none;
    transition: background 0.2s;
}
.afdiag-btn-secondary:hover { background: #1d2130; color: white; }

.afdiag-btn-outline {
    display: inline-block;
    padding: 12px 24px;
    background: white;
    color: #274C5B;
    border: 2px solid #274C5B;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    text-decoration: none;
    transition: all 0.2s;
}
.afdiag-btn-outline:hover { background: #274C5B; color: white; }

.afdiag-btn-block { display: block; text-align: center; width: 100%; }

.afdiag-btn-next {
    width: 100%;
    padding: 16px;
    background: #274C5B;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    letter-spacing: 0.5px;
    margin-top: 20px;
    transition: background 0.2s;
}
.afdiag-btn-next:hover { background: #1d2130; }

.afdiag-btn-prev {
    padding: 14px;
    background: white;
    color: #274C5B;
    border: 2px solid #274C5B;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    transition: all 0.2s;
}
.afdiag-btn-prev:hover { background: #274C5B; color: white; }

.afdiag-btn-submit {
    padding: 16px;
    background: #E30613;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.3);
    transition: background 0.2s;
}
.afdiag-btn-submit:hover    { background: #c0000f; }
.afdiag-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== NAVIGATION ===== */
.afdiag-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* ===== DON ===== */
.afdiag-don-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}
.afdiag-don-btn {
    padding: 12px 5px;
    border: 2px solid #274C5B;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #274C5B;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    transition: all 0.2s;
}
.afdiag-don-btn:hover,
.afdiag-don-btn.on { background: #E30613; color: white; border-color: #E30613; }

.afdiag-don-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #274C5B;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}
.afdiag-don-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: #274C5B;
    outline: none;
    font-family: 'Work Sans', sans-serif;
}
.afdiag-don-euro {
    padding: 12px 18px;
    background: #fce6e7;
    font-size: 18px;
    font-weight: 700;
    color: #E30613;
}

/* ===== CALCULATEUR ===== */
.afdiag-calcul {
    background: #fce6e7;
    border: 1.5px solid #E30613;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}
.afdiag-calcul-titre {
    font-size: 12px;
    font-weight: 700;
    color: #E30613;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}
.afdiag-calcul-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.afdiag-calcul-row span { font-size: 14px; color: #1d2130; }
.afdiag-calcul-row strong { font-size: 16px; font-weight: 700; color: #274C5B; }
.afdiag-calcul-sep {
    height: 1px;
    background: #E30613;
    opacity: 0.3;
    margin: 12px 0;
}
.afdiag-calcul-reel {
    font-size: 22px;
    font-weight: 800;
    color: #E30613 !important;
}

/* ===== TOTAL BOX ===== */
.afdiag-total-box {
    background: #1d2130;
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}
.afdiag-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    opacity: 0.8;
}
.afdiag-total-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
    margin-top: 5px;
    font-size: 16px;
    font-weight: 700;
}
.afdiag-total-montant {
    font-size: 26px;
    font-weight: 800;
    color: #E30613;
}

/* ===== RÉSUMÉ ===== */
.afdiag-resume-box {
    background: #fff;
    border: 1.5px solid #fce6e7;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.afdiag-resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.afdiag-resume-full { grid-column: 1 / -1; }
.afdiag-resume-item span {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 3px;
}
.afdiag-resume-item strong { font-size: 15px; color: #1d2130; }
.afdiag-resume-ligne {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #fce6e7;
    font-size: 14px;
}
.afdiag-resume-ligne:last-of-type { border-bottom: none; margin-bottom: 0; }
.afdiag-resume-total { font-size: 16px; font-weight: 700; }
.afdiag-deduction-box {
    display: flex;
    justify-content: space-between;
    background: #fce6e7;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: #E30613;
    font-weight: 600;
}
.afdiag-note {
    padding: 12px 15px;
    background: #fce6e7;
    border-radius: 8px;
    border-left: 4px solid #274C5B;
    font-size: 12px;
    color: #274C5B;
    font-weight: 500;
    margin-top: 15px;
}

/* ===== ALERTES ===== */
.afdiag-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.afdiag-alert-success { background: #e8f5e9; border: 1.5px solid #27ae60; color: #1d2130; }
.afdiag-alert-danger  { background: #fce6e7; border: 1.5px solid #E30613; color: #E30613; }
.afdiag-alert-warning { background: #fff3cd; border: 1.5px solid #f39c12; color: #1d2130; }

/* ===== CARD ===== */
.afdiag-card {
    background: white;
    border: 1.5px solid #fce6e7;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

/* ===== LISTE FORMULES ===== */
.afdiag-formules-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.afdiag-formule-item {
    background: white;
    border: 1.5px solid #fce6e7;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.afdiag-formule-item:hover { border-color: #274C5B; box-shadow: 0 6px 20px rgba(39,76,91,0.12); transform: translateY(-2px); }
.afdiag-formule-emoji-xl { font-size: 50px; margin-bottom: 12px; }
.afdiag-formule-titre { font-size: 18px; font-weight: 700; color: #274C5B; margin: 0 0 8px; }
.afdiag-formule-prix-xl { font-size: 22px; font-weight: 800; color: #E30613; margin-bottom: 12px; }
.afdiag-formule-desc { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 15px; flex: 1; }
.afdiag-formule-badge-validation { font-size: 12px; padding: 5px 12px; border-radius: 20px; background: #fce6e7; color: #E30613; font-weight: 600; margin-bottom: 15px; }

/* ===== ESPACE ADHÉRENT ===== */
.afdiag-ea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #274C5B, #1d2130);
    color: white;
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.afdiag-ea-header h2 { margin: 0; color: white; font-size: 22px; }
.afdiag-ea-header p  { margin: 5px 0 0; opacity: 0.8; font-size: 13px; }
.afdiag-logout { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; }
.afdiag-logout:hover { color: white; }

.afdiag-ea-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #fce6e7;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.afdiag-ea-tab {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}
.afdiag-ea-tab:hover { color: #274C5B; }
.afdiag-ea-tab.active { color: #E30613; border-bottom-color: #E30613; }

.afdiag-ea-panel { display: none; }
.afdiag-ea-panel.active { display: block; }

/* CERFA items */
.afdiag-cerfa-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1.5px solid #fce6e7;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
}

/* RESSOURCES */
.afdiag-ressource-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 1.5px solid #fce6e7;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #1d2130;
    transition: all 0.2s;
}
.afdiag-ressource-item:hover { border-color: #274C5B; background: #f8fbfc; }
.afdiag-ressource-icon { font-size: 28px; flex-shrink: 0; }
.afdiag-ressource-titre { font-weight: 700; color: #274C5B; font-size: 14px; }
.afdiag-ressource-desc  { font-size: 12px; color: #999; margin-top: 3px; }

/* ===== LOGIN ===== */
.afdiag-login-wrap {
    max-width: 450px;
    margin: 0 auto;
    background: white;
    border: 1.5px solid #fce6e7;
    border-radius: 12px;
    overflow: hidden;
}
.afdiag-tabs {
    display: flex;
    border-bottom: 2px solid #fce6e7;
}
.afdiag-tab {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    background: #f8f9fa;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.afdiag-tab.active { color: #E30613; background: white; border-bottom-color: #E30613; }
.afdiag-tab-panel { display: none; padding: 25px; }
.afdiag-tab-panel.active { display: block; }
.afdiag-tab-panel h3 { margin-top: 0; color: #274C5B; font-size: 16px; }

/* ===== STATS MINI ===== */
.afdiag-stats-grid { display: grid; gap: 15px; }
.afdiag-stat-mini { text-align: center; padding: 15px; background: #f8f9fa; border-radius: 8px; }
.afdiag-stat-mini span  { display: block; font-size: 11px; color: #999; text-transform: uppercase; margin-bottom: 5px; }
.afdiag-stat-mini strong { font-size: 18px; font-weight: 700; color: #274C5B; }

/* ===== BADGES ===== */
.afdiag-badge { display: inline-block; padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.afdiag-badge-success  { background: #e8f5e9; color: #27ae60; }
.afdiag-badge-warning  { background: #fff3cd; color: #f39c12; }
.afdiag-badge-danger   { background: #fce6e7; color: #E30613; }
.afdiag-badge-secondary { background: #f8f9fa; color: #666; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .afdiag-grid-2        { grid-template-columns: 1fr; }
    .afdiag-don-grid      { grid-template-columns: repeat(3, 1fr); }
    .afdiag-resume-grid   { grid-template-columns: 1fr; }
    .afdiag-nav           { grid-template-columns: 1fr; }
    .afdiag-ea-header     { flex-direction: column; text-align: center; }
    .afdiag-ea-tab        { padding: 10px 12px; font-size: 12px; }
    .afdiag-badge-prix    { font-size: 16px; }
    .afdiag-formules-liste { grid-template-columns: 1fr; }
    .afdiag-stats-grid    { grid-template-columns: 1fr; }
}

/* ===== ÉTAPE OPTIONS PUBLICATIONS ===== */
.afdiag-option-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}
.afdiag-option-card:has(.afdiag-option-check-wrap input:checked) {
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227,6,19,.08);
}
.afdiag-option-sub {
    margin-left: 24px;
    border-style: dashed;
    background: #fafbfc;
}
.afdiag-option-sub:has(input:checked) {
    border-style: solid;
}
.afdiag-option-check-wrap {
    padding-top: 3px;
    flex-shrink: 0;
}
.afdiag-option-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
}
.afdiag-option-content {
    flex: 1;
}
.afdiag-option-title {
    font-size: 15px;
    font-weight: 700;
    color: #1d2130;
    margin-bottom: 6px;
}
.afdiag-option-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}
.afdiag-option-price {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 800;
    color: #1d2130;
    text-align: right;
    white-space: nowrap;
    align-self: flex-end;
}
@media (max-width: 600px) {
    .afdiag-option-card { flex-wrap: wrap; }
    .afdiag-option-icon { width: 48px; }
    .afdiag-option-price { width: 100%; text-align: right; font-size: 16px; }
    .afdiag-option-sub { margin-left: 0; }
}

/* Détection de l'autocomplete navigateur via animation CSS */
@keyframes afdiagOnAutoFill {
    from { background-color: transparent; }
    to   { background-color: transparent; }
}
.afdiag-input:-webkit-autofill {
    animation-name: afdiagOnAutoFill;
    animation-duration: 1ms;
}
.afdiag-input:autofill {
    animation-name: afdiagOnAutoFill;
    animation-duration: 1ms;
}

/* ===== ÉTAPE PAIEMENT — Sélection gateway ===== */
.afdiag-gateway-liste {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}
.afdiag-gateway-option {
    cursor: pointer;
    display: block;
}
.afdiag-gateway-option input[type="radio"] {
    display: none;
}
.afdiag-gateway-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.afdiag-gateway-option input[type="radio"]:checked + .afdiag-gateway-card {
    border-color: #274C5B;
    box-shadow: 0 0 0 3px rgba(39,76,91,.12);
    background: #f0f6f8;
}
.afdiag-gateway-option:hover .afdiag-gateway-card {
    border-color: #274C5B;
}
.afdiag-gateway-icone {
    font-size: 32px;
    flex-shrink: 0;
}
.afdiag-gateway-info {
    display: flex;
    flex-direction: column;
}
.afdiag-gateway-info strong {
    font-size: 16px;
    color: #274C5B;
}
.afdiag-gateway-info span {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}
