/* ==========================================
                 TEST PAGE
========================================== */

.testPage{

    width:calc(100% - 120px);
    max-width:1380px;

    margin:135px auto 70px;

}

.testScreen[hidden],
.testPage [hidden]{

    display:none !important;

}


/* ==========================================
                 PAGE HEADER
========================================== */

.testHeader{

    margin-bottom:30px;

}

.testEyebrow,
.sectionLabel,
.statusLabel,
.datasetStatusLabel{

    display:block;

    color:#839087;

    font-size:9px;
    font-weight:700;

    letter-spacing:2px;

    text-transform:uppercase;

}

.testHeader h1{

    margin:7px 0 8px;

    color:white;

    font-size:56px;
    line-height:1;

    letter-spacing:6px;

}

.testHeader p{

    margin:0;

    color:#99a49c;

    font-size:14px;
    letter-spacing:0.6px;

}


/* ==========================================
                  PANELS
========================================== */

.testPanel{

    border:1px solid #304c35;
    border-radius:14px;

    background:
        linear-gradient(
            145deg,
            rgba(14,21,15,0.97),
            rgba(7,11,8,0.97)
        );

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.03),
        0 16px 40px rgba(0,0,0,0.24);

}

.setupPanel{

    padding:28px;

}

.panelHeader{

    display:flex;
    align-items:flex-start;
    justify-content:space-between;

    gap:20px;

    margin-bottom:28px;

    padding-bottom:22px;

    border-bottom:1px solid #293b2d;

}

.panelHeader h2,
.questionAnswerSection h2,
.resultsPanel h2{

    margin:6px 0 0;

    color:#f1f4f2;

    font-size:28px;
    letter-spacing:1.5px;

}

/* ==========================================
                  SETUP GRID
========================================== */

.setupGrid{

    display:grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap:18px;

    margin-bottom:28px;

}

.setupControl{

    display:flex;
    flex-direction:column;

    gap:9px;

}

.setupControl label,
.difficultySection legend{

    color:#87948a;

    font-size:9px;
    font-weight:700;

    letter-spacing:1.8px;

    text-transform:uppercase;

}

.setupControl select{

    width:100%;
    height:50px;

    padding:0 15px;

    border:1px solid #3b5341;
    border-radius:8px;

    outline:none;

    background:#0b110c;
    color:#e3e9e4;

    font-family:inherit;
    font-size:12px;

    cursor:pointer;

    transition:
        border-color 0.2s,
        background 0.2s,
        box-shadow 0.2s;

}

.setupControl select:hover{

    border-color:#667e6b;

}

.setupControl select:focus{

    border-color:#9daf9f;

    background:#101812;

    box-shadow:
        0 0 0 3px rgba(157,175,159,0.1);

}

.setupControl option{

    background:#0b110c;
    color:white;

}

/* ==========================================
                DIFFICULTY
========================================== */

.difficultySection{

    margin:0;
    padding:0;

    border:0;

}

.difficultySection legend{

    margin-bottom:10px;

}

.difficultyGrid{

    display:grid;

    grid-template-columns:
        repeat(3, minmax(0,1fr));

    gap:14px;

}

.difficultyCard{

    position:relative;

    display:grid;

    grid-template-columns:auto 1fr;
    gap:14px;

    min-height:125px;

    padding:18px;

    border:1px solid #3a5140;
    border-radius:10px;

    background:#0c130e;

    cursor:pointer;

    transition:
        border-color 0.2s,
        background 0.2s,
        transform 0.2s;

}

.difficultyCard:hover{

    border-color:#718576;

    transform:translateY(-2px);

}

.difficultyCard.selected{

    border-color:#8aa08f;

    background:#152218;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.025);

}

.difficultyCard.locked{

    opacity:0.48;

    cursor:not-allowed;

}

.difficultyCard.locked:hover{

    transform:none;

    border-color:#3a5140;

}

.difficultyCard input{

    position:absolute;

    opacity:0;
    pointer-events:none;

}

.difficultyNumber{

    color:#607065;

    font-size:11px;
    font-weight:700;

    letter-spacing:1px;

}

.difficultyContent{

    display:flex;
    flex-direction:column;

    gap:8px;

}

.difficultyContent strong{

    color:#eef3ef;

    font-size:13px;

    letter-spacing:1.5px;

}

