/* ============================================================
   User-Facing Exam Platform — CSS
   English Placement Test Platform
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary:     #6366f1;
    --primary-d:   #4f46e5;
    --primary-l:   #a5b4fc;
    --secondary:   #8b5cf6;
    --success:     #10b981;
    --warning:     #f59e0b;
    --danger:      #ef4444;
    --bg-dark:     #0f0c29;
    --bg-mid:      #1e1a4a;
    --text-light:  #e2e8f0;
    --text-muted:  #94a3b8;
    --glass-bg:    rgba(255,255,255,0.06);
    --glass-border:rgba(255,255,255,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    background-attachment: fixed;
    color: #fff;
}

/* ── Animated Background Particles ──────────────────────────── */
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(139,92,246,0.08) 0%, transparent 50%);
    animation: bgMove 15s ease infinite alternate;
    z-index: 0;
    pointer-events: none;
}
@keyframes bgMove { 0%{transform:translate(0,0)} 100%{transform:translate(3%,2%)} }

/* ── Container ───────────────────────────────────────────────── */
.exam-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* ── Glass Card ──────────────────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 620px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: slideUp 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes slideUp {
    from { opacity:0; transform: translateY(30px) scale(0.96); }
    to   { opacity:1; transform: translateY(0)   scale(1); }
}

/* ── Logo ────────────────────────────────────────────────────── */
.logo-container { text-align: center; margin-bottom: 1.75rem; }
.logo-circle {
    width: 90px; height: 90px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 12px 40px rgba(99,102,241,0.5);
    margin-bottom: 0.5rem;
    animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
    0%,100%{ transform: translateY(0); }
    50%    { transform: translateY(-8px); }
}

.eacc-login-screen {
    width: min(1120px, calc(100vw - 36px));
    max-width: none;
    margin: auto;
}

.eacc-login-card {
    display: grid;
    grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
    min-height: 650px;
    overflow: hidden;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.eacc-login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 52px;
    background: #ffffff;
    color: #172033;
}

.eacc-login-brand {
    margin-bottom: 42px;
}

.eacc-login-brand img {
    display: block;
    width: min(260px, 100%);
    height: auto;
}

.eacc-login-brand.compact {
    margin-bottom: 0;
}

.eacc-login-brand.compact img {
    width: min(190px, 52vw);
}

.eacc-register-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 34px;
}

.eacc-register-top .student-logout-btn {
    border-radius: 999px;
    font-weight: 750;
    white-space: nowrap;
}

.eacc-login-heading {
    margin-bottom: 28px;
}

.eacc-login-heading span {
    display: inline-flex;
    margin-bottom: 10px;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eacc-login-heading h3 {
    margin: 0;
    color: #111827;
    font-size: 2rem;
    font-weight: 850;
}

.eacc-login-heading p {
    margin: 10px 0 0;
    color: #64748b;
    line-height: 1.65;
}

.eacc-login-form {
    display: grid;
    gap: 18px;
}

.eacc-login-field .form-label {
    color: #334155 !important;
    font-weight: 750;
    margin-bottom: 8px;
}

.eacc-input-wrap {
    position: relative;
}

.eacc-input-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 2;
}

.eacc-input-wrap .form-control {
    height: 54px;
    padding-left: 46px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #d8e1ee;
    color: #172033;
    font-size: 0.96rem;
}

.eacc-input-wrap .form-control:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.eacc-input-wrap .form-control::placeholder {
    color: #94a3b8;
}

.eacc-select-wrap .form-select {
    height: 54px;
    padding-left: 46px;
    border-radius: 12px;
    background-color: #f8fafc;
    border: 1px solid #d8e1ee;
    color: #172033;
    font-size: 0.96rem;
}

