/**
 * 13-app.css
 * Language Proficiency Preparation Platform
 *
 * Unified visual system for:
 * - Public website
 * - Authentication
 * - Candidate dashboard
 * - Examination engine
 * - Results and corrections
 * - Administration panel
 * - AI assistant
 * - Payments
 *
 * The application remains mobile-first, bilingual, accessible and
 * distraction-free during active tests.
 */

/* ==========================================================================
   01. Design tokens
   ========================================================================== */

:root {
    color-scheme: light;

    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --bg: #f4f6fb;
    --bg-soft: #f8f9fc;
    --surface: #ffffff;
    --surface-2: #f1f4f9;
    --surface-3: #e9edf5;
    --surface-glass: rgba(255, 255, 255, 0.86);

    --text: #18223a;
    --text-2: #45516d;
    --muted: #6b758b;
    --muted-2: #8d96aa;
    --line: #dfe4ed;
    --line-strong: #c9d1de;

    --primary: #5758df;
    --primary-2: #7a56dc;
    --primary-soft: #eef0ff;
    --primary-strong: #3f40b9;

    --blue: #2f6ee5;
    --blue-soft: #eaf2ff;
    --green: #187149;
    --green-soft: #eaf7ef;
    --amber: #8b5b0c;
    --amber-soft: #fff5df;
    --red: #ad3028;
    --red-soft: #fff0ef;
    --cyan: #15758f;
    --cyan-soft: #e8f7fb;
    --violet: #7047bd;
    --violet-soft: #f2ecff;

    --sidebar: #11192d;
    --sidebar-2: #192443;
    --sidebar-text: #dce5f7;
    --sidebar-muted: #9dabc7;
    --sidebar-hover: rgba(255, 255, 255, 0.09);

    --radius-xs: 7px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-round: 999px;

    --shadow-xs: 0 1px 2px rgba(24, 34, 58, 0.05);
    --shadow-sm: 0 8px 22px rgba(24, 34, 58, 0.08);
    --shadow-md: 0 16px 38px rgba(24, 34, 58, 0.11);
    --shadow-lg: 0 25px 60px rgba(24, 34, 58, 0.15);

    --focus-ring: 0 0 0 3px rgba(87, 88, 223, 0.16);
    --container: 1180px;
    --narrow-container: 820px;
    --header-height: 72px;
    --sidebar-width: 272px;
    --candidate-sidebar-width: 270px;
    --admin-sidebar-width: 280px;

    --transition-fast: 140ms ease;
    --transition: 210ms ease;
}

html[data-theme="dark"],
body.theme-dark {
    color-scheme: dark;

    --bg: #0c1220;
    --bg-soft: #101828;
    --surface: #151e31;
    --surface-2: #1b263b;
    --surface-3: #243149;
    --surface-glass: rgba(21, 30, 49, 0.88);

    --text: #eef2fb;
    --text-2: #c5cee1;
    --muted: #9ca8be;
    --muted-2: #7f8ca3;
    --line: #2b3850;
    --line-strong: #3a4964;

    --primary-soft: #24284f;
    --blue-soft: #152a4c;
    --green-soft: #153729;
    --amber-soft: #3b2e16;
    --red-soft: #3d2223;
    --cyan-soft: #15333d;
    --violet-soft: #2c2145;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.26);
    --shadow-md: 0 16px 38px rgba(0, 0, 0, 0.31);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.38);
}

/* ==========================================================================
   02. Reset and base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.no-scroll,
body.modal-open,
body.sidebar-open {
    overflow: hidden;
}

img,
svg,
video,
canvas,
audio {
    max-width: 100%;
}

img,
video {
    height: auto;
}

audio {
    width: 100%;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
[role="button"],
input[type="submit"],
input[type="button"] {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--primary-strong);
}

p,
ul,
ol {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: var(--text);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

h2 {
    font-size: clamp(1.4rem, 2.8vw, 2rem);
}

h3 {
    font-size: 1.1rem;
}

hr {
    height: 1px;
    margin: 24px 0;
    border: 0;
    background: var(--line);
}

::selection {
    background: rgba(87, 88, 223, 0.2);
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

[hidden],
.hidden,
.honeypot {
    display: none !important;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    z-index: 9999;
    top: 8px;
    left: 8px;
    transform: translateY(-150%);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--surface);
    font-weight: 800;
    transition: transform var(--transition-fast);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ==========================================================================
   03. Layout utilities
   ========================================================================== */

.container {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
}

.container-narrow {
    width: min(var(--narrow-container), calc(100% - 32px));
    margin-inline: auto;
}

.main,
.content {
    min-width: 0;
}

.section {
    padding-block: clamp(46px, 7vw, 88px);
}

.section-soft {
    background: var(--bg-soft);
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 32px;
    text-align: center;
}

.section-kicker,
.eyebrow,
.page-kicker,
.aside-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.grid,
.cards,
.metric-grid,
.stats,
.criteria-grid {
    display: grid;
    gap: 18px;
}

.cards-3,
.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(270px, 0.75fr);
    gap: 24px;
    align-items: start;
}

.row-between,
.page-head,
.card-head,
.set-card-top,
.variant-head,
.question-card-head,
.evaluation-header,
.review-head,
.topbar-inner,
.footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.actions,
.action-stack,
.top-actions,
.nav-actions,
.notification-actions,
.equipment-actions,
.modal-actions,
.recorder-actions,
.status-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.action-stack {
    align-items: stretch;
    flex-direction: column;
}

