.trainer-body {
    min-height: 100%;
}

.trainer-header {
    border-bottom: 1px solid var(--border);
    background: rgba(7,16,29,.82);
    backdrop-filter: blur(14px);
}

.trainer-header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.trainer-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.header-driving-link {
    color: var(--muted);
    font-weight: 800;
    font-size: 14px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.header-driving-link:hover {
    color: white;
    border-color: rgba(255,255,255,.24);
}

.trainer-main {
    padding: 46px 0 90px;
}

.screen-hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}


/* HERO */

.trainer-hero {
    display: grid;
    grid-template-columns: minmax(0,1fr) 300px;
    gap: 30px;
    align-items: stretch;
}

.trainer-hero-copy {
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 44px;
    background:
        radial-gradient(
            circle at 85% 10%,
            rgba(74,163,255,.17),
            transparent 19rem
        ),
        rgba(255,255,255,.025);
}

.trainer-title {
    max-width: 720px;
    margin-bottom: 18px;
}

.trainer-intro {
    color: var(--muted);
    max-width: 720px;
    font-size: 18px;
    line-height: 1.65;
}

.hero-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.trainer-btn {
    min-height: 50px;
    border-radius: 13px;
    padding: 0 20px;
    border: 0;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    transition:
        transform .15s ease,
        background .15s ease,
        border-color .15s ease;
}

.trainer-btn:hover {
    transform: translateY(-2px);
}

.trainer-btn-primary {
    background: var(--blue);
    color: #07101d;
}

.trainer-btn-outline {
    color: var(--text);
    border: 1px solid var(--border);
    background: rgba(255,255,255,.035);
}

.readiness-card {
    border-radius: 26px;
    border: 1px solid var(--border);
    background:
        linear-gradient(
            160deg,
            rgba(255,213,74,.08),
            rgba(255,255,255,.025)
        );
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.readiness-label {
    font-size: 12px;
    font-weight: 900;
    color: var(--muted);
    letter-spacing: .12em;
}

.readiness-ring-wrap {
    margin: 22px 0 18px;
}

.readiness-ring {
    width: 154px;
    height: 154px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        conic-gradient(
            var(--blue) 0deg,
            rgba(255,255,255,.10) 0deg
        );
    position: relative;
}

.readiness-ring::after {
    content: "";
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    background: #101b2b;
}

.readiness-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: baseline;
}

.readiness-inner span {
    font-size: 48px;
    font-weight: 950;
    letter-spacing: -.04em;
}

.readiness-inner small {
    font-size: 17px;
    color: var(--muted);
    margin-left: 3px;
}

.readiness-message {
    color: var(--muted);
    line-height: 1.45;
    font-size: 14px;
    text-align: center;
}


/* DASHBOARD STATS */

.dashboard-stats {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.dash-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: rgba(255,255,255,.025);
}

.dash-stat-icon {
    font-size: 25px;
}

.dash-stat strong {
    display: block;
    font-size: 24px;
}

.dash-stat span:not(.dash-stat-icon) {
    display: block;
    color: var(--muted);
    font-size: 12px;
}


/* SECTIONS */

.trainer-section {
    margin-top: 65px;
}

.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 23px;
}

.section-heading-row h2 {
    margin: 6px 0 0;
    font-size: 34px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.mode-card {
    color: var(--text);
    text-align: left;
    min-height: 320px;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.028);
    cursor: pointer;
    font: inherit;
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.mode-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,.052);
    border-color: rgba(74,163,255,.35);
}

.mode-icon {
    font-size: 42px;
    min-height: 66px;
    display: flex;
    align-items: center;
}

.mode-art {
    min-height: 66px;
}

.mini-stop-sign {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    color: white;
    background: #cb2e32;
    font-size: 12px;
    font-weight: 950;
    clip-path: polygon(
        30% 0,
        70% 0,
        100% 30%,
        100% 70%,
        70% 100%,
        30% 100%,
        0 70%,
        0 30%
    );
}