.eacc-select-wrap .form-select:focus {
    background-color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.eacc-login-btn {
    min-height: 54px;
    margin-top: 6px;
    border-radius: 12px;
    background: #2563eb;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
    font-size: 1.02rem;
}

.eacc-login-btn:hover {
    background: #1d4ed8;
}

.eacc-login-visual-panel {
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 56px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(11, 31, 74, 0.2), rgba(4, 28, 78, 0.74)),
        linear-gradient(145deg, #0b1f4a 0%, #123d89 54%, #0f766e 100%);
    isolation: isolate;
}

.eacc-login-visual-panel::before {
    content: "";
    position: absolute;
    inset: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 26px;
    pointer-events: none;
}

.eacc-login-visual-panel::after {
    content: "EACC";
    position: absolute;
    right: -10px;
    top: 88px;
    color: rgba(255, 255, 255, 0.08);
    font-size: clamp(7rem, 13vw, 12rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0;
    z-index: -1;
}

.eacc-register-visual {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.18), rgba(8, 47, 73, 0.72)),
        linear-gradient(145deg, #0f766e 0%, #155e75 45%, #1d4ed8 100%);
}

.eacc-register-visual::after {
    content: "TEST";
}

.eacc-visual-content {
    max-width: 440px;
}

.eacc-visual-content span {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #dbeafe;
    font-size: 0.78rem;
    font-weight: 800;
}

.eacc-visual-content h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.1rem, 4vw, 3.9rem);
    font-weight: 900;
    line-height: 1.02;
}

.eacc-visual-content p {
    margin: 18px 0 0;
    max-width: 380px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
}

/* ── Form Elements ───────────────────────────────────────────── */
.form-label { color: rgba(255,255,255,0.75); font-size: 0.875rem; font-weight: 500; }

.form-control, .form-select {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.25s;
}
.form-control:focus, .form-select:focus {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
    outline: none;
}
.form-control::placeholder { color: rgba(255,255,255,0.3); }
.form-select option { background: #1e1a4a; color: #fff; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary-grad {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: #fff;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}
.btn-primary-grad:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99,102,241,0.55);
}
.btn-primary-grad:active { transform: translateY(0); }
.btn-primary-grad:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline-light-custom {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    color: rgba(255,255,255,0.7);
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
}
.btn-outline-light-custom:hover { border-color: rgba(255,255,255,0.5); color: #fff; background: rgba(255,255,255,0.05); }

/* ── Progress Bar ────────────────────────────────────────────── */
.exam-progress-wrap {
    margin-bottom: 1.5rem;
}
.exam-progress-track {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    overflow: hidden;
}
.exam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}
.exam-progress-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0;
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255,255,255,0.7);
}
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
}

/* ── Question Card ───────────────────────────────────────────── */
.question-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.78rem;
    color: var(--primary-l);
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ── Answer Options ──────────────────────────────────────────── */
.answer-options { display: flex; flex-direction: column; gap: 0.75rem; }