.sticky {
    position: sticky;
    top: calc(var(--header-height) + 18px);
}

.desktop-only {
    display: initial;
}

.mobile-only {
    display: none;
}

.flush {
    margin: 0 !important;
}

.full,
.field-full {
    grid-column: 1 / -1;
}

.right {
    text-align: right;
}

.small {
    font-size: 0.84rem;
}

.muted {
    color: var(--muted);
}

.mono-value,
.code,
.reference,
.transcript pre {
    font-family: var(--font-mono);
}

/* ==========================================================================
   04. Common surfaces, cards and metrics
   ========================================================================== */

.card,
.panel,
.side-card,
.hero-card,
.exam-path-card,
.skill-card,
.set-card,
.variant-card,
.stat-card,
.metric,
.score-card,
.evaluation-card,
.recording-card,
.step-card,
.plan-mini,
.package-card,
.intro-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.card {
    overflow: hidden;
}

.card-header,
.card-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}

.card-link {
    color: inherit;
    text-decoration: none;
}

.card-link:hover .card,
.card-link:hover.card {
    transform: translateY(-2px);
    border-color: rgba(87, 88, 223, 0.45);
    box-shadow: var(--shadow-sm);
}

.card-link .card,
.card-link.card {
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.metric-grid,
.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric,
.stat-card {
    min-width: 0;
    padding: 18px;
}

.metric-icon,
.stat-icon,
.icon-tile,
.skill-icon,
.result-row-icon,
.candidate-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary);
}

.metric strong,
.stat-card strong,
.stat {
    display: block;
    margin-top: 8px;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    line-height: 1.1;
}

.meta,
.meta-row,
.cell-sub,
.field-help,
.filters-note,
.usage-line,
.detail-row small {
    color: var(--muted);
    font-size: 0.82rem;
}

.cell-title {
    color: var(--text);
    font-weight: 780;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-list,
.usage-list,
.result-list,
.rule-list,
.section-list,
.category-list,
.notification-list,
.submission-list,
.recording-list,
.order-list {
    display: grid;
    gap: 10px;
}

.detail-row,
.rule-item,
.section-row,
.category-row,
.notification-row,
.submission-row,
.recording-card,
.order-row,
.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.detail-row:last-child,
.rule-item:last-child,
.section-row:last-child,
.category-row:last-child,
.notification-row:last-child,
.submission-row:last-child,
.order-row:last-child,
.result-row:last-child {
    border-bottom: 0;
}

.empty,
.empty-state {
    padding: clamp(30px, 6vw, 64px) 20px;
    color: var(--muted);
    text-align: center;
}

.empty-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 20px;
    background: var(--surface-2);
    color: var(--muted);
}

/* ==========================================================================
   05. Buttons, links and badges
   ========================================================================== */

.button,
.btn,
.auth-button,
.exam-button,
.primary-btn,
.secondary-btn,
.submit-button,
.review-btn,
.top-action,
.filter-btn,
.tab-button,
.icon-button,
.icon-btn,
.mobile-nav-button,
.menu-toggle,
.exit-button,
.flag-button,
.palette-button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-weight: 760;
    line-height: 1.1;
    text-decoration: none;
    transition: border-color var(--transition-fast), background var(--transition-fast),
        color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.button:hover,
.btn:hover,
.auth-button:hover,
.exam-button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.submit-button:hover,
.review-btn:hover,
.top-action:hover,
.filter-btn:hover,
.tab-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

.button-primary,
.btn.primary,
.auth-button-primary,
.primary-btn,
.submit-button {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #ffffff;
}

.button-primary:hover,
.btn.primary:hover,
.auth-button-primary:hover,
.primary-btn:hover,
.submit-button:hover {
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 9px 23px rgba(87, 88, 223, 0.28);
}

.button-secondary,
.btn.secondary,
.auth-button-secondary,
.secondary-btn,
.button-soft {
    background: var(--surface-2);
}

.auth-button-danger,
.btn.danger,
.button-danger {
    border-color: rgba(173, 48, 40, 0.32);
    background: var(--red-soft);
    color: var(--red);
}

.button-sm,
.btn.small,
.review-btn,
.filter-btn,
.tab-button {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 0.82rem;
}

.button-block,
.btn.block,
.auth-button.block {
    width: 100%;
}

.button[disabled],
.btn[disabled],
.auth-button[disabled],
.exam-button[disabled],
.submit-button[disabled],
button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none !important;
    box-shadow: none !important;
}

.icon-button,
.icon-btn,
.menu-toggle,
.exit-button,
.flag-button {
    width: 42px;
    padding: 0;
}

.text-link,
.ai-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 750;
    text-decoration: none;
}

.tag,
.pill,
.badge,
.status-pill,
.exam-chip,
.exam-badge,
.nav-badge,
.legend-dot,
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    min-height: 24px;
    border-radius: var(--radius-round);
    padding: 4px 9px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.tag-free,
.free,
.status-success,
.success,
.status.completed,
.status.ready {
    background: var(--green-soft);
    color: var(--green);
}

.tag-premium,
.featured,
.featured-label {
    background: var(--violet-soft);
    color: var(--violet);
}

.tag-practice,
.tag-mode,
.blue,
.info {
    background: var(--blue-soft);
    color: var(--blue);
}