.mode-label {
    color: var(--blue);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    margin-top: 9px;
}

.mode-card h3 {
    margin: 8px 0 12px;
    font-size: 23px;
}

.mode-card p {
    min-height: 85px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

.mode-action {
    display: block;
    margin-top: 18px;
    color: var(--blue);
    font-weight: 900;
    font-size: 14px;
}


/* TOPICS */

.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
}

.topic-card {
    border: 1px solid var(--border);
    border-radius: 17px;
    background: rgba(255,255,255,.024);
    padding: 19px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: .18s ease;
}

.topic-card:hover {
    transform: translateY(-2px);
    border-color: rgba(74,163,255,.32);
}

.topic-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topic-icon {
    font-size: 25px;
}

.topic-score {
    color: var(--yellow);
    font-size: 12px;
    font-weight: 900;
}

.topic-card h3 {
    margin: 15px 0 5px;
    font-size: 18px;
}

.topic-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}


/* ACHIEVEMENTS */

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;
}

.achievement-card {
    min-height: 155px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    background: rgba(255,255,255,.024);
    opacity: .45;
}

.achievement-card.unlocked {
    opacity: 1;
    border-color: rgba(255,213,74,.32);
    background:
        linear-gradient(
            145deg,
            rgba(255,213,74,.08),
            rgba(255,255,255,.024)
        );
}

.achievement-card .achievement-icon {
    font-size: 30px;
    filter: grayscale(1);
}

.achievement-card.unlocked .achievement-icon {
    filter: none;
}

.achievement-card strong {
    display: block;
    margin-top: 12px;
}

.achievement-card span {
    display: block;
    color: var(--muted);
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.45;
}

.source-note {
    margin-top: 60px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    background: rgba(255,255,255,.023);
    display: flex;
    gap: 16px;
}

.source-note-icon {
    font-size: 28px;
}

.source-note p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 13px;
}


/* QUIZ */

.quiz-topbar {
    display: grid;
    grid-template-columns: 110px 1fr 110px;
    align-items: center;
    gap: 15px;
}

.back-button {
    min-height: 42px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.quiz-topbar-center {
    text-align: center;
}

.quiz-mode {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.quiz-progress-text {
    color: var(--muted);
    margin-top: 3px;
    font-size: 12px;
}

.streak-pill {
    justify-self: end;
    min-width: 88px;
    text-align: center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.025);
    font-weight: 900;
}

.quiz-progress-track {
    margin-top: 20px;
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
}

.quiz-progress-fill {
    height: 100%;
    width: 0;
    background:
        linear-gradient(
            90deg,
            var(--blue),
            #77c5ff
        );
    transition: width .25s ease;
}

.question-layout {
    display: grid;
    grid-template-columns: 205px minmax(0,1fr);
    gap: 22px;
    margin-top: 28px;
    align-items: start;
}

.question-sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-score,
.sidebar-category,
.sidebar-tip {
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 17px;
    background: rgba(255,255,255,.025);
}

.sidebar-category,
.sidebar-tip {
    margin-top: 11px;
}

.sidebar-score small,
.sidebar-category small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .1em;
    font-weight: 900;
}

.sidebar-score strong {
    display: block;
    font-size: 32px;
    margin-top: 5px;
}

.sidebar-category span {
    display: block;
    color: var(--yellow);
    font-weight: 800;
    margin-top: 6px;
}

.sidebar-tip {
    color: var(--muted);
    line-height: 1.5;
    font-size: 12px;
}

.question-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(255,255,255,.028);
    padding: 35px;
}