.answer-option {
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s;
    user-select: none;
}
.answer-option:hover {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.4);
    transform: translateX(4px);
}
.answer-option.selected {
    background: rgba(99,102,241,0.2);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.answer-option.correct  { background: rgba(16,185,129,0.15); border-color: var(--success); }
.answer-option.incorrect { background: rgba(239,68,68,0.15);  border-color: var(--danger);  }

.option-key {
    width: 34px; height: 34px;
    min-width: 34px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-l);
    transition: all 0.25s;
}
.answer-option.selected  .option-key { background: var(--primary);  color: #fff; }
.answer-option.correct   .option-key { background: var(--success);  color: #fff; }
.answer-option.incorrect .option-key { background: var(--danger);   color: #fff; }

.option-text { font-size: 0.9rem; color: var(--text-light); font-weight: 500; flex: 1; }

/* ── Feedback Bar ────────────────────────────────────────────── */
.feedback-bar {
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeSlide 0.3s ease both;
}
@keyframes fadeSlide { from{opacity:0; transform:translateY(-8px)} to{opacity:1; transform:none} }
.feedback-correct   { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.feedback-incorrect { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }

/* ── Speaking Section ────────────────────────────────────────── */
.speaking-card {
    background: rgba(139,92,246,0.08);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}
.sticky-audio-card {
    position: static;
    z-index: 20;
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.listening-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, #f8fbff, #eefdfb);
    border: 1px solid #cfe3f5;
    border-radius: 16px;
    padding: 18px;
    text-align: left;
    color: #172033;
}

.listening-panel-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 1.35rem;
    border: 1px solid #bae6fd;
}

.listening-panel-copy h6 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #172033;
}

.listening-panel-copy p {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.45;
}

.listening-play-btn {
    width: auto !important;
    min-width: 150px;
    white-space: nowrap;
}

.grouped-question-list {
    width: 100%;
}

.grouped-question-card {
    background: #ffffff;
    border: 1px solid var(--border-soft, #dbe3ef);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.reading-layout {
    grid-template-columns: minmax(320px, 44%) minmax(0, 1fr) !important;
}

.reading-passage-side {
    align-self: start;
}

.reading-passage-card {
    max-height: none;
    overflow: visible;
    padding: 20px;
    border: 1px solid #cfe3f5;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    color: #172033;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.reading-passage-kicker {
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.reading-passage-card h6 {
    color: #172033;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.reading-passage-text {
    color: #334155;
    font-size: 0.94rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.question-actions .btn {
    min-width: 190px;
}

.completion-icon {
    width: 86px;
    height: 86px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5;
    color: #059669;
    font-size: 2.5rem;
    border: 1px solid #a7f3d0;
}

.completion-icon.closed {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.attempt-closed-card {
    border-color: #fecaca;
}

.attempt-closed-card h3 {
    color: #172033;
}

.attempt-closed-card p {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    color: #64748b !important;
    line-height: 1.65;
}

.completion-signout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
}

.completion-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #2563eb;
    animation: completionPulse 1s ease-in-out infinite;
}

.student-dialog {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.student-dialog.is-open {
    display: flex;
}

.student-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.student-dialog-card {
    position: relative;
    width: min(440px, 100%);
    padding: 26px;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #ffffff;
    color: #172033;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
    text-align: center;
    animation: studentDialogIn 0.18s ease-out both;
}

@keyframes studentDialogIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.student-dialog-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 18px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.55rem;
}

.student-dialog-icon.is-danger {
    background: #fef2f2;
    color: #dc2626;
}

.student-dialog-icon.is-success {
    background: #ecfdf5;
    color: #059669;
}

.student-dialog-copy h5 {
    margin: 0 0 8px;
    color: #172033;
    font-size: 1.16rem;
    font-weight: 900;
}

.student-dialog-copy p {
    margin: 0;
    color: #64748b;
    line-height: 1.65;
}

.student-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.student-dialog-actions .btn {
    width: auto;
    min-width: 104px;
}

@keyframes completionPulse {
    0%, 100% { opacity: 0.35; transform: scale(0.86); }
    50% { opacity: 1; transform: scale(1); }
}

.mic-btn {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    color: #fff;
    font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center;
    margin: 1rem auto;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 0 0 rgba(139,92,246,0.5);
}
.mic-btn.recording {
    animation: micPulse 1.5s infinite;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
@keyframes micPulse {
    0%  { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    70% { box-shadow: 0 0 0 20px rgba(239,68,68,0); }
    100%{ box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.transcript-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 1rem;
    min-height: 80px;
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: left;
    margin: 0.75rem 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Returning User Banner ───────────────────────────────────── */
.returning-banner {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--primary-l);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    direction: ltr;
    text-align: left;
}

/* ── Results Screen ──────────────────────────────────────────── */
.cefr-level-display,
.score-summary-display {
    text-align: center;
    margin-bottom: 2rem;
}
.score-summary-display {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 1.5rem;
}
.score-total-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    min-height: 96px;
    border-radius: 18px;
    margin-bottom: 0.9rem;
    background: rgba(59,130,246,0.14);
    color: #60a5fa;
    font-size: 2.2rem;
    font-weight: 800;
    animation: scalePop 0.6s cubic-bezier(0.34,1.56,0.64,1) both 0.3s;
}
.result-student-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0.45rem 0 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}
.result-student-line span {
    color: #2563eb;
    font-weight: 800;
}
.cefr-badge-large {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px; height: 120px;
    border-radius: 50%;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    box-shadow: 0 0 60px currentColor;
    animation: scalePop 0.6s cubic-bezier(0.34,1.56,0.64,1) both 0.3s;
}
@keyframes scalePop { from{transform:scale(0)} to{transform:scale(1)} }

.skill-score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.skill-score-item {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
}
.skill-score-value { font-size: 1.8rem; font-weight: 700; }
.skill-score-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.report-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    direction: ltr;
    text-align: left;
}
.report-section h6 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.75rem; }
.report-section ul { list-style: none; padding: 0; margin: 0; }
.report-section li { padding: 0.35rem 0; font-size: 0.875rem; color: var(--text-light); display: flex; align-items: flex-start; gap: 8px; }

.exam-directions-card {
    max-width: 760px;
}

.directions-panel,
.section-plan {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1rem;
    text-align: left;
}

.directions-panel h6,
.section-plan-title {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.directions-panel ul {
    margin: 0;
    padding-left: 1.1rem;
    color: rgba(255,255,255,0.68);
    font-size: 0.875rem;
    line-height: 1.7;
}

.section-plan-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-plan-list {
    display: grid;
    gap: 0.65rem;
}

.section-plan-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0.75rem;
}

.section-plan-number {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.22);
    color: var(--primary-l);
    font-weight: 800;
    flex: 0 0 34px;
}

.section-plan-item strong {
    display: block;
    color: #fff;
    font-size: 0.92rem;
}

.section-plan-item span,
.section-plan-empty {
    display: block;
    color: rgba(255,255,255,0.58);
    font-size: 0.82rem;
}

/* ── Timer ───────────────────────────────────────────────────── */
.exam-timer {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    color: #fca5a5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.exam-timer.warning { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.5); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ── Loading Spinner ─────────────────────────────────────────── */
.loading-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1.5rem;
}
.spinner-ring {
    width: 64px; height: 64px;
    border: 4px solid rgba(99,102,241,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Textarea for writing ────────────────────────────────────── */
.writing-area {
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    padding: 1rem;
    color: #fff;
    font-size: 0.9rem;
    width: 100%;
    min-height: 140px;
    resize: vertical;
    transition: border-color 0.25s, box-shadow 0.25s;
    font-family: 'Inter', sans-serif;
}
.writing-area:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
}
.writing-area::placeholder { color: rgba(255,255,255,0.3); }

/* ── Text Helpers ────────────────────────────────────────────── */
.text-muted-light { color: rgba(255,255,255,0.5); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .glass-card { padding: 1.5rem 1.25rem; border-radius: 16px; }
    .skill-score-grid { grid-template-columns: repeat(2, 1fr); }

    .sticky-audio-card {
        position: static;
    }

    .listening-panel {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .listening-panel-icon {
        margin: 0 auto;
    }

    .listening-play-btn {
        width: 100% !important;
    }
}

/* ── Screen display control ──────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; animation: slideUp 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }

/* Production polish overrides */
:root {
    --primary: #2563eb;
    --primary-d: #1d4ed8;
    --primary-l: #dbeafe;
    --secondary: #14b8a6;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --text-light: #1f2937;
    --text-muted: #64748b;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border-soft: #dbe3ef;
}

html,
body {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.05)),
        #eef4fb;
    color: #172033;
}

body::before {
    display: none;
}

.exam-container {
    align-items: flex-start;
    padding: 32px 18px;
    width: 100%;
}

body.exam-work-active .exam-container {
    display: block;
    padding: 14px 20px;
}

.glass-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    color: #172033;
    padding: 32px;
}

#screen-exam {
    width: calc(100vw - 36px);
    max-width: none !important;
    min-height: calc(100vh - 28px);
    padding: 24px;
}