.tag-mock,
.warning,
.status-warning,
.status.pending,
.status.processing {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-danger,
.danger,
.error,
.status.failed,
.status.rejected {
    background: var(--red-soft);
    color: var(--red);
}

.status-neutral {
    background: var(--surface-2);
    color: var(--muted);
}

.pill-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ==========================================================================
   06. Forms
   ========================================================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field,
.auth-form .field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.field label,
.field-label-row,
.auth-form label {
    color: var(--text-2);
    font-size: 0.84rem;
    font-weight: 760;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.input,
.select,
.textarea,
.auth-form input,
.auth-form select,
.auth-form textarea,
.text-answer,
.writing-answer {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    outline: 0;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.textarea,
.auth-form textarea,
.writing-answer {
    min-height: 118px;
    resize: vertical;
    line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus,
.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus,
.text-answer:focus,
.writing-answer:focus {
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.input::placeholder,
.textarea::placeholder,
.auth-form input::placeholder,
.auth-form textarea::placeholder {
    color: var(--muted-2);
}

.input[readonly],
.input[disabled],
.select[disabled],
.textarea[disabled] {
    cursor: not-allowed;
    background: var(--surface-2);
    color: var(--muted);
}

.input-wrap {
    position: relative;
}

.input-wrap.has-toggle .input,
.input-wrap.has-toggle input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
}

.password-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}

.checkbox-row,
.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    color: var(--text-2);
    font-size: 0.86rem;
    cursor: pointer;
}

.checkbox-row input,
.check input,
.choice-option input,
.gateway input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

.field-error,
.has-error,
.error-text {
    color: var(--red);
    font-size: 0.78rem;
}

.has-error .input,
.has-error.input,
.input.has-error {
    border-color: var(--red);
}

.password-meter {
    height: 6px;
    overflow: hidden;
    border-radius: var(--radius-round);
    background: var(--surface-3);
}

.password-meter > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--red);
    transition: width var(--transition), background var(--transition);
}

.password-meter.medium > span {
    background: var(--amber);
}

.password-meter.strong > span {
    background: var(--green);
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   07. Alerts, notices, flash messages and toasts
   ========================================================================== */

.notice,
.flash,
.auth-alert,
.audio-message,
.pending-note,
.locked-note,
.start-note,
.instruction-box,
.explanation,
.feedback-box,
.disclaimer {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 13px 15px;
    background: var(--surface);
    color: var(--text-2);
    line-height: 1.55;
}

.notice.info,
.flash-info,
.auth-alert-info {
    border-color: #bdd0f9;
    background: var(--blue-soft);
    color: #2a4e86;
}

.notice.success,
.flash-success,
.auth-alert-success,
.is-success {
    border-color: #adddbc;
    background: var(--green-soft);
    color: var(--green);
}

.notice.warning,
.notice-warning,
.flash-warning,
.is-warning,
.pending-note {
    border-color: #efca84;
    background: var(--amber-soft);
    color: #78500f;
}

.notice.danger,
.flash-error,
.auth-alert-error {
    border-color: #efbbb7;
    background: var(--red-soft);
    color: #842d27;
}

.toast-stack {
    position: fixed;
    z-index: 2000;
    top: 18px;
    right: 18px;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 36px));
    pointer-events: none;
}

.toast-stack > * {
    pointer-events: auto;
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   08. Public website
   ========================================================================== */

.site-header {
    position: sticky;
    z-index: 80;
    top: 0;
    border-bottom: 1px solid rgba(223, 228, 237, 0.9);
    background: var(--surface-glass);
    backdrop-filter: blur(18px);
}

.nav-shell,
.topbar-inner {
    width: min(var(--container), calc(100% - 32px));
    min-height: var(--header-height);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand,
.auth-brand,
.intro-brand,
.mobile-brand,
.print-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 850;
    text-decoration: none;
}

.brand-mark,
.auth-brand-mark,
.intro-brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #ffffff;
    box-shadow: 0 10px 23px rgba(87, 88, 223, 0.24);
}

.brand-name {
    white-space: nowrap;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav a,
.footer-links a,
.side-links a {
    border-radius: 9px;
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.main-nav a {
    padding: 9px 11px;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.language-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-round);
    background: var(--surface);
}

.language-switch a,
.language-switch button {
    min-width: 40px;
    border: 0;
    border-radius: var(--radius-round);
    background: transparent;
    color: var(--muted);
    padding: 6px 9px;
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
}

.language-switch .active,
.language-switch a:hover,
.language-switch button:hover {
    background: var(--primary);
    color: #ffffff;
}

.menu-toggle {
    display: none;
}

.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(58px, 8vw, 108px);
    background:
        radial-gradient(circle at 15% 10%, rgba(87, 88, 223, 0.14), transparent 34%),
        radial-gradient(circle at 88% 20%, rgba(122, 86, 220, 0.12), transparent 30%),
        var(--bg);
}

.hero::after {
    position: absolute;
    inset: auto -12% -45% 48%;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: rgba(87, 88, 223, 0.05);
    content: "";
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(350px, 0.95fr);
    gap: clamp(30px, 6vw, 72px);
    align-items: center;
}

.hero-copy h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: clamp(2.25rem, 5vw, 4.4rem);
    letter-spacing: -0.045em;
}

.hero-copy > p {
    max-width: 690px;
    color: var(--text-2);
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 24px;
}

.hero-meta,
.hero-trust {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.84rem;
}

.hero-card {
    position: relative;
    padding: 22px;
    box-shadow: var(--shadow-lg);
}

.exam-path-card {
    padding: 16px;
}

.path-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 11px 0;
}

.path-step-number,
.step-number,
.section-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 850;
}

.path-arrow {
    margin-left: 16px;
    color: var(--muted-2);
}