.question-number {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.question-text {
    font-size: clamp(24px,4vw,36px);
    line-height: 1.15;
    margin: 10px 0 27px;
    max-width: 800px;
}

.answer-list {
    display: grid;
    gap: 11px;
}

.answer-button {
    min-height: 60px;
    width: 100%;
    text-align: left;
    color: var(--text);
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
    cursor: pointer;
    font: inherit;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 14px;
    transition:
        transform .12s ease,
        border-color .12s ease,
        background .12s ease;
}

.answer-button:hover:not(:disabled) {
    transform: translateX(3px);
    border-color: rgba(74,163,255,.38);
    background: rgba(74,163,255,.07);
}

.answer-letter {
    flex: 0 0 auto;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    font-weight: 900;
    color: var(--muted);
}

.answer-button.correct {
    border-color: rgba(65,209,125,.6);
    background: rgba(65,209,125,.11);
}

.answer-button.correct .answer-letter {
    border-color: rgba(65,209,125,.6);
    color: #65e99a;
}

.answer-button.wrong {
    border-color: rgba(255,91,91,.62);
    background: rgba(255,91,91,.10);
}

.answer-button.wrong .answer-letter {
    border-color: rgba(255,91,91,.62);
    color: #ff8181;
}

.answer-button:disabled {
    cursor: default;
}

.feedback-box {
    margin-top: 19px;
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.024);
}

.feedback-heading {
    font-weight: 950;
    font-size: 17px;
}

.feedback-heading.good {
    color: #65e99a;
}

.feedback-heading.bad {
    color: #ff8d8d;
}

.feedback-copy {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.55;
}

.next-button {
    margin-top: 18px;
}


/* SIGN GRAPHICS */

