/* ==========================================================================
   Mon Examen Civique — diagnostic "Testez votre niveau" (refonte v2)
   Onboarding + choix du titre + résultat. Dépend de tokens.css et
   home-v2.css (chrome de page, boutons .v2-btn).
   Le quiz de positionnement lui-même est stylé par quiz-v2.css (mêmes
   composants .option-btn / .feedback-panel que le quiz réel).
   ========================================================================== */

.pv2-shell {
    max-width: 640px;
    margin-inline: auto;
    padding-block: clamp(2rem, 6vw, 4rem) 4rem;
    padding-inline: var(--v2-pad-x);
}

.pv2-shell.rpv2-shell {
    max-width: 1040px;
}

/* --- Onboarding : écran d'intro ------------------------------------------- */

.pv2-intro {
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    padding: clamp(1.75rem, 5vw, 2.75rem);
    text-align: center;
    box-shadow: var(--v2-shadow-lift);
    transition: opacity var(--v2-duration-slow) var(--v2-ease-out),
                transform var(--v2-duration-slow) var(--v2-ease-out);
}

.pv2-intro__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--v2-blue-tint-2);
    color: var(--v2-blue);
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-lg);
}

.pv2-intro__label {
    display: block;
    font-size: var(--v2-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--v2-ink-3);
    margin-bottom: 1.25rem;
}

.pv2-intro h1 {
    font-size: var(--v2-text-2xl);
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.pv2-intro__desc {
    color: var(--v2-ink-2);
    font-size: var(--v2-text-base);
    max-width: 30rem;
    margin: 0 auto 1.5rem;
}

.pv2-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 1.75rem;
}

.pv2-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.4375rem 0.875rem;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-pill);
    font-size: var(--v2-text-xs);
    font-weight: 600;
    color: var(--v2-ink-2);
}

/* --- Onboarding : écran des questions -------------------------------------- */

.pv2-questions {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--v2-duration-slow) var(--v2-ease-out),
                transform var(--v2-duration-slow) var(--v2-ease-out);
}

.pv2-questions.visible {
    opacity: 1;
    transform: translateY(0);
}

.pv2-segments {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.pv2-segments .segment {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--v2-rail);
    overflow: hidden;
}

.pv2-segments .segment::after {
    content: "";
    display: block;
    height: 100%;
    width: 0%;
    background: var(--v2-blue);
    border-radius: 4px;
    transition: width var(--v2-duration-slow) var(--v2-ease-out);
}

.pv2-segments .segment.active::after,
.pv2-segments .segment.done::after {
    width: 100%;
}

.pv2-segments .segment.done::after {
    background: var(--v2-success);
}

.pv2-step-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.pv2-step-label__tag {
    font-size: var(--v2-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--v2-blue);
}

.pv2-step-label__count {
    font-size: var(--v2-text-xs);
    color: var(--v2-ink-3);
}

.pv2-question-area {
    transition: opacity var(--v2-duration-base) ease;
}

.pv2-question-area.fade-out {
    opacity: 0;
}

.pv2-q-title {
    font-size: var(--v2-text-xl);
    line-height: 1.35;
    margin-bottom: 1.5rem;
}

.pv2-choices {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.75rem;
}

.choice-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 0.9375rem 1.125rem;
    background: var(--v2-white);
    border: 1.5px solid var(--v2-border);
    border-radius: var(--v2-radius-sm);
    font: inherit;
    font-size: var(--v2-text-base);
    text-align: left;
    color: var(--v2-ink-2);
    cursor: pointer;
    transition: border-color var(--v2-duration-base) var(--v2-ease-out),
                background var(--v2-duration-base) var(--v2-ease-out),
                color var(--v2-duration-base) var(--v2-ease-out);
}

.choice-card:hover {
    border-color: var(--v2-blue);
    background: var(--v2-blue-tint);
    color: var(--v2-ink);
}

.choice-card.selected {
    border-color: var(--v2-blue);
    background: var(--v2-blue-tint);
    color: var(--v2-ink);
    font-weight: 600;
}

.choice-card .choice-icon {
    display: flex;
    flex: none;
    color: var(--v2-blue);
}

.pv2-nav {
    display: flex;
}

.pv2-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0;
    background: none;
    border: none;
    font: inherit;
    font-size: var(--v2-text-sm);
    font-weight: 600;
    color: var(--v2-ink-2);
    cursor: pointer;
}

.pv2-btn-back:hover {
    color: var(--v2-blue);
}

/* --- Choix du titre --------------------------------------------------------- */

.pv2-choix-head {
    text-align: center;
    margin-bottom: 2.5rem;
}

