/* ── Variables ─────────────────────────────────────────────────────────────── */
.ae-test-wrapper {
    --ae-green:      #1abf7e;
    --ae-green-dark: #0f7c5a;
    --ae-green-pale: #e8f5ef;
    --ae-ink:        #1a202c;
    --ae-gray:       #718096;
    --ae-border:     #e2f5ec;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px;
    font-family: inherit;
}

/* ── Test card ─────────────────────────────────────────────────────────────── */
.ae-test-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 12px 48px rgba(26,191,126,.15), 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid var(--ae-border);
}
@media (max-width: 768px) {
    .ae-test-wrapper { padding: 0 16px; }
    .ae-test-card { padding: 28px 20px; }
}
@media (max-width: 480px) {
    .ae-test-card { padding: 22px 16px; }
}

/* ── Card header ───────────────────────────────────────────────────────────── */
.ae-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}
.ae-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ae-ink);
    margin: 0 0 4px;
    line-height: 1.25;
}
.ae-subtitle {
    font-size: .82rem;
    color: var(--ae-gray);
    margin: 0;
}

/* ── Level badges ──────────────────────────────────────────────────────────── */
.ae-level-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}
.ae-lv {
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}
.ae-lv-a1    { background: #e8f5ef; color: #0f7c5a; }
.ae-lv-arrow { background: #1abf7e; color: #fff; }
.ae-lv-c2    { background: #0f7c5a; color: #fff; }

/* ── Progress row ──────────────────────────────────────────────────────────── */
.ae-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.ae-progress-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ae-gray);
    white-space: nowrap;
    flex-shrink: 0;
}
.ae-progress-bar {
    flex: 1;
    height: 7px;
    background: var(--ae-green-pale);
    border-radius: 100px;
    overflow: hidden;
}
.ae-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ae-green), var(--ae-green-dark));
    border-radius: 100px;
    transition: width .4s ease;
    width: 0%;
}
.ae-progress-pct {
    font-size: .75rem;
    font-weight: 700;
    color: var(--ae-green);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 32px;
    text-align: right;
}

/* ── Quiz zone ─────────────────────────────────────────────────────────────── */
.ae-quiz-zone {
    background: #f7fbf9;
    border: 2px dashed #b2dfc9;
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 20px;
    min-height: 180px;
}

/* ── Intro list ────────────────────────────────────────────────────────────── */
.ae-intro-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ae-intro-list li {
    padding-left: 24px;
    position: relative;
    color: #374151;
    font-size: .95rem;
    line-height: 1.5;
}
.ae-intro-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--ae-green);
    font-weight: 700;
}

/* ── Question ──────────────────────────────────────────────────────────────── */
.ae-q-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ae-ink);
    margin: 0 0 18px;
    line-height: 1.5;
}
.ae-options {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.ae-test-wrapper .ae-option {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border: 1.5px solid #e1e5ec;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-size: .93rem;
    line-height: 1.4;
    color: var(--ae-ink);
    transition: border-color .15s, background .15s;
    width: 100%;
}
.ae-test-wrapper .ae-option:hover,
.ae-test-wrapper .ae-option:focus-visible {
    border-color: var(--ae-green);
    background: var(--ae-green-pale);
    outline: none;
}
.ae-test-wrapper .ae-option.ae-selected {
    border-color: var(--ae-green-dark);
    background: #d8f5e9;
}
.ae-test-wrapper .ae-option:disabled { cursor: default; }
.ae-test-wrapper .ae-option:disabled:not(.ae-selected) {
    background: #fff;
    border-color: #eaecf0;
    opacity: .7;
}
.ae-opt-letter {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .78rem;
    color: var(--ae-ink);
    transition: background .15s, color .15s;
}
.ae-test-wrapper .ae-option:hover .ae-opt-letter,
.ae-test-wrapper .ae-option:focus-visible .ae-opt-letter,
.ae-test-wrapper .ae-option.ae-selected .ae-opt-letter {
    background: var(--ae-green);
    color: #fff;
}

/* ── Results ───────────────────────────────────────────────────────────────── */
.ae-big-level {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 900;
    color: var(--ae-green-dark);
    line-height: 1;
    margin: 8px 0;
    text-align: center;
}
.ae-level-label {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ae-ink);
    margin: 0 0 12px;
    text-align: center;
}
.ae-result-comment {
    font-size: .9rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 18px;
    text-align: center;
}
.ae-inter-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9ca3af;
    margin: 0 0 8px;
    text-align: center;
}
.ae-inter-sub {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ae-ink);
    margin: 0 0 18px;
    text-align: center;
}
.ae-tested-on {
    font-size: .8rem;
    color: #9ca3af;
    margin: 0 0 8px;
    text-align: center;
}
.ae-notice {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: .88rem;
    text-align: center;
}