.sign-graphic-area {
    min-height: 180px;
    margin-bottom: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sign-shape {
    display: grid;
    place-items: center;
    text-align: center;
    font-weight: 950;
    color: #111;
}

.sign-stop {
    width: 135px;
    height: 135px;
    color: white;
    background: #c92f34;
    border: 7px solid white;
    outline: 2px solid #c92f34;
    clip-path: polygon(
        30% 0,
        70% 0,
        100% 30%,
        100% 70%,
        70% 100%,
        30% 100%,
        0 70%,
        0 30%
    );
    font-size: 25px;
}

.sign-diamond {
    width: 118px;
    height: 118px;
    background: #f2c230;
    border: 5px solid #111;
    border-radius: 7px;
    transform: rotate(45deg);
}

.sign-diamond span {
    transform: rotate(-45deg);
    font-size: 15px;
    max-width: 88px;
}

.sign-yield-wrap {
    width: 155px;
    height: 145px;
    display: grid;
    place-items: center;
}

.sign-yield {
    width: 0;
    height: 0;
    border-left: 72px solid transparent;
    border-right: 72px solid transparent;
    border-top: 126px solid #d02d33;
    position: relative;
}

.sign-yield::after {
    content: "";
    position: absolute;
    top: -115px;
    left: -59px;
    border-left: 59px solid transparent;
    border-right: 59px solid transparent;
    border-top: 103px solid white;
}

.sign-yield-label {
    position: absolute;
    top: -89px;
    left: -27px;
    z-index: 3;
    font-size: 13px;
    font-weight: 950;
    color: #c92f34;
}

.sign-rectangle {
    min-width: 125px;
    min-height: 90px;
    padding: 13px 15px;
    border: 5px solid #111;
    background: white;
    color: #111;
    font-size: 17px;
}

.sign-school {
    width: 135px;
    height: 128px;
    padding-top: 34px;
    background: #d8ef48;
    clip-path: polygon(
        50% 0,
        100% 38%,
        82% 100%,
        18% 100%,
        0 38%
    );
    border: 0;
}

.sign-no {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 10px solid #cf3037;
    background: white;
    position: relative;
    color: #111;
}

.sign-no::after {
    content: "";
    position: absolute;
    width: 135px;
    height: 10px;
    background: #cf3037;
    transform: rotate(-45deg);
}

.sign-no span {
    z-index: 2;
    font-size: 14px;
}

.pavement-graphic {
    width: min(100%,480px);
    min-height: 165px;
    background: #3e434a;
    border-radius: 13px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.road-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 7px;
}

.road-line-yellow {
    background: #ffd632;
}

.road-line-white {
    background: white;
}

.road-line-broken {
    background:
        repeating-linear-gradient(
            to bottom,
            currentColor 0 27px,
            transparent 27px 46px
        );
}


/* RESULTS */

.result-card {
    max-width: 720px;
    margin: 20px auto 0;
    border: 1px solid var(--border);
    border-radius: 26px;
    background:
        radial-gradient(
            circle at top,
            rgba(74,163,255,.12),
            transparent 25rem
        ),
        rgba(255,255,255,.025);
    padding: 46px;
    text-align: center;
}

.result-icon {
    font-size: 56px;
}

.result-title {
    margin: 9px 0 10px;
    font-size: clamp(39px,6vw,62px);
}

.result-copy {
    max-width: 580px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.6;
}

.result-score-circle {
    margin: 30px auto;
    width: 150px;
    height: 150px;
    border: 9px solid rgba(74,163,255,.35);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-score-circle strong {
    font-size: 39px;
}

.result-score-circle span {
    color: var(--muted);
    font-size: 12px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 11px;
}

.result-stats div {
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 13px;
}

.result-stats strong {
    display: block;
    font-size: 24px;
}

.result-stats span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.result-actions {
    margin-top: 27px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 11px;
}

.exam-breakdown {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: left;
    color: var(--muted);
    line-height: 1.6;
}

.exam-breakdown strong {
    color: white;
}


/* TOAST */

.achievement-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    max-width: 340px;
    border: 1px solid rgba(255,213,74,.35);
    border-radius: 17px;
    background: #152136;
    padding: 17px 19px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 100;
    box-shadow: 0 14px 45px rgba(0,0,0,.35);
}

.achievement-toast-icon {
    font-size: 32px;
}

.achievement-toast small {
    display: block;
    color: var(--yellow);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .1em;
}

.achievement-toast strong {
    display: block;
    margin-top: 4px;
}


/* MOBILE */

@media (max-width: 980px) {

    .trainer-hero {
        grid-template-columns: 1fr;
    }

    .readiness-card {
        min-height: 300px;
    }

    .mode-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .achievement-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .topic-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .question-layout {
        grid-template-columns: 1fr;
    }

    .question-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sidebar-category {
        margin-top: 0;
    }

    .sidebar-tip {
        grid-column: 1 / -1;
        margin-top: 0;
    }
}

@media (max-width: 680px) {

    .trainer-main {
        padding-top: 25px;
    }

    .header-driving-link {
        display: none;
    }

    .trainer-hero-copy {
        padding: 27px 22px;
    }

    .trainer-title {
        font-size: 46px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2,1fr);
    }

    .mode-grid,
    .topic-grid,
    .achievement-grid {
        grid-template-columns: 1fr;
    }

    .mode-card {
        min-height: auto;
    }

    .mode-card p {
        min-height: 0;
    }

    .quiz-topbar {
        grid-template-columns: 74px 1fr 70px;
    }

    .question-card {
        padding: 23px 18px;
    }

    .question-text {
        font-size: 26px;
    }

    .result-card {
        padding: 30px 19px;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }

    .achievement-toast {
        left: 15px;
        right: 15px;
        bottom: 15px;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/*
 * Quiz sign safety:
 * The sign renderer hides identifying wording by default.
 * This class allows construction/work-zone examples to
 * use the proper orange warning color.
 */
.sign-diamond.sign-orange {
    background: #f28c28;
}

/* ========================================================
   QUIZ GRAPHIC CORRECTIONS
   ======================================================== */

.sign-diamond.sign-orange {
    background: #f28c28 !important;
}

/*
 * Safety net:
 * Normal quiz sign graphics must not reveal text unless
 * JavaScript explicitly marks it as visible.
 */
.sign-shape:not(.allow-sign-label) > span {
    display: none;
}