.exam-card,
.skill-card,
.variant-card,
.package-card,
.step-card {
    padding: 19px;
    transition: transform var(--transition), box-shadow var(--transition),
        border-color var(--transition);
}

.exam-card:hover,
.skill-card:hover,
.variant-card:hover,
.package-card:hover,
.step-card:hover {
    transform: translateY(-3px);
    border-color: rgba(87, 88, 223, 0.38);
    box-shadow: var(--shadow-sm);
}

.exam-card-head,
.exam-identity,
.variant-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.exam-logo,
.exam-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-soft), var(--violet-soft));
    color: var(--primary);
    font-weight: 900;
}

.exam-body {
    padding-block: 13px;
}

.exam-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.skill-tile,
.skill-row-item {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.skill-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stats-strip {
    width: min(var(--container), calc(100% - 32px));
    margin: -28px auto 0;
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.stats-strip .stat {
    padding: 21px;
    text-align: center;
    border-right: 1px solid var(--line);
}

.stats-strip .stat:last-child {
    border-right: 0;
}

.cta-band {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
    padding: clamp(28px, 5vw, 52px);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #202c51, #4d4fc1 58%, #7750c8);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.cta-band h2,
.cta-band p {
    color: #ffffff;
}

.faq-list {
    max-width: 880px;
    margin-inline: auto;
}

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-item summary,
.faq-item button {
    width: 100%;
    min-height: 62px;
    border: 0;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 0;
    font-weight: 780;
    text-align: left;
    list-style: none;
}

.faq-answer {
    padding: 0 0 18px;
    color: var(--text-2);
}

.contact-layout,
.help-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 28px;
    align-items: start;
}

.footer {
    padding: 54px 0 20px;
    background: #0f1728;
    color: #c5cde0;
}

.footer h3,
.footer h4 {
    color: #ffffff;
}

.footer-grid {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.footer-links {
    display: grid;
    gap: 9px;
}

.footer-links a {
    color: #aeb9cf;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    width: min(var(--container), calc(100% - 32px));
    margin: 30px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #929db4;
    font-size: 0.8rem;
}

.legal {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    padding-block: 42px 70px;
}

.legal h2 {
    margin-top: 32px;
}

/* ==========================================================================
   09. Authentication
   ========================================================================== */

.auth-shell,
.intro-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(380px, 0.97fr);
    background: var(--surface);
}

.auth-aside,
.intro-side {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: clamp(30px, 5vw, 68px);
    background:
        radial-gradient(circle at 10% 10%, rgba(126, 113, 255, 0.24), transparent 34%),
        radial-gradient(circle at 92% 86%, rgba(152, 94, 214, 0.22), transparent 38%),
        linear-gradient(145deg, #121b31, #243760);
    color: #ffffff;
}

.auth-aside::after,
.intro-side::after {
    position: absolute;
    inset: auto -110px -150px auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    content: "";
}

.auth-aside h1,
.auth-aside h2,
.auth-aside p,
.intro-side h1,
.intro-side h2,
.intro-side p {
    color: #ffffff;
}

.aside-content {
    position: relative;
    z-index: 1;
    max-width: 610px;
}

.aside-features {
    display: grid;
    gap: 14px;
    margin-top: 34px;
}

.aside-feature-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.1);
}

.aside-features > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.aside-footer {
    position: absolute;
    z-index: 1;
    right: clamp(30px, 5vw, 68px);
    bottom: 28px;
    left: clamp(30px, 5vw, 68px);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.auth-main,
.intro-main {
    min-width: 0;
    display: grid;
    place-items: center;
    padding: clamp(22px, 5vw, 60px);
    background: var(--bg);
}

.auth-stage {
    width: min(520px, 100%);
}

.auth-card {
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.auth-card-wide {
    width: min(760px, 100%);
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-heading h1 {
    margin-bottom: 8px;
    font-size: clamp(1.55rem, 4vw, 2.2rem);
}

.auth-form {
    display: grid;
    gap: 15px;
}

.auth-note,
.auth-mini-footer {
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.auth-note {
    margin-top: 15px;
}

.auth-footer-link {
    color: var(--primary);
    font-weight: 760;
    text-decoration: none;
}

.auth-topbar,
.intro-topbar {
    position: absolute;
    z-index: 5;
    top: 18px;
    right: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logout-options {
    display: grid;
    gap: 10px;
}

/* ==========================================================================
   10. Candidate dashboard and application shell
   ========================================================================== */

.candidate-shell,
.admin-shell {
    min-height: 100vh;
    display: grid;
    background: var(--bg);
}

.candidate-shell {
    grid-template-columns: var(--candidate-sidebar-width) minmax(0, 1fr);
}

.admin-shell {
    grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    z-index: 90;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 18px 14px;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: var(--sidebar-text);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar .brand,
.sidebar .brand-name,
.sidebar .mobile-brand {
    color: #ffffff;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    margin-top: 22px;
}

.sidebar-nav a,
.sidebar-nav button {
    min-height: 44px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    font-size: 0.88rem;
    font-weight: 690;
    text-align: left;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-nav button:hover,
.sidebar-nav button.active {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-label {
    padding: 20px 10px 8px;
    color: var(--sidebar-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-bottom,
.side-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.sidebar-user,
.side-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.profile-avatar,
.sidebar-user .avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #ffffff;
    font-weight: 850;
}

.sidebar-user-text {
    min-width: 0;
}

.sidebar-user-text strong,
.sidebar-user-text span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-text span {
    color: var(--sidebar-muted);
    font-size: 0.76rem;
}

.main-column {
    min-width: 0;
}

.topbar {
    position: sticky;
    z-index: 70;
    top: 0;
    min-height: var(--header-height);
    border-bottom: 1px solid var(--line);
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
}

.topbar-inner {
    width: 100%;
    padding-inline: 22px;
}

.top-left,
.topbar-title {
    min-width: 0;
}

.topbar-title h1,
.page-title {
    overflow: hidden;
    margin: 0;
    font-size: 1.1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-bottom-nav {
    display: none;
}

.candidate-shell .content,
.admin-shell .content {
    width: min(1450px, 100%);
    margin-inline: auto;
    padding: 24px;
}

.page-heading,
.page-hero {
    margin-bottom: 22px;
}

.page-heading h1,
.page-hero h1 {
    margin-bottom: 7px;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.breadcrumbs,
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--muted);
    font-size: 0.8rem;
}

.breadcrumbs a,
.breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.continue-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    font-size: 0.82rem;
}

.exam-path-card,
.profile-summary {
    padding: 20px;
}

.skill-row-item,
.set-card,
.variant-card {
    min-height: 100%;
}

.set-card {
    padding: 18px;
}

.set-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.set-score {
    display: grid;
    place-items: center;
    min-width: 56px;
    min-height: 56px;
    border-radius: 15px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
}

.set-lock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--amber);
    font-size: 0.8rem;
    font-weight: 760;
}

.filters,
.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn.active,
.tab-button.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
}

.notification-row.unread {
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    padding-inline: 12px;
}

.ai-fab {
    position: fixed;
    z-index: 120;
    right: 22px;
    bottom: 22px;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #ffffff;
    box-shadow: 0 14px 34px rgba(87, 88, 223, 0.34);
    text-decoration: none;
}

/* ==========================================================================
   11. Examination introduction
   ========================================================================== */

.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(310px, 0.88fr);
    gap: 24px;
    align-items: start;
}

.intro-card {
    padding: clamp(22px, 4vw, 34px);
}

.intro-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.intro-metrics .metric {
    box-shadow: none;
}

.rule-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rule-item {
    justify-content: flex-start;
}

.rule-check {
    color: var(--green);
}

.equipment-list {
    display: grid;
    gap: 10px;
}

.equipment-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.equipment-state {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 760;
}

.equipment-item.ready .equipment-state {
    color: var(--green);
}

.equipment-item.error .equipment-state {
    color: var(--red);
}

/* ==========================================================================
   12. Active examination engine
   ========================================================================== */

.exam-shell {
    min-height: 100vh;
    background: #eef1f6;
    color: #18223a;
}

.exam-shell .input,
.exam-shell .textarea,
.exam-shell .select {
    background: #ffffff;
    color: #18223a;
}

.exam-topbar {
    position: sticky;
    z-index: 100;
    top: 0;
    min-height: 72px;
    border-bottom: 1px solid #d8dee8;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
}

.exam-progress-top {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.exam-title {
    min-width: 0;
}

.exam-title strong,
.exam-title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exam-title span {
    color: #6b758b;
    font-size: 0.76rem;
}

.timer {
    min-width: 96px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #18223a;
    color: #ffffff;
    padding: 10px 13px;
    font-family: var(--font-mono);
    font-size: 0.98rem;
    font-weight: 850;
}

.timer.warning {
    background: #8b5b0c;
    color: #ffffff;
}

.timer.danger {
    background: #ad3028;
    color: #ffffff;
}

.connection,
.save-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #6b758b;
    font-size: 0.77rem;
    font-weight: 720;
}

.connection-dot,
.save-dot,
.record-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #187149;
}

.connection.offline .connection-dot,
.save-state.error .save-dot {
    background: #ad3028;
}

.exam-body {
    width: min(1500px, 100%);
    margin-inline: auto;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}

.question-sidebar {
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    border-right: 1px solid #d8dee8;
    background: #ffffff;
    padding: 18px;
}

.palette-title {
    margin-bottom: 12px;
    color: #45516d;
    font-size: 0.78rem;
    font-weight: 820;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.question-palette {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.palette-button {
    width: 100%;
    min-width: 0;
    min-height: 37px;
    padding: 0;
    border-color: #d8dee8;
    color: #566176;
}

.palette-button.current {
    border-color: #5758df;
    background: #5758df;
    color: #ffffff;
}

.palette-button.answered {
    border-color: #93d3aa;
    background: #eaf7ef;
    color: #187149;
}

.palette-button.flagged {
    box-shadow: inset 0 -3px 0 #8b5b0c;
}

.palette-legend {
    display: grid;
    gap: 7px;
    margin-top: 16px;
    color: #6b758b;
    font-size: 0.75rem;
}

.question-stage {
    min-width: 0;
    padding: clamp(18px, 3vw, 36px);
}

.question-stage-inner {
    width: min(1050px, 100%);
    margin-inline: auto;
}

.question-card {
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 13px 34px rgba(24, 34, 58, 0.08);
}

.question-card-head {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e6ee;
}

.question-number {
    color: #5758df;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.question-instructions {
    padding: 14px 20px;
    border-bottom: 1px solid #e1e6ee;
    background: #f8f9fc;
    color: #45516d;
    font-size: 0.9rem;
}

.question-prompt {
    padding: clamp(20px, 4vw, 34px);
    color: #18223a;
    font-size: clamp(1rem, 2vw, 1.16rem);
    line-height: 1.75;
}

.answer-area,
.answer-box {
    padding: 0 clamp(20px, 4vw, 34px) clamp(22px, 4vw, 34px);
}

.choice-list,
.option-list,
.ordering-list,
.dropdown-list {
    display: grid;
    gap: 10px;
}

.choice-option {
    min-height: 56px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    border: 1px solid #d7dde7;
    border-radius: 13px;
    background: #ffffff;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast),
        box-shadow var(--transition-fast);
}

.choice-option:hover {
    border-color: #9899eb;
    background: #f8f7ff;
}

.choice-option.selected,
.choice-option:has(input:checked) {
    border-color: #5758df;
    background: #eef0ff;
    box-shadow: 0 0 0 3px rgba(87, 88, 223, 0.08);
}

.choice-key,
.option-key {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eef1f6;
    color: #45516d;
    font-weight: 850;
}

.choice-option.selected .choice-key,
.choice-option:has(input:checked) .choice-key {
    background: #5758df;
    color: #ffffff;
}

.choice-content {
    min-width: 0;
}

.passage-panel {
    max-height: 60vh;
    overflow: auto;
    border: 1px solid #d8dee8;
    border-radius: 15px;
    background: #ffffff;
    padding: 22px;
    line-height: 1.8;
}

.matching-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 0.65fr);
    gap: 14px;
}

.ordering-list > * {
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
}

.drag-handle {
    color: #8d96aa;
    cursor: grab;
}

.exam-media {
    margin: 0 20px 22px;
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 15px;
    background: #f8f9fc;
}

.exam-media-image {
    display: grid;
    place-items: center;
    min-height: 180px;
}

.exam-media-image img {
    max-height: 520px;
    object-fit: contain;
}

.exam-media-audio {
    padding: 17px;
}

.audio-label,
.audio-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #45516d;
    font-size: 0.82rem;
    font-weight: 760;
}

.writing-toolbar,
.writing-limits {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: #6b758b;
    font-size: 0.8rem;
}

.writing-answer {
    min-height: 330px;
    background: #ffffff;
    color: #18223a;
    font-size: 1rem;
    line-height: 1.75;
}

.recorder {
    display: grid;
    justify-items: center;
    gap: 16px;
    border: 1px solid #d8dee8;
    border-radius: 16px;
    background: #f8f9fc;
    padding: 24px;
}

.waveform {
    width: 100%;
    height: 74px;
    border-radius: 12px;
    background:
        linear-gradient(90deg, transparent 0 2%, rgba(87, 88, 223, 0.2) 2% 3%, transparent 3% 5%) repeat-x,
        #eef0ff;
    background-size: 22px 100%;
}

.recorder.recording .waveform {
    animation: waveformMove 1s linear infinite;
}

.recorder-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #45516d;
    font-weight: 760;
}

.recorder.recording .record-dot {
    background: #ad3028;
    animation: recordPulse 1.1s infinite;
}

.record-time {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 850;
}

.exam-footer {
    position: sticky;
    z-index: 50;
    bottom: 0;
    border-top: 1px solid #d8dee8;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    padding: 13px clamp(18px, 3vw, 32px);
}

.footer-progress {
    min-width: 180px;
}

.progress,
.progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: var(--radius-round);
    background: #e0e5ed;
}

.progress-bar,
.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5758df, #7a56dc);
    transition: width 300ms ease;
}

