/* Styling for the NEW interactive practice / mock / road sign / hazard perception tests.
   Scoped under .interactive-mcq-test / .interactive-hp-test so it cannot affect anything
   else on the page. */

/* Leave a gap at the top when the engine scrolls to the panel (start / next question /
   results), so it doesn't sit flush against the top of the viewport. */
.interactive-mcq-test,
.interactive-hp-test {
    scroll-margin-top: 20px;
}

/* ---------- Progress bar ---------- */
.interactive-mcq-test .imt-progress-bar-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.interactive-mcq-test .imt-progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background-color: #2975bc;
    transition: width 0.25s ease;
}

/* ---------- Answer buttons ---------- */
.interactive-mcq-test .imt-answer {
    gap: 12px;
    font-weight: 600;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    color: #343a40;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.interactive-mcq-test .imt-answer:hover:not(:disabled) {
    border-color: #2975bc;
    box-shadow: 0 0 0 1px #2975bc inset;
}

.interactive-mcq-test .imt-answer:disabled {
    cursor: default;
}

.interactive-mcq-test .imt-answer-marker {
    flex: 0 0 auto;
    height: 25px;
    width: 25px;
    border-radius: 50%;
    border: 3px solid #ced4da;
    background-color: #fff;
}

.interactive-mcq-test .imt-answer-body {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.interactive-mcq-test .imt-answer-image {
    max-height: 90px;
    width: auto;
}

/* Answered states */
.interactive-mcq-test .imt-answer.imt-correct {
    border-color: #2e7d32;
    background-color: #eaf5ea;
}

.interactive-mcq-test .imt-answer.imt-correct .imt-answer-marker {
    border-color: #2e7d32;
    background-color: #2e7d32;
    box-shadow: inset 0 0 0 3px #fff;
}

.interactive-mcq-test .imt-answer.imt-incorrect {
    border-color: #c62828;
    background-color: #fbeaea;
}

.interactive-mcq-test .imt-answer.imt-incorrect .imt-answer-marker {
    border-color: #c62828;
    background-color: #c62828;
    box-shadow: inset 0 0 0 3px #fff;
}

/* ---------- Results screen ---------- */
/* A clean, centred results "hero" (score ring + verdict) followed by the upsell,
   rather than nested cards-in-cards. */
.interactive-mcq-test .imt-results-hero,
.interactive-hp-test .imt-results-hero {
    text-align: center;
    padding: 1.75rem 1.25rem;
    border-radius: 0.5rem;
    background-color: #f4f7fb;
}

.interactive-mcq-test .imt-verdict-pass,
.interactive-hp-test .imt-verdict-pass {
    background-color: #eaf5ea;
}

.interactive-mcq-test .imt-verdict-fail,
.interactive-hp-test .imt-verdict-fail {
    background-color: #fff4e5;
}

/* Circular score badge */
.interactive-mcq-test .imt-score-badge,
.interactive-hp-test .imt-score-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background-color: #fff;
    border: 5px solid #adb5bd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.imt-verdict-pass .imt-score-badge { border-color: #2e7d32; }
.imt-verdict-fail .imt-score-badge { border-color: #e8821e; }

.interactive-mcq-test .imt-score-big,
.interactive-hp-test .imt-score-big {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: #343a40;
}

.interactive-mcq-test .imt-score-pct,
.interactive-hp-test .imt-score-pct {
    font-size: 0.95rem;
    font-weight: 600;
    color: #6c757d;
    margin-top: 2px;
}

/* Upsell sits below the hero, separated by a rule rather than nested in a card */
.interactive-mcq-test .imt-upsell,
.interactive-hp-test .imt-upsell {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.interactive-mcq-test .imt-results-actions,
.interactive-hp-test .imt-results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Centre the results action buttons on mobile */
@media (max-width: 575.98px) {
    .interactive-mcq-test .imt-results-actions,
    .interactive-hp-test .imt-results-actions {
        justify-content: center;
    }
}

/* ---------- Dev helper buttons (only rendered on whitelisted domains) ---------- */
.imt-devtools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px dashed #c62828;
    border-radius: 0.4rem;
    background-color: rgba(198, 40, 40, 0.05);
}

.imt-devtools-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #c62828;
}

.imt-devtools-btn {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border: 1px solid #c62828;
    border-radius: 0.3rem;
    background-color: #fff;
    color: #c62828;
    cursor: pointer;
}

.imt-devtools-btn:hover {
    background-color: #c62828;
    color: #fff;
}

/* ---------- Hazard perception player ---------- */
.interactive-hp-test .hp-video-wrap {
    position: relative;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
    line-height: 0;
}

.interactive-hp-test .hp-video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    /* stop the browser turning taps into selection / context menus */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Full-surface flash that briefly appears each time the user clicks. */
.interactive-hp-test .hp-click-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 6px solid rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    opacity: 0;
    pointer-events: none;
}

.interactive-hp-test .hp-click-flash.hp-click-flash-on {
    animation: hpClickFlash 0.35s ease-out;
}

@keyframes hpClickFlash {
    0% { opacity: 0.9; }
    100% { opacity: 0; }
}

.interactive-hp-test .hp-status {
    font-weight: 600;
}

/* Flag bar - fills with a flag each time the user clicks (DVSA-style) */
.interactive-hp-test .hp-flag-bar {
    min-height: 36px;
    background-color: #1f2937;
    border-radius: 0.4rem;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    overflow: hidden;
}

.interactive-hp-test .hp-flag {
    color: #ff5f33;
    font-size: 1.1rem;
    line-height: 1;
    animation: hpFlagPop 0.2s ease-out;
}

@keyframes hpFlagPop {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