body.exam-work-active #screen-exam,
body.exam-work-active .training-screen,
body.exam-work-active .writing-validation-screen {
    margin: 0 auto;
}

#screen-result {
    max-width: 860px !important;
}

.logo-circle {
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.22);
    animation: none;
}

.text-muted-light,
.form-label,
.progress-info,
.skill-score-label {
    color: var(--text-muted) !important;
}

.form-control,
.form-select,
.writing-area {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #172033;
    border-radius: 10px;
}

.form-control:focus,
.form-select:focus,
.writing-area:focus {
    background: #ffffff;
    color: #172033;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-control::placeholder,
.writing-area::placeholder {
    color: #94a3b8;
}

.form-select option {
    background: #ffffff;
    color: #172033;
}

.btn-primary-grad {
    background: #2563eb;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
    letter-spacing: 0;
}

.btn-primary-grad:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
}

.exam-timer {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #b45309;
    font-weight: 700;
}

.exam-progress-wrap {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px;
}

.exam-progress-track {
    height: 8px;
    background: #e2e8f0;
}

.exam-progress-fill {
    background: linear-gradient(90deg, #2563eb, #14b8a6);
}

.question-text {
    color: #172033;
    font-size: 1.24rem;
    line-height: 1.65;
}

.answer-option {
    background: #ffffff;
    border: 1px solid #d8e1ee;
    border-radius: 12px;
    color: #172033;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.answer-option:hover {
    background: #f8fbff;
    border-color: #93c5fd;
    transform: none;
}

.answer-option.selected {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.answer-option.correct {
    background: #ecfdf5;
    border-color: #10b981;
}

.answer-option.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
}

.option-key {
    background: #eaf1fb;
    color: #1d4ed8;
    border-radius: 9px;
}

.option-text {
    color: #243044;
}

.feedback-correct {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.feedback-incorrect {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.report-section,
.speaking-card,
.returning-banner {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    color: #243044;
}

.exam-directions-card {
    max-width: 820px;
    padding: 40px;
}

.exam-directions-card .fa-clipboard-check {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #ecfdf5;
    color: #059669 !important;
    font-size: 1.9rem;
    margin-bottom: 18px !important;
}

.exam-directions-card h4 {
    color: #172033;
    letter-spacing: 0;
}

.exam-directions-card > .text-center p {
    color: #64748b !important;
    font-size: 0.98rem;
}

.report-section h6 {
    color: #172033;
}

.exam-directions-card .report-section {
    padding: 22px;
    border-radius: 16px;
    background: #f8fbff;
}

.exam-directions-card .report-section h6,
.directions-panel h6,
.section-plan-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.exam-directions-card .report-section ul {
    display: grid;
    gap: 10px;
}

.exam-directions-card .report-section li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e6edf7;
    font-size: 0.95rem;
}

.exam-directions-card .report-section li:last-child {
    border-bottom: 0;
}

.exam-directions-card .report-section li > i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #ffffff;
}

.exam-directions-card .report-section li > span {
    min-width: 0;
    color: #334155;
}

.exam-directions-card .report-section li strong {
    display: block;
    color: #172033;
    font-weight: 800;
}

.exam-directions-card .report-section li small {
    display: block;
    margin-top: 3px;
    color: #64748b !important;
    line-height: 1.45;
}

.intro-exam-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 700;
}