.pv2-choix-head h1 {
    font-size: var(--v2-text-2xl);
    margin-top: 0.75rem;
}

.pv2-choix-head p {
    color: var(--v2-ink-2);
    margin-top: 0.625rem;
}

.pv2-exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.exam-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    padding: 1.5rem;
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    cursor: pointer;
    font: inherit;
    transition: transform var(--v2-duration-base) var(--v2-ease-out),
                box-shadow var(--v2-duration-base) var(--v2-ease-out),
                border-color var(--v2-duration-base) var(--v2-ease-out);
}

.exam-card:hover {
    transform: translateY(-3px);
    border-color: var(--v2-border-soft);
    box-shadow: var(--v2-shadow-lift);
}

.exam-card:active {
    transform: translateY(-1px);
}

.exam-card .card-code {
    font-size: var(--v2-text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--v2-ink-3);
}

.exam-card .custom-icon {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: var(--v2-blue);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.exam-card .card-title {
    font-family: var(--v2-font-title);
    font-size: var(--v2-text-lg);
    font-weight: 700;
    color: var(--v2-ink);
}

.exam-card .card-desc {
    font-size: var(--v2-text-sm);
    color: var(--v2-ink-2);
    line-height: 1.5;
}

.pv2-cancel {
    text-align: center;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--v2-ink-3);
    font-size: var(--v2-text-sm);
    font-weight: 600;
    text-decoration: none;
}

.btn-cancel:hover {
    color: var(--v2-ink);
}

/* --- Résultat --------------------------------------------------------------- */

.rpv2-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--v2-shadow-lift);
}

.rpv2-ring {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 4px solid var(--v2-blue-tint-2);
    background: var(--v2-blue-tint);
}

.rpv2-hero.not-ready .rpv2-ring {
    border-color: var(--v2-red-tint);
    background: var(--v2-red-tint);
}

.rpv2-ring__val {
    font-family: var(--v2-font-title);
    font-size: var(--v2-text-2xl);
    font-weight: 700;
    color: var(--v2-blue);
}

.rpv2-hero.not-ready .rpv2-ring__val {
    color: var(--v2-red);
}

.rpv2-hero__body {
    flex: 1;
    min-width: 0;
}

.rpv2-level {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--v2-radius-pill);
    background: var(--v2-blue-tint-2);
    color: var(--v2-blue);
    font-size: var(--v2-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.rpv2-hero.not-ready .rpv2-level {
    background: var(--v2-red-tint);
    color: var(--v2-red);
}

.rpv2-threshold {
    font-size: var(--v2-text-sm);
    color: var(--v2-ink-2);
}

.rpv2-diag {
    margin: 1.25rem 0 0;
    padding-top: 1.125rem;
    border-top: 1px solid var(--v2-border);
    font-size: var(--v2-text-sm);
    color: var(--v2-ink-2);
    line-height: 1.6;
}

.rpv2-urgent {
    margin-top: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--v2-radius-sm);
    background: var(--v2-red-tint);
    color: var(--v2-red);
    font-size: var(--v2-text-sm);
    font-weight: 600;
}

.rpv2-themes {
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
}

.rpv2-product-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.rpv2-summary-card {
    padding: 1.35rem;
    border: 1px solid #dfe6f1;
    border-radius: 8px;
    background: #fff;
}

.rpv2-summary-card--pro {
    background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
    border-color: rgba(6, 43, 120, 0.18);
}

.rpv2-summary-card__kicker {
    display: inline-flex;
    color: #ef1d2d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rpv2-summary-card h2 {
    margin-top: 0.65rem;
    color: #172033;
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    line-height: 1.1;
    letter-spacing: 0;
}

.rpv2-summary-card p {
    margin: 0.75rem 0 0;
    color: #667085;
    font-size: var(--v2-text-sm);
    line-height: 1.6;
}

.rpv2-themes__title {
    font-size: var(--v2-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--v2-ink-3);
    margin-bottom: 0.5rem;
}

.rp-cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--v2-border);
}

.rp-cat:last-child {
    border-bottom: none;
}

.rp-cat-name {
    font-weight: 600;
    color: var(--v2-ink);
    font-size: var(--v2-text-sm);
}

.rp-cat-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: none;
}

.rp-cat-score {
    font-size: var(--v2-text-xs);
    color: var(--v2-ink-3);
    font-variant-numeric: tabular-nums;
}