/* ── Score summary ─────────────────────────────────────────────────────────── */
/* ── Recommendations ───────────────────────────────────────────────────────── */
.ae-recos {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.ae-recos li a {
    display: inline-block;
    padding: 7px 16px;
    border: 1.5px solid var(--ae-green);
    border-radius: 20px;
    color: var(--ae-green-dark);
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.ae-recos li a:hover { background: var(--ae-green); color: #fff; }

.ae-level-page-link {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 28px;
    gap: 14px;
    align-items: center;
    width: min(100%, 560px);
    margin: 16px auto 16px;
    padding: 16px;
    border: 1px solid rgba(26, 191, 126, .24);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(232, 245, 239, .98), #ffffff 64%),
        #ffffff;
    color: var(--ae-ink);
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(26, 191, 126, .12);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ae-level-page-link:hover,
.ae-level-page-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(15, 124, 90, .44);
    box-shadow: 0 18px 34px rgba(26, 191, 126, .18);
    outline: none;
}
.ae-level-page-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ae-green), var(--ae-green-dark));
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(26, 191, 126, .22);
}
.ae-level-page-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    text-align: left;
}
.ae-level-page-kicker {
    color: var(--ae-green-dark);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ae-level-page-copy strong {
    color: var(--ae-ink);
    font-size: 1rem;
    line-height: 1.2;
}
.ae-level-page-copy span:last-child {
    color: #5f6b7c;
    font-size: .86rem;
    line-height: 1.35;
}
.ae-level-page-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--ae-green-dark);
    font-weight: 900;
    transition: transform .16s ease, background .16s ease;
}
.ae-level-page-link:hover .ae-level-page-arrow,
.ae-level-page-link:focus-visible .ae-level-page-arrow {
    transform: translateX(2px);
    background: var(--ae-green-pale);
}

/* ── Actions (multi-button) ────────────────────────────────────────────────── */
.ae-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ── Main CTA button ───────────────────────────────────────────────────────── */
.ae-btn-wrap { margin-bottom: 0; }
.ae-btn {
    display: inline-block;
    padding: 16px 28px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s, box-shadow .15s, background .15s;
    text-decoration: none;
    line-height: 1.2;
    letter-spacing: .02em;
}
.ae-btn-full {
    width: 100%;
    display: block;
    text-align: center;
}
.ae-btn-primary {
    background: linear-gradient(135deg, var(--ae-green), var(--ae-green-dark));
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(26,191,126,.4);
    border-color: transparent;
}
.ae-btn-primary:hover,
.ae-btn-primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(26,191,126,.5);
    outline: none;
}
.ae-btn-secondary {
    background: #fff;
    color: var(--ae-ink) !important;
    border-color: var(--ae-green);
}
.ae-btn-secondary:hover {
    background: var(--ae-green-pale);
    border-color: var(--ae-green-dark);
}
.ae-btn-sm { padding: 9px 18px; font-size: .88rem; }

/* ── Card note ─────────────────────────────────────────────────────────────── */
.ae-card-note {
    text-align: center;
    font-size: .75rem;
    color: #a0aec0;
    margin: 12px 0 0;
}

/* ── Loading spinner ───────────────────────────────────────────────────────── */
.ae-loading {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ae-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--ae-green);
    border-radius: 50%;
    animation: ae-spin .7s linear infinite;
}
@keyframes ae-spin { to { transform: rotate(360deg); } }