.exam-phase-summary {
    display: grid;
    gap: 8px;
}

.exam-phase-summary li {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0 !important;
}

.exam-phase-summary li:last-child {
    border-bottom: 0;
}

.exam-info-highlight {
    margin: 2px 0;
    padding: 12px !important;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fff7ed;
}

.report-section li,
.report-section .text-light,
#resSummary,
#resStrengths,
#resWeaknesses {
    color: #334155 !important;
}

.directions-panel,
.section-plan {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 20px;
    color: #243044;
}

.directions-panel h6,
.section-plan-title,
.section-plan-item strong {
    color: #172033;
}

.directions-panel ul,
.section-plan-item span,
.section-plan-empty {
    color: #475569;
}

.directions-panel ul {
    padding-left: 1.25rem;
    line-height: 1.75;
}

.section-plan-item {
    background: #ffffff;
    border: 1px solid #d8e1ee;
    padding: 16px;
    border-radius: 14px;
}

.section-plan-number {
    background: #e8edff;
    color: #2563eb;
}

.phase-plan-item {
    align-items: flex-start;
}

.phase-plan-featured {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.phase-plan-content {
    min-width: 0;
}

.phase-plan-substeps {
    display: grid;
    gap: 5px;
    margin-top: 5px;
}

.phase-plan-substeps b {
    color: #172033;
}

.cefr-level-display {
    background: linear-gradient(135deg, #eff6ff, #f0fdfa);
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 22px;
}

.cefr-badge-large {
    width: 104px;
    height: 104px;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.18);
}

.skill-score-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.skill-score-item {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 16px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.skill-score-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.skill-score-value {
    color: #172033;
    font-size: 1.55rem;
}

.skill-score-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.skill-score-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    border-radius: inherit;
}

.section-score-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-score-row {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 14px;
}

.section-score-row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #172033;
    margin-bottom: 10px;
}