.difficultyContent span{

    color:#8a958d;

    font-size:11px;
    line-height:1.55;

}

.availabilityTag{

    position:absolute;

    right:13px;
    bottom:12px;

    color:#667269;

    font-size:8px;
    font-weight:700;

    letter-spacing:1.5px;

}


/* ==========================================
              DATASET STATUS
========================================== */

.datasetStatus{

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:20px;

    margin-top:22px;

    padding:16px 18px;

    border:1px solid #2c4031;
    border-radius:9px;

    background:rgba(7,12,8,0.72);

}

.datasetStatus strong{

    display:block;

    margin-top:5px;

    color:#dce5de;

    font-size:13px;
    letter-spacing:0.5px;

}

.datasetStatus > span{

    color:#7f8b82;

    font-size:11px;

}

.testError{

    margin-top:18px;

    padding:14px 16px;

    border:1px solid #82524e;
    border-radius:8px;

    background:#211311;
    color:#edc2bd;

    font-size:12px;
    line-height:1.5;

}


/* ==========================================
                  BUTTONS
========================================== */

.setupActions{

    display:flex;
    justify-content:flex-end;

    margin-top:24px;

}

.testPage button,
.testPage a.testSecondaryButton{

    width:auto;
    min-width:unset;
    max-width:none;

    margin:0;

    font-family:inherit;
    text-decoration:none;

    transform:none;

}

.testPrimaryButton,
.testSecondaryButton{

    display:inline-flex;
    align-items:center;
    justify-content:center;

    min-height:48px;

    padding:0 24px;

    border-radius:8px;

    font-size:11px;
    font-weight:700;

    letter-spacing:1.7px;
    text-transform:uppercase;

    cursor:pointer;

    transition:
        background 0.2s,
        border-color 0.2s,
        color 0.2s,
        transform 0.2s;

}

.testPrimaryButton{

    border:1px solid #77917c;

    background:#29432f;
    color:white;

}

.testPrimaryButton:hover{

    border-color:#a8b9ab;

    background:#36553e;

    transform:translateY(-2px);

}

.testSecondaryButton{

    border:1px solid #465a4a;

    background:#111a13;
    color:#cbd4cd;

}

.testSecondaryButton:hover{

    border-color:#7e9282;

    background:#1a271d;
    color:white;

    transform:translateY(-2px);

}


/* ==========================================
                QUIZ STATUS
========================================== */

.quizStatusBar{

    display:flex;
    align-items:flex-end;
    justify-content:space-between;

    gap:20px;

    margin-bottom:12px;

}

.quizStatusBar strong{

    display:block;

    margin-top:5px;

    color:#e5ebe6;

    font-size:14px;
    letter-spacing:1px;

}

.scoreDisplay{

    text-align:right;

}

.scoreDisplay strong{

    font-size:24px;

}

.progressTrack{

    width:100%;
    height:5px;

    margin-bottom:22px;

    overflow:hidden;

    border-radius:10px;

    background:#172019;

}

.progressFill{

    width:0;
    height:100%;

    border-radius:10px;

    background:#78917d;

    transition:width 0.3s ease;

}


/* ==========================================
               QUESTION PANEL
========================================== */

.questionPanel{

    display:grid;

    grid-template-columns:
        minmax(0,1.35fr)
        minmax(360px,0.85fr);

    overflow:hidden;

}

.questionImageSection{

    min-width:0;

    padding:22px;

    border-right:1px solid #2d4232;

}

.questionImageFrame{

    position:relative;

    width:100%;
    min-height:500px;
    height:100%;

    overflow:hidden;

    border:1px solid #3a5140;
    border-radius:10px;

    background:#060906;

}

.questionImageFrame img{

    display:block;

    width:100%;
    height:100%;

    min-height:500px;

    object-fit:cover;

}

.questionImageFallback{

    display:flex;

    align-items:center;
    justify-content:center;

    width:100%;
    min-height:500px;

    color:#59645c;

    font-size:11px;
    font-weight:700;

    letter-spacing:2px;

}

.questionAnswerSection{

    display:flex;
    flex-direction:column;

    padding:30px;

}

.questionInstruction{

    margin:9px 0 24px;

    color:#77847a;

    font-size:12px;

}


/* ==========================================
                 ANSWERS
========================================== */

.answerGrid{

    display:grid;

    grid-template-columns:1fr;

    gap:11px;

}