/* ── "Comment ça marche" section ───────────────────────────────────────────── */
.ae-section {
    padding: 56px 24px 40px;
}
.ae-section-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.ae-section-tag {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    color: #1abf7e;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.ae-section-h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 16px;
}
.ae-section-lead {
    max-width: 760px;
    margin: 0 auto 32px;
    color: #536174;
    font-size: .96rem;
    line-height: 1.75;
}
.ae-section-lead--compact {
    max-width: 820px;
    margin-bottom: 30px;
}
.ae-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.ae-info-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,.05);
    border: 1px solid #e8f5ef;
    text-align: center;
}
.ae-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: #e8f5ef;
    color: #0f7c5a;
    font-size: 1.45rem;
    font-weight: 900;
}
.ae-info-card h3 { font-size: .95rem; font-weight: 700; color: #1a202c; margin: 0 0 8px; }
.ae-info-card p  { font-size: .84rem; color: #718096; line-height: 1.6; margin: 0; }

/* ── Levels section ────────────────────────────────────────────────────────── */
.ae-levels-section {
    background: #f0faf5;
    padding: 48px 24px;
}
.ae-levels-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 0;
}
.ae-level-chip {
    --ae-level-color: #0f7c5a;
    --ae-level-bg: #ffffff;
    position: relative;
    min-height: 260px;
    padding: 22px;
    border: 1px solid rgba(15, 124, 90, .14);
    border-radius: 18px;
    background: var(--ae-level-bg);
    box-shadow: 0 8px 24px rgba(15, 124, 90, .07);
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ae-level-chip:hover,
.ae-level-chip:focus-within {
    transform: translateY(-4px);
    border-color: rgba(15, 124, 90, .32);
    box-shadow: 0 18px 36px rgba(15, 124, 90, .12);
}
.ae-lc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 0 16px;
    border-radius: 50%;
    background: var(--ae-level-color);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
}
.ae-lc-label {
    color: #1a202c;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 9px;
}
.ae-lc-short,
.ae-lc-long {
    font-size: .86rem;
    line-height: 1.58;
    margin: 0;
}
.ae-lc-short {
    color: #3b4657;
    font-weight: 650;
    margin-bottom: 10px;
}
.ae-lc-long {
    color: #687386;
    opacity: .84;
    transform: translateY(0);
    transition: opacity .18s ease, transform .18s ease;
}
.ae-level-chip:hover .ae-lc-long,
.ae-level-chip:focus-within .ae-lc-long {
    opacity: 1;
    transform: translateY(-2px);
}
.ae-lc-a1 { --ae-level-color: #1abf7e; --ae-level-bg: #ffffff; }
.ae-lc-a2 { --ae-level-color: #16a873; --ae-level-bg: #fbfffd; }
.ae-lc-b1 { --ae-level-color: #3486f6; --ae-level-bg: #f8fbff; }
.ae-lc-b2 { --ae-level-color: #775cf0; --ae-level-bg: #fbfaff; }
.ae-lc-c1 { --ae-level-color: #d9851f; --ae-level-bg: #fffdf9; }
.ae-lc-c2 { --ae-level-color: #dd4b55; --ae-level-bg: #fffafa; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ae-cards-grid  { grid-template-columns: 1fr; }
    .ae-levels-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ae-section { padding: 40px 16px 28px; }
    .ae-levels-section { padding: 36px 16px; }
    .ae-section-h2 { font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .ae-title { font-size: 1.05rem; }
    .ae-btn   { font-size: .95rem; padding: 14px 20px; }
    .ae-levels-grid { grid-template-columns: 1fr; }
    .ae-level-chip { min-height: auto; }
    .ae-level-page-link {
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 14px;
    }
    .ae-level-page-badge {
        width: 46px;
        height: 46px;
        font-size: 1.05rem;
    }
    .ae-level-page-arrow { display: none; }
    .ae-level-page-kicker { font-size: .68rem; }
    .ae-level-page-copy strong { font-size: .94rem; }
}

/* ── Popin ─────────────────────────────────────────────────────────────────── */
.ae-popin {
    position: fixed;
    bottom: 28px;
    right: 28px;
    transform: translateY(calc(100% + 40px));
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
    width: 320px;
    z-index: 9999;
    overflow: hidden;
    transition: transform .45s cubic-bezier(.34,1.4,.64,1);
}
.ae-popin.ae-popin-visible { transform: translateY(0); }

.ae-popin-accent {
    height: 4px;
    background: linear-gradient(90deg, #1abf7e, #0f7c5a);
}
.ae-popin-body {
    padding: 18px 20px 16px;
}
.ae-popin-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 26px; height: 26px;
    background: rgba(0,0,0,.06);
    border: none;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.ae-popin-close:hover { background: rgba(0,0,0,.12); color: #1a202c; }

.ae-popin-badge {
    display: inline-block;
    background: #e8f5ef;
    color: #0f7c5a;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 3px 9px;
    border-radius: 100px;
    margin-bottom: 10px;
}
.ae-popin-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 5px;
    line-height: 1.3;
    padding-right: 20px;
}
.ae-popin-sub {
    font-size: .78rem;
    color: #718096;
    margin: 0 0 12px;
    line-height: 1.5;
}
.ae-popin-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.ae-popin-pills span {
    background: #f0faf5;
    color: #0f7c5a;
    font-size: .7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
}
.ae-popin-cta {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #1abf7e, #0f7c5a);
    color: #fff !important;
    text-align: center;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(26,191,126,.35);
    transition: transform .15s, box-shadow .15s;
    letter-spacing: .01em;
    box-sizing: border-box;
}
.ae-popin-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(26,191,126,.45);
}
.ae-popin-later {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: .76rem;
    text-align: center;
    margin-top: 10px;
    cursor: pointer;
    padding: 4px 0;
}
.ae-popin-later:hover { color: #6b7280; text-decoration: underline; }

@media (max-width: 480px) {
    .ae-popin {
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
    }
}
