/* ═══════════════════════════════════════════
   Progrespagnol — Test d'Éligibilité CPF
   Mirrors design tokens from level test (frontend.css)
   ═══════════════════════════════════════════ */

.pte-container {
    --pte-primary: var(--pte-custom-primary, #196785);
    --pte-secondary: var(--pte-custom-secondary, #F7A812);
    --pte-accent: var(--pte-custom-accent, #F55600);
    --pte-bg: var(--pte-custom-bg, #ffffff);
    --pte-text: var(--pte-custom-text, #1a1a1a);
    --pte-heading-font: var(--pte-custom-heading-font, Impact, sans-serif);
    --pte-body-font: var(--pte-custom-body-font, 'Josefin Sans', sans-serif);
    --pte-max-width: var(--pte-custom-max-width, 520px);
    --pte-btn-radius: var(--pte-custom-btn-radius, 8px);
    --pte-title-color: var(--pte-custom-title-color, var(--pte-primary));
    --pte-subtitle-color: var(--pte-custom-subtitle-color, #64748b);
    --pte-desc-color: var(--pte-custom-desc-color, #94a3b8);
    --pte-label-color: var(--pte-custom-label-color, #475569);
    --pte-btn-text-color: var(--pte-custom-btn-text-color, #1a1a1a);
    --pte-option-text-color: var(--pte-custom-option-text-color, #1a1a1a);

    font-family: var(--pte-body-font);
    color: var(--pte-text);
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

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

/* ─── Steps ─── */
.pte-step {
    display: none;
    animation: pte-fade-in 0.4s ease;
}

.pte-step-active {
    display: flex;
    justify-content: center;
}

@keyframes pte-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Fixed-size Card (same as level test) ─── */
.pte-card {
    background: var(--pte-bg);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    width: 100%;
    max-width: var(--pte-max-width);
    height: 680px;
    min-height: 680px;
    max-height: 680px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── Intro Card ─── */
.pte-intro-card {
    text-align: center;
    padding: 48px 32px;
    justify-content: center;
    align-items: center;
}

.pte-intro-badge {
    display: inline-block;
    background: rgba(25, 103, 133, 0.1);
    color: var(--pte-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.pte-intro-title {
    font-family: var(--pte-heading-font);
    font-size: 32px;
    line-height: 1.2;
    color: var(--pte-title-color);
    margin: 0 0 12px;
}

.pte-intro-subtitle {
    font-size: 18px;
    color: var(--pte-subtitle-color);
    margin: 0 0 16px;
    font-weight: 300;
}

.pte-intro-desc {
    font-size: 14px;
    color: var(--pte-desc-color);
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.pte-intro-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.pte-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--pte-subtitle-color);
}

.pte-feature-icon {
    font-size: 18px;
}

/* ─── Buttons ─── */
.pte-btn-main,
a.pte-btn-main,
a.pte-btn-main:visited,
a.pte-btn-main:hover,
a.pte-btn-main:active {
    display: inline-block;
    background: var(--pte-secondary);
    color: var(--pte-btn-text-color) !important;
    border: none;
    padding: 14px 40px;
    border-radius: var(--pte-btn-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--pte-body-font);
    text-decoration: none !important;
    text-align: center;
}

.pte-btn-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(247, 168, 18, 0.35);
}

.pte-btn-main:active {
    transform: translateY(0);
}

.pte-btn-main:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.pte-btn-secondary,
a.pte-btn-secondary,
a.pte-btn-secondary:visited {
    display: inline-block;
    background: transparent;
    color: var(--pte-text) !important;
    border: 1px solid #e2e8f0;
    padding: 14px 28px;
    border-radius: var(--pte-btn-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--pte-body-font);
    text-decoration: none !important;
    text-align: center;
}

.pte-btn-secondary:hover,
a.pte-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.pte-btn-main.pte-btn-small { padding: 10px 24px; font-size: 14px; }
.pte-btn-main.pte-btn-medium { padding: 12px 32px; font-size: 15px; }

/* ─── Questions Card ─── */
.pte-questions-card {
    padding: 32px;
    text-align: left;
}

.pte-q-header {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.pte-q-counter {
    font-size: 14px;
    font-weight: 500;
    color: var(--pte-subtitle-color);
    display: block;
    margin-bottom: 8px;
}

.pte-progress-bar-container {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.pte-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pte-primary), var(--pte-secondary));
    border-radius: 2px;
    transition: width 0.4s ease;
}

.pte-q-text {
    font-family: var(--pte-heading-font);
    font-size: 22px;
    font-weight: 700;
    color: var(--pte-text);
    margin: 20px 0 24px;
    line-height: 1.3;
    flex-shrink: 0;
}

.pte-q-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 24px;
}

.pte-q-option {
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: var(--pte-option-text-color);
}

.pte-q-option:hover {
    border-color: var(--pte-primary);
    background: rgba(25, 103, 133, 0.03);
}

.pte-q-option.pte-selected {
    border-color: var(--pte-primary);
    background: rgba(25, 103, 133, 0.08);
}

.pte-q-option-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

.pte-q-option.pte-selected .pte-q-option-radio {
    border-color: var(--pte-primary);
    background: var(--pte-primary);
}

.pte-q-option.pte-selected .pte-q-option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.pte-q-option-label { flex: 1; }

.pte-q-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* ─── Form Card ─── */
.pte-form-card {
    padding: 40px 32px;
    justify-content: center;
    text-align: left;
}

.pte-form-title {
    font-family: var(--pte-heading-font);
    font-size: 24px;
    color: var(--pte-title-color);
    margin: 0 0 4px;
    text-align: center;
}

.pte-form-subtitle {
    color: var(--pte-subtitle-color);
    font-size: 14px;
    text-align: center;
    margin: 0 0 28px;
}

.pte-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.pte-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pte-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pte-field-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--pte-label-color);
}

.pte-field-input {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: var(--pte-btn-radius);
    font-size: 14px;
    color: var(--pte-text);
    font-family: var(--pte-body-font);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    outline: none;
    width: 100%;
}

.pte-field-input:focus {
    border-color: var(--pte-primary);
    box-shadow: 0 0 0 3px rgba(25, 103, 133, 0.1);
    background: white;
}

.pte-form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-shrink: 0;
}

.pte-form-error {
    color: #ef4444;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
}

/* ─── Result Card ─── */
.pte-result-card {
    text-align: center;
    padding: 32px;
    justify-content: center;
    align-items: center;
    animation: pte-fade-in 0.4s ease;
}

.pte-result-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 32px;
}

.pte-icon-eligible { background: #d1fae5; color: #10b981; }
.pte-icon-maybe { background: #fef3c7; color: #f59e0b; }
.pte-icon-not-eligible { background: #fee2e2; color: #ef4444; }

.pte-result-title {
    font-family: var(--pte-heading-font);
    font-size: 24px;
    color: var(--pte-text);
    margin: 0 0 4px;
}

.pte-result-subtitle {
    font-size: 14px;
    color: var(--pte-subtitle-color);
    margin: 0 0 16px;
}

.pte-result-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.pte-result-summary-row {
    display: flex;
    align-items: stretch;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
    width: 100%;
}

.pte-result-summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.pte-summary-label {
    font-size: 11px;
    color: var(--pte-desc-color);
}

.pte-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--pte-primary);
}

.pte-result-summary-divider {
    width: 1px;
    background: #e2e8f0;
    align-self: stretch;
}

.pte-result-desc {
    font-size: 13px;
    color: var(--pte-subtitle-color);
    line-height: 1.6;
    margin: 0 0 20px;
}

.pte-result-cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.pte-result-cta .pte-cta-link {
    width: 100%;
}

.pte-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ─── Confetti z-index ─── */
canvas.confetti-canvas,
canvas[class*="confetti"] {
    z-index: 999999 !important;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .pte-container { padding: 20px 12px; }
    .pte-card {
        height: auto;
        min-height: 580px;
        max-height: none;
        border-radius: 16px;
    }
    .pte-intro-card { padding: 32px 20px; }
    .pte-intro-title { font-size: 26px; }
    .pte-intro-subtitle { font-size: 15px; }
    .pte-intro-desc { font-size: 13px; }
    .pte-questions-card { padding: 24px 18px; }
    .pte-q-text { font-size: 18px; }
    .pte-q-option { font-size: 14px; padding: 12px 14px; }
    .pte-form-card { padding: 28px 20px; }
    .pte-field-row { grid-template-columns: 1fr; }
    .pte-result-card { padding: 28px 20px; }
    .pte-result-actions { flex-direction: column; }
    .pte-result-actions .pte-btn-main,
    .pte-result-actions .pte-btn-secondary { width: 100%; }
}

/* ─── Popup Compatibility (Breakdance, Elementor, etc.) ─── */
.pte-container.pte-in-popup {
    padding: 16px 10px;
    max-width: 100%;
}

.pte-container.pte-in-popup .pte-card {
    height: auto;
    min-height: auto;
    max-height: none;
    box-shadow: none;
    border: none;
    border-radius: 12px;
    overflow-y: visible;
}

.pte-container.pte-in-popup .pte-q-options {
    overflow-y: visible;
    min-height: auto;
}

/* Popup Text Sizing — Intro */
.pte-container.pte-in-popup .pte-intro-card {
    padding: 28px 20px;
}
.pte-container.pte-in-popup .pte-intro-title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 8px;
}
.pte-container.pte-in-popup .pte-intro-subtitle {
    font-size: 15px;
    margin-bottom: 10px;
}
.pte-container.pte-in-popup .pte-intro-desc {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
}
.pte-container.pte-in-popup .pte-intro-features {
    gap: 14px;
    margin-bottom: 20px;
}
.pte-container.pte-in-popup .pte-feature {
    font-size: 12px;
    gap: 4px;
}
.pte-container.pte-in-popup .pte-feature-icon {
    font-size: 15px;
}
.pte-container.pte-in-popup .pte-intro-badge {
    font-size: 11px;
    padding: 4px 12px;
    margin-bottom: 14px;
}
.pte-container.pte-in-popup .pte-btn-main {
    padding: 10px 28px;
    font-size: 14px;
}
.pte-container.pte-in-popup .pte-btn-secondary {
    padding: 10px 22px;
    font-size: 14px;
}

/* Popup Text Sizing — Questions */
.pte-container.pte-in-popup .pte-questions-card {
    padding: 24px 18px;
}
.pte-container.pte-in-popup .pte-q-header {
    margin-bottom: 10px;
}
.pte-container.pte-in-popup .pte-q-counter {
    font-size: 12px;
}
.pte-container.pte-in-popup .pte-progress-bar-container {
    margin-bottom: 14px;
}
.pte-container.pte-in-popup .pte-q-text {
    font-size: 18px;
    margin-bottom: 16px;
}
.pte-container.pte-in-popup .pte-q-options {
    gap: 8px;
}
.pte-container.pte-in-popup .pte-q-option {
    padding: 10px 14px;
    font-size: 13px;
    gap: 8px;
    border-radius: 10px;
}
.pte-container.pte-in-popup .pte-q-option-radio {
    width: 18px;
    height: 18px;
}
.pte-container.pte-in-popup .pte-q-option.pte-selected .pte-q-option-radio::after {
    width: 6px;
    height: 6px;
}

/* Popup Text Sizing — Form */
.pte-container.pte-in-popup .pte-form-card {
    padding: 28px 20px;
}
.pte-container.pte-in-popup .pte-form-title {
    font-size: 22px;
    margin-bottom: 4px;
}
.pte-container.pte-in-popup .pte-form-subtitle {
    font-size: 13px;
    margin-bottom: 16px;
}
.pte-container.pte-in-popup .pte-field-label {
    font-size: 12px;
}
.pte-container.pte-in-popup .pte-field-input {
    padding: 10px 12px;
    font-size: 13px;
}
.pte-container.pte-in-popup .pte-field-row {
    gap: 10px;
}

/* Popup Text Sizing — Result */
.pte-container.pte-in-popup .pte-result-card {
    padding: 24px 18px;
}
.pte-container.pte-in-popup .pte-result-icon-wrap {
    width: 56px;
    height: 56px;
    font-size: 28px;
    margin-bottom: 10px;
}
.pte-container.pte-in-popup .pte-result-title {
    font-size: 20px;
    margin-bottom: 2px;
}
.pte-container.pte-in-popup .pte-result-subtitle {
    font-size: 12px;
    margin-bottom: 12px;
}
.pte-container.pte-in-popup .pte-result-badge {
    font-size: 11px;
    padding: 4px 12px;
    margin-bottom: 12px;
}
.pte-container.pte-in-popup .pte-result-summary-row {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}
.pte-container.pte-in-popup .pte-summary-label {
    font-size: 10px;
}
.pte-container.pte-in-popup .pte-summary-value {
    font-size: 22px;
}
.pte-container.pte-in-popup .pte-result-desc {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.pte-container.pte-in-popup .pte-result-actions {
    gap: 8px;
    flex-direction: column;
}
.pte-container.pte-in-popup .pte-result-actions .pte-btn-main,
.pte-container.pte-in-popup .pte-result-actions .pte-btn-secondary {
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    font-size: 13px;
}