.section-score-row span {
    color: #2563eb;
    font-weight: 800;
}

#studentLoginError {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    border-radius: 10px;
}

.loading-spinner-wrap {
    color: #172033;
}

.spinner-ring {
    border-color: rgba(37, 99, 235, 0.16);
    border-top-color: #2563eb;
}

.writing-transition-card {
    position: relative;
    overflow: hidden;
    max-width: 560px !important;
    text-align: center;
    padding: 36px 34px;
    border-color: #dbeafe;
    background: #ffffff;
}

.writing-transition-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
}

.phase-transition-brand {
    width: 184px;
    margin: 0 auto 22px;
    padding: 9px 12px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.phase-transition-brand img {
    display: block;
    width: 100%;
    height: auto;
}

.phase-transition-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 13px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    text-align: left;
}

.phase-transition-status > span {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #059669;
    color: #ffffff;
    flex: 0 0 30px;
}

.phase-transition-status strong,
.phase-transition-status small {
    display: block;
}

.phase-transition-status strong {
    color: #065f46;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.2;
}

.phase-transition-status small {
    margin-top: 2px;
    color: #047857;
    font-size: 0.75rem;
    font-weight: 750;
}

.writing-transition-card h4 {
    margin: 0;
    color: #172033;
    font-size: 1.75rem;
    font-weight: 900;
}

.writing-transition-card > p {
    max-width: 420px;
    margin: 10px auto 22px;
    color: #64748b !important;
    line-height: 1.65;
}

.phase-transition-loading {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
}

.phase-transition-loading p {
    margin: 0;
    color: #334155 !important;
    font-size: 0.92rem;
    font-weight: 800;
}

.phase-loading-bar {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}

.phase-loading-bar span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    animation: phaseLoadingBar 1.15s ease-in-out infinite alternate;
}

@keyframes phaseLoadingBar {
    from { transform: translateX(0); }
    to { transform: translateX(138%); }
}

.exam-active-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.exam-active-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.exam-active-brand img {
    width: 132px;
    height: auto;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    flex: 0 0 auto;
}

.exam-active-brand span,
.exam-active-brand strong {
    display: block;
}