.answerButton{

    display:grid !important;

    grid-template-columns:42px minmax(0, 1fr) max-content;
    column-gap:6px;
    align-items:center;

    width:100% !important;

    min-height:58px;

    padding:8px 14px !important;

    border:1px solid #3b5140;
    border-radius:8px;

    background:#0d150f;
    color:#dfe6e0;

    text-align:left;

    cursor:pointer;

    transition:
        border-color 0.2s,
        background 0.2s,
        transform 0.2s;

}

.answerButton:hover:not(:disabled){

    border-color:#75897a;

    background:#17231a;

    transform:translateX(3px);

}

.answerButton:disabled{

    cursor:default;

}

.answerLetter{

    display:flex;

    align-items:center;
    justify-content:center;

    width:30px;
    height:30px;

    border:1px solid #425746;
    border-radius:6px;

    background:#141f16;

    color:#8e9b91;

    font-size:10px;
    font-weight:700;

}

.answerName{

    font-size:12px;
    font-weight:700;

    letter-spacing:0.8px;

}

.answerButton.correct{

    border-color:#718d77;

    background:#1a2c1f;

}

.answerButton.correct::after{

    content:"✓ CORRECT";

    color:#bcd1c0;

    font-size:8px;
    font-weight:700;

    letter-spacing:1.2px;

}

.answerButton.incorrect{

    border-color:#8c5752;

    background:#291715;

}

.answerButton.incorrect::after{

    content:"✕ SELECTED";

    color:#e0aaa4;

    font-size:8px;
    font-weight:700;

    letter-spacing:1.2px;

}


/* ==========================================
                 FEEDBACK
========================================== */

.answerFeedback{

    display:grid;

    grid-template-columns:auto 1fr;
    gap:13px;

    margin-top:18px;

    padding:15px;

    border:1px solid #435849;
    border-radius:8px;

    background:#101812;

}

.answerFeedback.correct{

    border-color:#647c69;

    background:#17251a;

}

.answerFeedback.incorrect{

    border-color:#774d49;

    background:#211412;

}

.feedbackIcon{

    display:flex;

    align-items:center;
    justify-content:center;

    width:32px;
    height:32px;

    border:1px solid currentColor;
    border-radius:50%;

    font-size:15px;
    font-weight:700;

}

.answerFeedback.correct .feedbackIcon{

    color:#b1c6b5;

}

.answerFeedback.incorrect .feedbackIcon{

    color:#dda19b;

}

.answerFeedback strong{

    color:#eef2ef;

    font-size:12px;

    letter-spacing:1px;

}

.answerFeedback p{

    margin:5px 0 0;

    color:#949f97;

    font-size:11px;
    line-height:1.5;

}

.nextQuestionButton{

    align-self:flex-end;

    margin-top:18px !important;

}


/* ==========================================
                  RESULTS
========================================== */

.resultsPanel{

    padding:34px;

    text-align:center;

}

.resultScoreBlock{

    display:flex;
    flex-direction:column;

    align-items:center;

    gap:7px;

    margin:30px 0;

}

.resultScoreBlock strong{

    color:white;

    font-size:58px;
    line-height:1;

    letter-spacing:3px;

}

.resultScoreBlock span{

    color:#91a195;

    font-size:20px;
    font-weight:700;

    letter-spacing:2px;

}

.resultStats{

    display:grid;

    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap:14px;

    margin-bottom:30px;

}

.resultStat{

    padding:20px;

    border:1px solid #33483a;
    border-radius:9px;

    background:#0c130e;

}

.resultStat span{

    display:block;

    color:#768279;

    font-size:8px;
    font-weight:700;

    letter-spacing:1.7px;

}

.resultStat strong{

    display:block;

    margin-top:9px;

    color:#e2e9e3;

    font-size:18px;

}

.reviewSection{

    margin-top:18px;

    padding-top:26px;

    border-top:1px solid #2d4032;

    text-align:left;

}

.reviewHeader h3{

    margin:6px 0 16px;

    color:#e7ece8;

    font-size:18px;
    letter-spacing:1px;

}

.reviewEmpty{

    padding:20px;

    border:1px solid #3b5140;
    border-radius:8px;

    background:#101912;
    color:#9eaaa1;

    text-align:center;

    font-size:12px;

}