.progress-label,
.progress-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    color: #6b758b;
    font-size: 0.76rem;
}

.submit-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.exam-modal-backdrop,
.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(11, 17, 31, 0.62);
    backdrop-filter: blur(4px);
}

.exam-modal,
.modal-panel {
    width: min(680px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

@keyframes waveformMove {
    to {
        background-position-x: 22px;
    }
}

@keyframes recordPulse {
    50% {
        box-shadow: 0 0 0 7px rgba(173, 48, 40, 0.12);
    }
}

/* ==========================================================================
   13. Results and corrections
   ========================================================================== */

.result-shell {
    min-height: 100vh;
    background: var(--bg);
}

.result-topbar {
    position: sticky;
    z-index: 70;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
}

.result-main {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
    padding-block: 28px 60px;
}

.score-card {
    padding: 24px;
}

.score-ring {
    --score-value: 0;
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--primary) calc(var(--score-value) * 1%), var(--surface-3) 0);
}

.score-ring-inner {
    width: 116px;
    height: 116px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    text-align: center;
}

.score-ring-inner .score {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
}

.answer-table-wrap,
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.answer-table,
.table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.answer-table th,
.answer-table td,
.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.answer-table th,
.table th {
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.answer-table tbody tr:last-child td,
.table tbody tr:last-child td {
    border-bottom: 0;
}

.answer-table tbody tr:hover,
.table tbody tr:hover {
    background: var(--bg-soft);
}

.answer-table tr.is-correct,
.review-head.is-correct {
    border-left: 4px solid var(--green);
}

.answer-table tr.is-candidate,
.answer-table tr.is-incorrect,
.review-head.is-incorrect {
    border-left: 4px solid var(--red);
}

.question-review {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.review-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.review-body {
    padding: 20px;
}

.review-media {
    margin: 14px 0;
}

.answer-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.answer-text {
    min-height: 92px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    padding: 14px;
    white-space: pre-wrap;
}

.explanation,
.feedback-box {
    margin-top: 15px;
    background: var(--blue-soft);
    border-color: #c4d5f8;
}

.category-score {
    min-width: 62px;
    text-align: right;
    font-weight: 850;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.38fr) minmax(120px, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.bar-row .progress {
    height: 10px;
}

.bad .progress-fill {
    background: var(--red);
}

.warn .progress-fill {
    background: var(--amber);
}

.good .progress-fill {
    background: var(--green);
}

.evaluation-card {
    overflow: hidden;
}

.evaluation-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.evaluation-body {
    padding: 18px;
}

.criterion-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.criterion-score {
    color: var(--primary);
    font-weight: 900;
}

.writing-response,
.transcript {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    padding: 16px;
    white-space: pre-wrap;
    line-height: 1.7;
}

.attempt-compare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.print-brand {
    display: none;
}

/* ==========================================================================
   14. Administration
   ========================================================================== */

.admin-shell .sidebar {
    width: var(--admin-sidebar-width);
}

.admin-shell .content {
    max-width: none;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
}

.tab-button {
    flex: 0 0 auto;
}

.tab-panel {
    margin-top: 18px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.media-item {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.media-preview {
    aspect-ratio: 16 / 10;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--surface-2);
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-meta {
    padding: 11px;
    color: var(--muted);
    font-size: 0.78rem;
}

.modal {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal.active,
.modal.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-head,
.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 19px;
}

.modal-head {
    border-bottom: 1px solid var(--line);
}

.modal-foot {
    border-top: 1px solid var(--line);
}

.modal-body {
    padding: 19px;
}

.modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--muted);
}

.drag-handle {
    user-select: none;
}

/* ==========================================================================
   15. AI assistant compatibility
   ========================================================================== */

.ai-fab:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(87, 88, 223, 0.4);
}

.ai-link {
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    background: var(--violet-soft);
    color: var(--violet);
}

/* ==========================================================================
   16. Payment compatibility
   ========================================================================== */

.price {
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 900;
}

.order-list,
.order-row {
    min-width: 0;
}

/* ==========================================================================
   17. PWA and installation prompts
   ========================================================================== */

.install-prompt,
.update-prompt {
    position: fixed;
    z-index: 1600;
    right: 18px;
    bottom: 18px;
    width: min(420px, calc(100vw - 36px));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 17px;
}

.install-prompt .actions,
.update-prompt .actions {
    margin-top: 13px;
}

/* ==========================================================================
   18. Accessibility and reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (forced-colors: active) {
    .button-primary,
    .btn.primary,
    .auth-button-primary,
    .primary-btn,
    .submit-button,
    .brand-mark,
    .auth-brand-mark,
    .intro-brand-mark {
        border: 1px solid ButtonText;
    }

    .choice-option.selected,
    .choice-option:has(input:checked) {
        outline: 2px solid Highlight;
    }
}

/* ==========================================================================
   19. Responsive — large tablets
   ========================================================================== */

@media (max-width: 1120px) {
    .cards-4,
    .skill-row,
    .metric-grid,
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .hero-card {
        max-width: 760px;
    }

    .footer-grid {
        grid-template-columns: 1.4fr repeat(2, minmax(0, 1fr));
    }

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

/* ==========================================================================
   20. Responsive — tablets and mobile navigation
   ========================================================================== */

@media (max-width: 900px) {
    :root {
        --header-height: 66px;
    }

    .desktop-only,
    .hide-mobile {
        display: none !important;
    }

    .mobile-only {
        display: initial;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: fixed;
        z-index: 120;
        top: var(--header-height);
        right: 12px;
        left: 12px;
        max-height: calc(100vh - var(--header-height) - 24px);
        overflow-y: auto;
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: var(--surface);
        box-shadow: var(--shadow-lg);
        display: none;
        align-items: stretch;
        flex-direction: column;
        padding: 10px;
    }

    .main-nav.open,
    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        width: 100%;
    }

    .nav-actions .button-secondary {
        display: none;
    }

    .cards-3,
    .two,
    .split,
    .contact-layout,
    .help-layout,
    .intro-grid {
        grid-template-columns: 1fr;
    }

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

    .stats-strip .stat:nth-child(2) {
        border-right: 0;
    }

    .stats-strip .stat:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

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

    .auth-shell,
    .intro-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside,
    .intro-side {
        min-height: auto;
        padding-bottom: 88px;
    }

    .aside-footer {
        position: static;
        margin-top: 34px;
    }

    .candidate-shell,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .candidate-shell .sidebar,
    .admin-shell .sidebar {
        position: fixed;
        z-index: 300;
        top: 0;
        left: calc(-1 * var(--sidebar-width) - 30px);
        width: min(var(--sidebar-width), calc(100vw - 62px));
        transition: left var(--transition);
        box-shadow: var(--shadow-lg);
    }

    .admin-shell .sidebar {
        left: calc(-1 * var(--admin-sidebar-width) - 30px);
        width: min(var(--admin-sidebar-width), calc(100vw - 62px));
    }

    .candidate-shell .sidebar.open,
    .admin-shell .sidebar.open {
        left: 0;
    }

    .mobile-overlay {
        position: fixed;
        z-index: 250;
        inset: 0;
        display: none;
        background: rgba(10, 16, 29, 0.58);
        backdrop-filter: blur(3px);
    }

    .mobile-overlay.open {
        display: block;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 120;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 10px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--surface-glass);
        box-shadow: var(--shadow-lg);
        backdrop-filter: blur(16px);
        padding: 6px;
    }

    .mobile-bottom-nav a {
        display: grid;
        justify-items: center;
        gap: 3px;
        border-radius: 12px;
        color: var(--muted);
        padding: 7px 4px;
        font-size: 0.66rem;
        font-weight: 760;
        text-decoration: none;
    }

    .mobile-bottom-nav a.active {
        background: var(--primary-soft);
        color: var(--primary);
    }

    .candidate-shell .content {
        padding-bottom: 100px;
    }

    .exam-body {
        grid-template-columns: 1fr;
    }

    .question-sidebar {
        position: fixed;
        z-index: 250;
        top: 72px;
        right: auto;
        bottom: 0;
        left: -290px;
        width: 280px;
        height: auto;
        box-shadow: var(--shadow-lg);
        transition: left var(--transition);
    }

    .question-sidebar.open {
        left: 0;
    }

    .question-stage {
        padding: 18px 14px 100px;
    }

    .matching-grid,
    .answer-comparison {
        grid-template-columns: 1fr;
    }

    .exam-footer {
        padding-inline: 12px;
    }

    .footer-progress {
        display: none;
    }

    .permission-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   21. Responsive — phones
   ========================================================================== */

@media (max-width: 620px) {
    .container,
    .nav-shell,
    .topbar-inner,
    .hero-grid,
    .stats-strip,
    .cta-band,
    .footer-grid,
    .footer-bottom,
    .result-main {
        width: min(100% - 22px, var(--container));
    }

    .section {
        padding-block: 42px;
    }

    .cards-3,
    .cards-4,
    .two,
    .metric-grid,
    .stats,
    .skill-row,
    .intro-metrics,
    .submit-summary,
    .attempt-compare {
        grid-template-columns: 1fr;
    }

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

    .hero-copy h1 {
        font-size: clamp(2rem, 11vw, 3.15rem);
    }

    .hero-actions .button,
    .hero-actions .btn {
        width: 100%;
    }

    .stats-strip {
        margin-top: 0;
    }

    .stats-strip .stat {
        border-right: 0 !important;
        border-bottom: 1px solid var(--line);
    }

    .stats-strip .stat:last-child {
        border-bottom: 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .auth-main,
    .intro-main {
        padding: 14px;
    }

    .auth-card {
        padding: 22px 17px;
        border-radius: 17px;
    }

    .auth-aside,
    .intro-side {
        padding: 30px 20px 66px;
    }

    .candidate-shell .content,
    .admin-shell .content {
        padding: 18px 12px 96px;
    }

    .topbar-inner {
        padding-inline: 12px;
    }

    .page-head,
    .row-between,
    .card-head,
    .set-card-top,
    .evaluation-header,
    .review-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-row,
    .notification-row,
    .submission-row,
    .order-row,
    .result-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .actions,
    .top-actions,
    .equipment-actions,
    .modal-actions {
        width: 100%;
    }

    .actions .button,
    .actions .btn,
    .equipment-actions .button,
    .equipment-actions .btn,
    .modal-actions .button,
    .modal-actions .btn {
        flex: 1 1 140px;
    }

    .exam-topbar {
        min-height: 64px;
    }

    .exam-topbar .topbar-inner {
        gap: 8px;
    }

    .exam-title span {
        display: none;
    }

    .timer {
        min-width: 78px;
        padding: 9px 10px;
        font-size: 0.85rem;
    }

    .question-card-head,
    .question-instructions {
        padding-inline: 14px;
    }

    .question-prompt,
    .answer-area,
    .answer-box {
        padding-right: 15px;
        padding-left: 15px;
    }

    .choice-option {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .choice-option input {
        grid-row: 1;
    }

    .choice-key {
        display: none;
    }

    .writing-answer {
        min-height: 260px;
    }

    .exam-footer .footer-actions {
        width: 100%;
    }

    .exam-footer .button,
    .exam-footer .btn,
    .exam-footer .exam-button,
    .exam-footer .submit-button {
        flex: 1;
        min-width: 0;
        padding-inline: 8px;
    }

    .answer-table th,
    .answer-table td,
    .table th,
    .table td {
        padding: 10px;
    }

    .bar-row {
        grid-template-columns: 1fr auto;
    }

    .bar-row .progress {
        grid-column: 1 / -1;
    }

    .ai-fab {
        right: 14px;
        bottom: 88px;
    }

    .modal,
    .exam-modal-backdrop {
        align-items: end;
        padding: 0;
    }

    .modal-panel,
    .exam-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
    }

    .toast-stack {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }
}

/* ==========================================================================
   22. Print
   ========================================================================== */

@media print {
    :root {
        --bg: #ffffff;
        --surface: #ffffff;
        --text: #000000;
        --text-2: #222222;
        --muted: #555555;
        --line: #d8d8d8;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .site-header,
    .sidebar,
    .topbar,
    .mobile-bottom-nav,
    .ai-fab,
    .filter-row,
    .filters,
    .actions,
    .footer-actions,
    .result-topbar,
    .install-prompt,
    .update-prompt,
    .toast-stack,
    .no-print {
        display: none !important;
    }

    .candidate-shell,
    .admin-shell,
    .result-shell {
        display: block;
    }

    .candidate-shell .content,
    .admin-shell .content,
    .result-main {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .print-brand {
        display: flex;
        margin-bottom: 18px;
    }

    .card,
    .panel,
    .score-card,
    .evaluation-card,
    .question-review {
        break-inside: avoid;
        border-color: #d8d8d8;
        box-shadow: none;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    .answer-table-wrap,
    .table-wrap {
        overflow: visible;
    }

    .answer-table,
    .table {
        font-size: 0.8rem;
    }
}