.exam-active-brand span {
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.exam-active-brand strong {
    color: #172033;
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.2;
}

.exam-active-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.transcript-box {
    background: #ffffff;
    border-color: #d8e1ee;
    color: #172033;
}

#questionContent.question-layout {
    display: grid;
    grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.question-side-panel {
    position: sticky;
    top: 24px;
}

.question-main-panel {
    min-width: 0;
}

.listening-panel {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 16px;
}

.question-side-panel .listening-panel {
    grid-template-columns: 1fr;
    text-align: left;
}

.question-side-panel .listening-panel-icon {
    margin: 0;
}

.question-side-panel .listening-play-btn {
    width: 100% !important;
    min-width: 0;
}

.listening-audio-time {
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
}

.audio-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #dbeafe;
    overflow: hidden;
}

.audio-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    transition: width 0.2s linear;
}

.listening-situation-card {
    padding: 16px 18px;
    margin: 14px 0 12px;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
}

.listening-situation-card h6 {
    margin: 2px 0 6px;
    color: #1e40af;
    font-weight: 800;
}

.listening-situation-card p {
    margin: 0;
    color: #334155;
    line-height: 1.65;
    white-space: pre-wrap;
}

.listening-situation-kicker {
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.training-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.training-audio-panel {
    position: sticky;
    top: 24px;
    padding: 20px;
    border: 1px solid #cfe3f5;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fbff, #eefdfb);
}

.training-audio-control {
    width: 100%;
}

.training-play-btn {
    width: 100% !important;
}

.training-question-panel {
    display: grid;
    gap: 18px;
}

.training-flow-card {
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.training-flow-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.training-sample-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    background: #fff7ed;
    color: #b45309;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.training-step-progress {
    height: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.training-step-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    transition: width 0.3s ease;
}

.training-situation {
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: #ffffff;
}

.training-situation.active {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.training-situation > h6 {
    margin: 4px 0 8px;
    color: #1e40af;
    font-weight: 800;
}

.training-situation > p {
    color: #475569;
    line-height: 1.65;
    white-space: pre-wrap;
}

.training-question-card {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.training-options {
    display: grid;
    gap: 8px;
}

.training-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #ffffff;
}

.training-option span {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eaf1fb;
    color: #1d4ed8;
    font-weight: 800;
}

.training-option.correct {
    border-color: #86efac;
    background: #ecfdf5;
}

.training-option.correct span {
    background: #16a34a;
    color: #ffffff;
}

.training-answer {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.9rem;
}

.training-complete-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    background: #f0fdf4;
    color: #166534;
}

.training-complete-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 1.35rem;
}

.training-complete-card h6 {
    margin: 0 0 4px;
    font-weight: 800;
    color: #166534;
}

.training-complete-card p {
    margin: 0;
    color: #3f6212;
    line-height: 1.55;
    font-size: 0.92rem;
}

.writing-validation-screen {
    width: min(100%, 980px);
    user-select: none;
    -webkit-user-select: none;
}