.rp-badge {
    padding: 0.1875rem 0.625rem;
    border-radius: var(--v2-radius-pill);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rp-badge.ok {
    background: var(--v2-success-tint);
    color: var(--v2-success);
}

.rp-badge.ko {
    background: var(--v2-red-tint);
    color: var(--v2-red);
}

.rpv2-offers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.rpv2-offers.single {
    grid-template-columns: 1fr;
    max-width: 26rem;
    margin-inline: auto;
}

.rp-offer {
    display: flex;
    flex-direction: column;
    background: var(--v2-white);
    border: 1.5px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 1.5rem 1.375rem;
}

.rp-offer.hl {
    border-color: var(--v2-red);
    background: var(--v2-red-tint);
}

.rp-offer-tag {
    align-self: flex-start;
    padding: 0.25rem 0.625rem;
    border-radius: var(--v2-radius-pill);
    background: var(--v2-red);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.rp-offer-title {
    font-family: var(--v2-font-title);
    font-weight: 700;
    font-size: var(--v2-text-lg);
    color: var(--v2-ink);
    margin-bottom: 0.5rem;
}

.rp-offer-desc {
    font-size: var(--v2-text-sm);
    color: var(--v2-ink-2);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.rp-offer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--v2-tap);
    padding: 0.75rem 1.5rem;
    border-radius: var(--v2-radius-sm);
    font-weight: 600;
    font-size: var(--v2-text-sm);
    text-decoration: none;
    text-align: center;
    transition: background-color var(--v2-duration-base) var(--v2-ease-out),
                box-shadow var(--v2-duration-base) var(--v2-ease-out);
}

.rp-offer-btn:active {
    box-shadow: inset 0 1px 3px rgba(23, 33, 43, 0.16);
}

.rp-offer.hl .rp-offer-btn {
    background: var(--v2-red);
    color: #fff;
}

.rp-offer.hl .rp-offer-btn:hover {
    background: #862327;
}

.rp-offer:not(.hl) .rp-offer-btn {
    background: var(--v2-blue);
    color: #fff;
}

.rp-offer:not(.hl) .rp-offer-btn:hover {
    background: var(--v2-blue-dark);
}

.rpv2-contact {
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    padding: 1.75rem;
}

.rpv2-contact__title {
    font-family: var(--v2-font-title);
    font-size: var(--v2-text-lg);
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.375rem;
}

.rpv2-contact__sub {
    text-align: center;
    color: var(--v2-ink-3);
    font-size: var(--v2-text-sm);
    margin-bottom: 1.5rem;
}

.rpv2-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.rpv2-form-row.full {
    grid-template-columns: 1fr;
}

.rpv2-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--v2-border);
    border-radius: var(--v2-radius-sm);
    font: inherit;
    font-size: 1rem;
    color: var(--v2-ink);
    background: var(--v2-white);
    transition: border-color var(--v2-duration-base) var(--v2-ease-out);
}

.rpv2-input:focus {
    outline: none;
    border-color: var(--v2-blue);
}

.rpv2-submit {
    width: 100%;
    margin-top: 0.25rem;
}

.rpv2-success {
    background: var(--v2-white);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    padding: 2rem;
    text-align: center;
}

.rpv2-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--v2-success-tint);
    color: var(--v2-success);
    margin-bottom: 0.875rem;
}

.rpv2-success h3 {
    font-size: var(--v2-text-lg);
    margin-bottom: 0.5rem;
}

.rpv2-success p {
    color: var(--v2-ink-2);
    font-size: var(--v2-text-sm);
    margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
    .rpv2-hero { flex-direction: column; text-align: center; }
    .rpv2-product-summary { grid-template-columns: 1fr; }
    .rpv2-offers { grid-template-columns: 1fr; }
    .rp-cat { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
    .rp-cat-right { width: 100%; justify-content: space-between; }
    .rpv2-form-row { grid-template-columns: 1fr; }
}

/* --- Quiz de positionnement : minuteur + garde-fou anti-triche ------------- */

.pv2-timer.warning {
    color: var(--v2-red);
}

.pv2-timer.danger {
    color: var(--v2-red);
    animation: pv2-pulse 1s infinite;
}

@media (prefers-reduced-motion: reduce) {
    .pv2-timer.danger { animation: none; }
}

@keyframes pv2-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pv2-pause-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(11, 46, 76, 0.97);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.pv2-pause-overlay.active {
    display: flex;
}

.pv2-pause-overlay__inner {
    max-width: 26rem;
}

.pv2-pause-overlay h2 {
    color: #fff;
    font-size: var(--v2-text-2xl);
    margin-bottom: 0.75rem;
}

.pv2-pause-overlay p {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.pv2-pause-overlay .v2-btn--primary {
    background: var(--v2-red);
}

.pv2-pause-overlay .v2-btn--primary:hover {
    background: #862327;
}