.reviewItem{

    display:grid;

    grid-template-columns:1fr 1fr;
    gap:14px;

    margin-bottom:10px;

    padding:15px 17px;

    border:1px solid #3a4e3e;
    border-radius:8px;

    background:#0b120d;

}

.reviewItem span{

    display:block;

    color:#6f7b72;

    font-size:8px;
    font-weight:700;

    letter-spacing:1.4px;

}

.reviewItem strong{

    display:block;

    margin-top:5px;

    color:#dce4de;

    font-size:11px;

}

.resultActions{

    display:flex;
    flex-wrap:wrap;
    justify-content:center;

    gap:12px;

    margin-top:30px;

}


/* ==========================================
                 RESPONSIVE
========================================== */

@media(max-width:1050px){

    .questionPanel{

        grid-template-columns:1fr;

    }

    .questionImageSection{

        border-right:0;
        border-bottom:1px solid #2d4232;

    }

    .questionImageFrame,
    .questionImageFrame img,
    .questionImageFallback{

        min-height:420px;

    }

}


@media(max-width:850px){

    .testPage{

        width:calc(100% - 40px);

    }

    .difficultyGrid{

        grid-template-columns:1fr;

    }

    .resultStats{

        grid-template-columns:1fr;

    }

}


@media(max-width:650px){

    .testHeader h1{

        font-size:42px;

    }

    .setupGrid{

        grid-template-columns:1fr;

    }

    .panelHeader,
    .datasetStatus,
    .quizStatusBar{

        align-items:flex-start;
        flex-direction:column;

    .quizStatusActions{

        width:100%;

        justify-content:space-between;

    }

}

    .scoreDisplay{

        text-align:left;

    }

    .questionImageFrame,
    .questionImageFrame img,
    .questionImageFallback{

        min-height:300px;

    }

    .questionAnswerSection,
    .setupPanel,
    .resultsPanel{

        padding:20px;

    }

    .reviewItem{

        grid-template-columns:1fr;

    }

}

/* ==========================================
               QUIZ ACTIONS
========================================== */

.quizStatusActions{

    display:flex;
    align-items:center;

    gap:22px;

}

.quitTestButton{

    min-height:40px;

    padding:0 16px !important;

    border:1px solid #73504d;
    border-radius:7px;

    background:#1b1110;
    color:#d9aaa5;

    font-size:9px;
    font-weight:700;

    letter-spacing:1.4px;
    text-transform:uppercase;

    cursor:pointer;

    transition:
        border-color 0.2s,
        background 0.2s,
        color 0.2s,
        transform 0.2s;

}

.quitTestButton:hover{

    border-color:#a26c66;

    background:#2a1715;
    color:#f0c5c0;

    transform:translateY(-2px);

}

/* ==========================================
        DIFFICULT FIELD-MEDIA SUPPORT
========================================== */

#fieldDifficultyControl select:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.questionImageFrame video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 500px;
    object-fit: contain;
    background: #020302;
}

.questionSourceBadge {
    position: absolute;
    right: 16px;
    bottom: 16px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,0.17);
    border-radius: 6px;
    background: rgba(5,9,6,0.84);
    color: #aebcaf;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    backdrop-filter: blur(7px);
}

.questionImageFrame.fieldMediaActive {
    background:
        linear-gradient(
            135deg,
            rgba(20, 28, 21, 0.96),
            rgba(2, 3, 2, 0.98)
        );
}

.questionImageFrame.fieldMediaActive::after {
    content: "FIELD MEDIA";
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 8px;
    border: 1px solid rgba(188, 203, 191, 0.22);
    border-radius: 4px;
    background: rgba(2, 4, 3, 0.76);
    color: rgba(222, 232, 224, 0.7);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    pointer-events: none;
}

@media(max-width:1050px){
    .questionImageFrame video {
        min-height: 420px;
    }
}

@media(max-width:850px){
    .questionImageFrame video {
        min-height: 300px;
    }
    .questionSourceBadge {
        bottom: 10px;
        padding: 6px 8px;
        font-size: 8px;
    }
    .questionSourceBadge {
        right: 10px;
    }
}
/* Keep ✓ CORRECT / × SELECTED on the answer's first line */
.answerButton.correct::after,
.answerButton.incorrect::after {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    white-space: nowrap;
    margin-left: 5px;
}
.answerButton .answerName { min-width: 0; overflow-wrap: anywhere; }