.writing-validation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.writing-kicker {
    color: #2563eb;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.writing-level-pill {
    padding: 10px 14px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.writing-level-pill strong {
    display: block;
    margin-top: 2px;
    color: #1d4ed8;
    font-size: 1rem;
}

.writing-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.writing-task-panel,
.writing-answer-panel {
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #ffffff;
    padding: 18px;
}

.writing-task-panel {
    position: sticky;
    top: 18px;
}

.writing-meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.writing-meta-grid div {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.writing-meta-grid span {
    display: block;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.writing-meta-grid strong {
    display: block;
    margin-top: 2px;
    color: #172033;
}

.writing-section-block {
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    margin-top: 14px;
}

.writing-section-block h6 {
    color: #172033;
    font-size: 0.85rem;
    font-weight: 900;
}

.writing-section-block ul {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    line-height: 1.65;
}

.writing-section-block p {
    margin: 0;
    color: #475569;
    line-height: 1.65;
}

.writing-answer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.writing-answer-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.writing-answer-top span,
.writing-timer {
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 900;
}

.writing-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
}

.writing-timer.warning {
    color: #b45309;
    background: #fff7ed;
    border-color: #fed7aa;
}

.writing-status {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.writing-status.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.writing-status.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.writing-status.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.student-access-notice {
    margin-top: 8px;
    padding: 9px 11px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
}

.writing-validation-area {
    width: 100%;
    min-height: 360px;
    resize: vertical;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fbfdff;
    color: #172033;
    line-height: 1.75;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.writing-validation-area:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

@media (max-width: 600px) {
    .exam-container {
        padding: 16px 10px;
    }

    body.exam-work-active .exam-container {
        padding: 10px;
    }

    .glass-card {
        padding: 22px 16px;
        border-radius: 14px;
    }

    .exam-directions-card {
        padding: 24px 16px;
    }

    .exam-directions-card .fa-clipboard-check {
        width: 54px;
        height: 54px;
        font-size: 1.55rem;
    }

    .exam-directions-card h4 {
        font-size: 1.25rem;
    }

    .exam-directions-card .report-section,
    .directions-panel,
    .section-plan {
        padding: 16px;
    }

    .exam-directions-card .report-section li {
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 10px;
    }

    .eacc-login-screen {
        width: 100%;
    }

    .eacc-login-card {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 18px;
    }

    .eacc-login-form-panel {
        padding: 34px 22px;
    }

    .eacc-login-brand {
        margin-bottom: 28px;
    }

    .eacc-login-brand img {
        width: min(220px, 100%);
        margin: 0 auto;
    }

    .eacc-login-brand.compact {
        margin-bottom: 0;
    }

    .eacc-login-brand.compact img {
        margin: 0;
        width: min(170px, 54vw);
    }

    .eacc-register-top {
        align-items: flex-start;
        margin-bottom: 28px;
    }

    .eacc-login-heading {
        text-align: center;
    }

    .eacc-register-card .eacc-login-heading {
        text-align: left;
    }

    .eacc-login-heading h3 {
        font-size: 1.6rem;
    }

    .eacc-login-visual-panel {
        display: none;
    }

    .writing-transition-card {
        padding: 28px 18px;
    }

    .phase-transition-brand {
        width: 158px;
    }

    .phase-transition-status {
        width: 100%;
        align-items: flex-start;
        border-radius: 14px;
    }

    .writing-transition-card h4 {
        font-size: 1.45rem;
    }

    .phase-transition-loading {
        text-align: left;
    }

    .exam-active-header {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .exam-active-brand img {
        width: 112px;
    }

    .exam-active-tools {
        justify-content: space-between;
    }

    .section-plan-item {
        align-items: flex-start;
        padding: 14px;
    }

    #screen-exam {
        width: calc(100vw - 20px);
        min-height: auto;
        padding: 14px;
    }

    #questionContent.question-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

    .writing-validation-header,
    .writing-answer-top {
        align-items: stretch;
        flex-direction: column;
    }

    .writing-answer-status {
        justify-content: space-between;
        width: 100%;
    }

    .writing-level-pill {
        white-space: normal;
    }

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

    .writing-task-panel {
        position: static;
        padding: 16px;
    }

    .writing-answer-panel {
        padding: 16px;
    }

    .writing-validation-area {
        min-height: 300px;
    }

    .training-audio-panel {
        position: static;
    }

    .training-flow-top {
        flex-direction: column;
    }

    .training-sample-timer {
        width: 100%;
        justify-content: center;
    }

    .question-side-panel {
        position: static;
    }

    .reading-passage-card {
        max-height: none;
    }

    .progress-info {
        flex-direction: column;
        gap: 8px;
    }

    .skill-score-grid {
        grid-template-columns: 1fr;
    }

    .sticky-audio-card {
        position: static;
    }

    .listening-panel {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .listening-panel-icon {
        margin: 0 auto;
    }

    .listening-play-btn {
        width: 100% !important;
    }

    .question-actions {
        justify-content: stretch !important;
    }

    .question-actions .btn {
        width: 100% !important;
    }
}
