/* Participant application shell and focused assessment experience. */
html { margin-top: 0 !important; }
body.mdla-standalone-page {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    color: var(--mdla-ink);
    background: #f4f5f8;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    overflow-x: hidden;
}
body.mdla-standalone-page #wpadminbar { display: none !important; }
.mdla-standalone-shell { width: 100%; min-height: 100dvh; margin: 0; padding: 0; }
.mdla-standalone-shell > .mdla-app { min-height: 100dvh; }
.mdla-standalone-shell > .mdla-portal,
.mdla-standalone-shell > .mdla-process,
.mdla-standalone-shell > .mdla-auth,
.mdla-standalone-shell > .mdla-account,
.mdla-standalone-shell > .mdla-results,
.mdla-standalone-shell > .mdla-interviews,
.mdla-standalone-shell > .mdla-certificate-lookup { align-self: stretch; }

/* Keep assessment language content independent from the Persian interface font. */
.mdla-language-content,
.mdla-language-content * {
    font-family: "Roboto", "Inter", "Segoe UI", Arial, sans-serif !important;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
}

/* Calmer, more compact participant account controls. */
.mdla-account input,
.mdla-account select,
.mdla-account textarea,
.mdla-auth input,
.mdla-auth select,
.mdla-auth textarea {
    min-height: 43px;
    padding: 8px 11px;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.6;
}
.mdla-account input::placeholder,
.mdla-account textarea::placeholder,
.mdla-auth input::placeholder,
.mdla-auth textarea::placeholder { color: #949baa; font-size: 12.5px; font-weight: 400; }
.mdla-account .mdla-button,
.mdla-auth .mdla-button { min-height: 43px; padding: 8px 15px; font-size: 13px; font-weight: 650; }
.mdla-account .mdla-field label,
.mdla-auth .mdla-field label { font-size: 12.5px; font-weight: 650; }

/* Full viewport assessment canvas. */
.mdla-standalone-shell > .mdla-runner,
.mdla-runner:fullscreen {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #f3f4f7;
    box-shadow: none;
    overflow: auto;
}
.mdla-exam { min-height: 100dvh; }
.mdla-exam__header {
    top: 0;
    z-index: 50;
    min-height: 76px;
    padding: 11px clamp(12px, 2vw, 28px);
    border-bottom-color: #e1e4e9;
    background: rgba(255,255,255,.97);
    box-shadow: 0 7px 24px rgba(24,29,38,.07);
}
.mdla-exam__identity h1 { font-size: clamp(15px, 1.8vw, 20px); }
.mdla-exam__timer {
    --mdla-timer-progress: 1;
    position: relative;
    min-width: 132px;
    padding: 8px 14px 8px 38px;
    border: 1px solid #bde7d0;
    border-radius: 14px;
    color: #17613e;
    background: linear-gradient(135deg,#f1fbf5,#e5f8ed);
    box-shadow: 0 8px 24px rgba(28,124,78,.12);
    isolation: isolate;
    transition: color .25s, border-color .25s, background .25s, transform .25s;
}
.mdla-exam__timer::before {
    content: "";
    position: absolute;
    inset-inline-start: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 3px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    transform: translateY(-50%) rotate(calc((1 - var(--mdla-timer-progress)) * 360deg));
    transition: transform .8s linear;
}
.mdla-exam__timer strong { font-size: 20px; letter-spacing: .04em; font-family: "Roboto", "Segoe UI", Arial, sans-serif; }
.mdla-exam__timer.is-warning { color: #8b5706; border-color: #f0cf8b; background: linear-gradient(135deg,#fffaf0,#fff0c9); }
.mdla-exam__timer.is-urgent { color: #a31520; border-color: #f0a6ab; background: linear-gradient(135deg,#fff5f5,#ffe3e5); animation: mdla-timer-pulse .8s ease-in-out infinite alternate; }
@keyframes mdla-timer-pulse { to { transform: scale(1.04); box-shadow: 0 10px 30px rgba(245,42,42,.25); } }

.mdla-exam__progress { position: sticky; top: 76px; z-index: 47; height: 5px; }
.mdla-exam__sections {
    position: sticky;
    z-index: 46;
    top: 81px;
    display: flex;
    gap: 7px;
    width: 100%;
    padding: 9px clamp(8px, 2vw, 24px);
    border-bottom: 1px solid #e5e7eb;
    background: rgba(247,248,250,.96);
    backdrop-filter: blur(12px);
    overflow-x: auto;
    scrollbar-width: thin;
}
.mdla-exam__section-tab {
    display: grid;
    min-width: max-content;
    gap: 1px;
    padding: 8px 14px;
    border: 1px solid #dfe2e8;
    border-radius: 11px;
    color: #515a6a;
    background: #fff;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: .2s ease;
}
.mdla-exam__section-tab strong { font-size: 12px; }
.mdla-exam__section-tab span { color: #8b92a0; font-size: 9px; }
.mdla-exam__section-tab:hover { border-color: #f3a7a7; transform: translateY(-1px); }
.mdla-exam__section-tab.is-current { color: #fff; border-color: var(--mdla-brand); background: var(--mdla-brand); box-shadow: 0 7px 18px rgba(245,42,42,.2); }
.mdla-exam__section-tab.is-current span { color: rgba(255,255,255,.82); }
.mdla-exam__section-tab.is-complete:not(.is-current) { color: #17613e; border-color: #b8dfca; background: #edf9f2; }

.mdla-exam__layout { grid-template-columns: 210px minmax(0,1fr); gap: 14px; max-width: 1320px; padding: 14px; }
.mdla-exam__navigator { top: 148px; padding: 13px; border-radius: 13px; }
.mdla-exam__question { padding: clamp(18px, 2.6vw, 34px); border-radius: 15px; }
.mdla-exam__question-title { font-size: clamp(17px, 2vw, 21px); }
.mdla-exam__question-content { font-size: 15px; line-height: 1.85; }
.mdla-exam__response { gap: 8px; margin-top: 17px; }
.mdla-exam__option { grid-template-columns: 19px minmax(0,1fr); gap: 9px; padding: 11px 12px; border-radius: 10px; font-size: 13.5px; }
.mdla-exam__option input { width: 16px; height: 16px; }
.mdla-exam__option span { line-height: 1.65; }
.mdla-exam__passage { margin-bottom: 14px; padding: 17px; }
.mdla-exam__passage > div { font-size: 14.5px; line-height: 1.85; }

/* Purpose-built audio player with a non-seekable listening track. */
.mdla-audio-player {
    display: grid;
    grid-template-columns: 50px minmax(0,1fr);
    align-items: center;
    gap: 13px;
    width: 100%;
    margin: 14px 0;
    padding: 13px;
    border: 1px solid #e2e5eb;
    border-radius: 15px;
    background: linear-gradient(135deg,#fff,#f8f9fb);
    box-shadow: 0 9px 28px rgba(31,35,45,.06);
}
.mdla-audio-player__toggle {
    display: grid;
    width: 50px;
    height: 50px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg,var(--mdla-brand),#c91515);
    box-shadow: 0 9px 20px rgba(245,42,42,.25);
    cursor: pointer;
}
.mdla-audio-player__toggle:disabled { filter: grayscale(1); opacity: .48; cursor: not-allowed; }
.mdla-audio-player__toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mdla-audio-player__toggle svg path[d*="Z"] { fill: currentColor; stroke: none; }
.mdla-audio-player__body { display: grid; min-width: 0; gap: 7px; }
.mdla-audio-player__heading { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.mdla-audio-player__heading span { color: var(--mdla-muted); }
.mdla-audio-player__track { height: 7px; border-radius: 999px; background: #e5e7ec; overflow: hidden; }
.mdla-audio-player__track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--mdla-brand),#ff7777); transition: width .2s linear; }
.mdla-audio-player small { direction: ltr; color: #7b8392; font-family: "Roboto","Segoe UI",Arial,sans-serif; font-size: 10px; }
.mdla-audio-player audio { display: none; }

.mdla-speaking { justify-items: center; padding: 19px; border-style: solid; text-align: center; }
.mdla-speaking__visual { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 42px; }
.mdla-speaking__visual span { width: 3px; height: 8px; border-radius: 9px; background: #f1a4a4; }
.mdla-speaking.is-recording .mdla-speaking__visual span { animation: mdla-wave .75s ease-in-out infinite alternate; }
.mdla-speaking.is-recording .mdla-speaking__visual span:nth-child(3n) { animation-delay: -.3s; }
.mdla-speaking.is-recording .mdla-speaking__visual span:nth-child(2n) { animation-delay: -.5s; }
@keyframes mdla-wave { to { height: 38px; background: var(--mdla-brand); } }
.mdla-speaking__status { font-size: 12px; line-height: 1.7; }
.mdla-speaking__button { min-width: 160px; }

.mdla-results { direction: rtl; text-align: right; }
.mdla-results__hero { direction: rtl; text-align: right; }
.mdla-results__hero .mdla-button { margin-inline: 0 auto; }
.mdla-results__tracking { display: flex; flex-wrap: wrap; gap: 5px; direction: rtl; }
.mdla-results__tracking code { direction: ltr; unicode-bidi: isolate; color: #fff; font-family: "Roboto","Segoe UI",Arial,sans-serif; }
.mdla-results__feedback .mdla-language-content { direction: auto; }

@media (max-width: 900px) {
    .mdla-exam__layout { grid-template-columns: 1fr; gap: 7px; padding: 8px; }
    .mdla-exam__navigator { order: 1; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 10px; }
    .mdla-exam__summary { padding: 0 0 0 9px; border: 0; border-inline-end: 1px solid var(--mdla-border); }
    .mdla-exam__summary strong { font-size: 15px; }
    .mdla-exam__question-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 34px; grid-template-columns: none; gap: 5px; margin: 0; overflow-x: auto; }
    .mdla-exam__question-number { width: 34px; height: 34px; aspect-ratio: auto; }
    .mdla-exam__legend { display: none; }
    .mdla-exam__question { order: 2; }
}

@media (max-width: 600px) {
    .mdla-exam__header { min-height: 66px; gap: 8px; padding: 7px 8px; }
    .mdla-exam__identity .mdla-kicker { display: none; }
    .mdla-exam__identity h1 { max-width: 44vw; font-size: 13px; white-space: normal; line-height: 1.45; }
    .mdla-exam__timer { min-width: 112px; padding: 6px 9px 6px 31px; border-radius: 11px; }
    .mdla-exam__timer::before { inset-inline-start: 9px; width: 14px; height: 14px; }
    .mdla-exam__timer small { font-size: 8px; }
    .mdla-exam__timer strong { font-size: 17px; }
    .mdla-exam__progress { top: 66px; }
    .mdla-exam__sections { top: 71px; gap: 5px; padding: 6px; }
    .mdla-exam__section-tab { padding: 6px 10px; border-radius: 9px; }
    .mdla-exam__section-tab strong { font-size: 10.5px; }
    .mdla-exam__layout { padding: 5px; }
    .mdla-exam__navigator { border-radius: 9px; }
    .mdla-exam__question { padding: 11px 9px; border-radius: 10px; }
    .mdla-exam__question-meta { margin-bottom: 10px; font-size: 9px; }
    .mdla-exam__section-instructions { margin: 0 0 8px; padding: 8px 9px; font-size: 10.5px; }
    .mdla-exam__question-title { margin-bottom: 7px; font-size: 16px; line-height: 1.55; }
    .mdla-exam__question-content { font-size: 14px; line-height: 1.75; }
    .mdla-exam__response { gap: 6px; margin-top: 10px; }
    .mdla-exam__option { grid-template-columns: 17px minmax(0,1fr); gap: 7px; padding: 9px 8px; font-size: 12.5px; }
    .mdla-exam__option input { width: 15px; height: 15px; }
    .mdla-exam__review { margin-top: 12px; font-size: 10.5px; }
    .mdla-exam__save-state { min-height: 15px; margin-top: 5px; }
    .mdla-exam__controls { margin: 10px -9px -11px; padding: 8px 9px calc(8px + env(safe-area-inset-bottom)); }
    .mdla-exam__controls .mdla-button { min-height: 39px; padding: 6px 10px; font-size: 10.5px; }
    .mdla-exam__question--reading { display: grid; }
    .mdla-exam__question--reading > .mdla-exam__passage {
        position: sticky;
        z-index: 12;
        top: 124px;
        max-height: 31dvh;
        margin: 0 0 8px;
        padding: 10px;
        border-inline-start-width: 3px;
        border-radius: 8px;
        background: #fbfbfc;
        box-shadow: 0 5px 16px rgba(25,30,39,.07);
        overflow: auto;
    }
    .mdla-exam__passage h2 { margin-bottom: 6px; font-size: 14px; }
    .mdla-exam__passage > div { font-size: 13px; line-height: 1.72; }
    .mdla-audio-player { grid-template-columns: 42px minmax(0,1fr); gap: 9px; margin: 9px 0; padding: 9px; border-radius: 11px; }
    .mdla-audio-player__toggle { width: 42px; height: 42px; }
    .mdla-audio-player__heading { font-size: 9.5px; }
    .mdla-speaking { padding: 13px 9px; }
    .mdla-account { width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .mdla-account__main { padding: 18px 11px; }
    .mdla-account__section { padding: 13px 10px; }
    .mdla-auth { width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .mdla-results { width: 100%; min-height: 100dvh; margin: 0; padding: 10px; border: 0; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .mdla-exam__timer.is-urgent,
    .mdla-speaking__visual span { animation: none !important; }
}
