/**
 * CEFR Adaptive English Test Platform
 * Modern Academic Color Palette - "Progression Académique" & "Dashboard Moderne"
 */

/* --- Color Variables - Academic Palette --- */
:root {
    /* Primary Colors - CEFR Level Mapping */
    --color-structure: #1E3A8A;      /* Bleu Profond - Structure/Advanced C */
    --color-success: #059669;        /* Vert Menthe - Success/B2 */
    --color-warning: #D97706;        /* Jaune Ambré - Attention/B1 */
    --color-action: #DC2626;         /* Rouge Corail - Action/A */
    
    /* Dashboard Modern Colors */
    --color-bg: #F8FAFC;             /* Blanc Cassé - Background */
    --color-text: #0F172A;           /* Bleu Nuit - Text */
    --color-grammar: #10B981;        /* Vert Émeraude - Grammar */
    --color-vocab: #F59E0B;          /* Jaune Safran - Vocabulary */
    --color-comprehension: #EF4444;  /* Rouge Écarlate - Comprehension */
    
    /* Supporting Colors */
    --color-surface: #ffffff;
    --color-surface-2: #F1F5F9;
    --color-border: #E2E8F0;
    --color-text-muted: #64748B;
    
    /* UI Elements */
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.06);
    --shadow-md: 0 8px 16px rgba(15,23,42,0.08), 0 4px 8px rgba(15,23,42,0.04);
    --shadow-lg: 0 20px 32px rgba(15,23,42,0.12), 0 10px 16px rgba(15,23,42,0.06);
    
    /* Fonts */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { color: var(--color-structure); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header & Footer --- */
.site-header {
    background: linear-gradient(135deg, var(--color-structure) 0%, #1E40AF 100%);
    color: #fff;
    padding: 18px 0;
    box-shadow: var(--shadow-md);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.site-header nav a { color: #fff; margin-left: 18px; font-weight: 600; }
.site-header nav a:hover { text-decoration: none; opacity: 0.9; }

.site-footer {
    margin-top: 40px;
    padding: 24px 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

/* --- Cards & Buttons --- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 22px;
    margin-bottom: 22px;
}
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.12s ease, background 0.12s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

/* Action Button - Red Coral for CTA */
.btn-primary { 
    background: var(--color-action); 
    color: #fff; 
    box-shadow: 0 6px 14px rgba(220,38,38,0.25);
}
.btn-primary:hover { 
    background: #B91C1C;
}

/* Success Button - Green for validation */
.btn-success {
    background: var(--color-success);
    color: #fff;
    box-shadow: 0 6px 14px rgba(5,150,105,0.25);
}

/* Secondary Button */
.btn-secondary { 
    background: var(--color-surface-2); 
    color: var(--color-text);
}

/* Error/Danger Button */
.btn-error {
    background: var(--color-action);
    color: #fff;
}

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* --- Forms --- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--color-text); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid var(--color-border);
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-structure);
    box-shadow: 0 0 0 3px rgba(30,58,138,0.1);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* --- Alerts & Badges --- */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.alert-error { 
    background: #FEF2F2; 
    color: #991B1B; 
    border: 2px solid #FECACA;
}
.alert-success { 
    background: #F0FDF4; 
    color: #166534; 
    border: 2px solid #BBF7D0;
}
.alert-warning { 
    background: #FFFBEB; 
    color: #92400E; 
    border: 2px solid #FDE68A;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--color-surface-2);
    color: var(--color-text);
}
.badge-success { 
    background: #D1FAE5; 
    color: #065F46;
}
.badge-warning { 
    background: #FEF3C7; 
    color: #92400E;
}
.badge-error { 
    background: #FEE2E2; 
    color: #991B1B;
}

/* CEFR Level Badges */
.badge[data-level="A1"] { background: #FEE2E2; color: #991B1B; }
.badge[data-level="A2"] { background: #FED7AA; color: #9A3412; }
.badge[data-level="B1"] { background: #FEF3C7; color: #92400E; }
.badge[data-level="B2"] { background: #D1FAE5; color: #065F46; }
.badge[data-level="C1"] { background: #DBEAFE; color: #1E40AF; }
.badge[data-level="C2"] { background: #E0E7FF; color: #3730A3; }

/* --- Home Page --- */
.hero {
    padding: 40px 0 28px;
    text-align: center;
}
.hero h2 { 
    font-size: 2rem; 
    margin-bottom: 10px; 
    color: var(--color-structure);
    font-weight: 800;
}
.hero p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}
.tests-list { padding: 10px 0 40px; }
.test-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.test-card { 
    background: var(--color-surface); 
    border-radius: var(--radius); 
    padding: 18px; 
    box-shadow: var(--shadow-sm); 
    border: 2px solid var(--color-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.test-card:hover {
    border-color: var(--color-structure);
    box-shadow: var(--shadow-md);
}
.test-card h4 { 
    margin-bottom: 8px;
    color: var(--color-structure);
    font-weight: 700;
}
.test-meta { 
    font-size: 0.85rem; 
    color: var(--color-text-muted); 
    margin-bottom: 10px;
}
.test-desc { 
    font-size: 0.9rem; 
    margin-bottom: 14px; 
    color: var(--color-text);
}

/* --- Start Page --- */
.start-page { padding: 30px 0; }
.start-page .meta { 
    color: var(--color-text-muted); 
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* --- Test Page --- */
.test-page { min-height: 100vh; display: flex; flex-direction: column; }
.test-header {
    background: #fff;
    border-bottom: 3px solid var(--color-structure);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}
.test-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.test-info { display: flex; gap: 16px; align-items: center; font-weight: 700; }
.test-title { color: var(--color-structure); }
.test-candidate { color: var(--color-text-muted); font-weight: 600; }
.test-progress { flex: 1; min-width: 160px; max-width: 320px; }
.progress-bar { 
    height: 12px; 
    background: var(--color-surface-2); 
    border-radius: 999px; 
    overflow: hidden;
    border: 1px solid var(--color-border);
}
/* Progress gradient from red (action) to green (success) */
.progress-fill { 
    height: 100%; 
    background: linear-gradient(90deg, var(--color-action), var(--color-warning), var(--color-success)); 
    transition: width 0.3s ease;
}
.progress-text { 
    font-size: 0.8rem; 
    color: var(--color-text-muted); 
    margin-left: 8px; 
    font-weight: 700;
}
.test-timer { 
    font-family: var(--font-mono); 
    font-weight: 800; 
    color: var(--color-action);
    font-size: 1.1rem;
}

.test-main { flex: 1; padding: 28px 0; }
.question-card { max-width: 820px; margin: 0 auto; }
.question-header { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.question-number { 
    font-weight: 800; 
    color: var(--color-structure);
    font-size: 1.1rem;
}
.question-media { margin: 14px 0; }
.question-media img, .question-media video { 
    max-width: 100%; 
    border-radius: 10px;
    border: 2px solid var(--color-border);
}
.question-text { 
    font-size: 1.1rem; 
    margin-bottom: 18px; 
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
}

.answers-list { display: grid; gap: 10px; margin-bottom: 16px; }
.answer-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 10px;
    border: 2px solid var(--color-border);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, transform 0.06s ease;
}
.answer-option:hover { 
    border-color: var(--color-structure); 
    background: #F8FAFC;
    transform: translateX(4px);
}
.answer-option input { margin-top: 4px; }
.answer-text { flex: 1; font-size: 0.95rem; }

.test-footer {
    background: #fff;
    border-top: 2px solid var(--color-border);
    padding: 14px 0;
    font-size: 0.85rem;
}
.integrity-notice {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #92400E;
    background: #FFFBEB;
    border: 2px solid #FDE68A;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.notice-icon { font-size: 1.2rem; }
.notice-text { flex: 1; font-weight: 600; }
.footer-text { text-align: center; color: var(--color-text-muted); }

/* --- Level Progress Indicators --- */
.level-progress {
    max-width: 820px;
    margin: 20px auto !important;
}
.level-indicators {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.level-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    background: var(--color-surface-2);
    color: var(--color-text-muted);
    border: 2px solid var(--color-border);
    transition: all 0.2s ease;
}
.level-badge.active {
    background: linear-gradient(135deg, var(--color-structure), #1E40AF);
    color: #fff;
    border-color: var(--color-structure);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(30,58,138,0.3);
}
.level-badge.completed {
    background: #D1FAE5;
    color: #065F46;
    border-color: var(--color-success);
}

/* --- Results Page --- */
.results-page { padding: 28px 0; }
.results-summary { text-align: center; }
.score-display { 
    display: flex; 
    justify-content: center; 
    gap: 30px; 
    margin: 20px 0; 
    flex-wrap: wrap;
}
.score-circle {
    width: 140px; 
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #DBEAFE, var(--color-structure));
    color: #fff;
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: 4px solid #fff;
}
.score-value { 
    font-size: 2.5rem; 
    font-weight: 900; 
    line-height: 1;
}
.score-label { 
    font-size: 0.75rem; 
    font-weight: 700; 
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cefr-badge-large {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: #fff;
    border-radius: 16px;
    padding: 20px 28px;
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    box-shadow: var(--shadow-md);
    min-width: 140px;
}
.cefr-badge-large.failed {
    background: linear-gradient(135deg, var(--color-warning), #D97706);
}
.cefr-level { 
    font-size: 2.8rem; 
    font-weight: 900; 
    line-height: 1;
}
.cefr-label { 
    font-size: 0.75rem; 
    font-weight: 700; 
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); 
    gap: 14px; 
    margin-top: 18px;
}
.stat-item { 
    background: var(--color-surface-2); 
    border-radius: 12px; 
    padding: 14px;
    border: 1px solid var(--color-border);
}
.stat-value { 
    display: block; 
    font-size: 1.5rem; 
    font-weight: 900; 
    color: var(--color-structure);
}
.stat-label { 
    font-size: 0.75rem; 
    color: var(--color-text-muted); 
    font-weight: 700;
    text-transform: uppercase;
}

.results-details { margin-top: 22px; }
.answers-review { display: grid; gap: 12px; }
.review-item { 
    border: 2px solid var(--color-border); 
    border-radius: 12px; 
    padding: 14px; 
    background: #fff;
    transition: border-color 0.2s ease;
}
.review-item.correct { 
    border-left: 5px solid var(--color-success);
    background: #F0FDF4;
}
.review-item.incorrect { 
    border-left: 5px solid var(--color-action);
    background: #FEF2F2;
}
.review-header { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    margin-bottom: 8px; 
    flex-wrap: wrap;
}
.review-number { 
    font-weight: 800; 
    color: var(--color-text);
}
.review-question { 
    font-weight: 600; 
    margin-bottom: 8px;
    color: var(--color-text);
}
.review-answer { 
    font-size: 0.9rem; 
    color: var(--color-text-muted);
}

/* --- Level Breakdown --- */
.level-breakdown { margin-top: 22px; }
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.level-card {
    background: var(--color-surface-2);
    border-radius: 12px;
    padding: 16px;
    border: 2px solid var(--color-border);
    transition: all 0.2s ease;
}
.level-card.passed {
    border-color: var(--color-success);
    background: #F0FDF4;
}
.level-card.failed {
    border-color: var(--color-action);
    background: #FEF2F2;
}
.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.level-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--color-text);
}
.level-stats {
    text-align: center;
}
.level-score {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-structure);
}
.level-details {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 4px 0;
}
.level-required {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
}
.no-questions {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

/* --- Admin Pages --- */
.admin-login-page {
    display: flex; 
    align-items: center; 
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-structure) 0%, #1E40AF 100%);
}
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card h1 { 
    text-align: center; 
    margin-bottom: 6px;
    color: #fff;
}
.login-card .subtitle { 
    text-align: center; 
    color: rgba(255,255,255,0.9); 
    margin-bottom: 18px;
}
.login-note { 
    text-align: center; 
    margin-top: 14px; 
    font-size: 0.85rem;
}
.login-note a { color: #fff; text-decoration: underline; }

.admin-page { background: var(--color-bg); }
.admin-header {
    background: #fff;
    border-bottom: 3px solid var(--color-structure);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}
.admin-header .container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 16px; 
    flex-wrap: wrap;
}
.admin-brand h1 { 
    font-size: 1.1rem;
    color: var(--color-structure);
}
.admin-brand small { 
    font-weight: 500; 
    color: var(--color-text-muted); 
    font-size: 0.85rem;
}
.admin-nav { 
    display: flex; 
    gap: 14px; 
    flex-wrap: wrap;
}
.admin-nav a { 
    font-weight: 700; 
    color: var(--color-text);
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.admin-nav a:hover { 
    color: var(--color-structure);
    background: var(--color-surface-2);
    text-decoration: none;
}

.admin-main { padding: 24px 0 40px; }
.admin-main h2 { 
    margin-bottom: 16px;
    color: var(--color-structure);
    font-weight: 800;
}
.page-title-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    gap: 12px; 
    margin-bottom: 16px; 
    flex-wrap: wrap;
}
.details-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 16px; 
    margin-bottom: 16px;
}
.detail-list dt { 
    font-weight: 700; 
    color: var(--color-text-muted); 
    font-size: 0.85rem;
    text-transform: uppercase;
}
.detail-list dd { 
    margin-bottom: 10px;
    color: var(--color-text);
}

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.9rem;
}
.data-table th, .data-table td { 
    padding: 12px; 
    border-bottom: 2px solid var(--color-border); 
    text-align: left; 
    vertical-align: top;
}
.data-table th { 
    font-weight: 800; 
    background: #F1F5F9;
    color: var(--color-structure);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.data-table tr:hover { 
    background: #F8FAFC;
}
.text-mono { font-family: var(--font-mono); font-size: 0.85rem; }
.small-text { font-size: 0.8rem; }
.table-responsive { overflow-x: auto; }

.filter-form .filter-row { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
    gap: 12px; 
    align-items: end;
}

.answer-history-item { 
    border: 2px solid var(--color-border); 
    border-radius: 12px; 
    padding: 14px; 
    margin-bottom: 12px; 
    background: #fff;
}
.answer-history-item.correct { 
    border-left: 5px solid var(--color-success);
    background: #F0FDF4;
}
.answer-history-item.incorrect { 
    border-left: 5px solid var(--color-action);
    background: #FEF2F2;
}
.answer-history-header { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    flex-wrap: wrap; 
    margin-bottom: 8px;
}
.answer-time { 
    margin-left: auto; 
    font-size: 0.8rem; 
    color: var(--color-text-muted); 
    font-family: var(--font-mono);
}
.answer-question { 
    font-weight: 600; 
    margin-bottom: 8px;
    color: var(--color-text);
}

.answers-builder { margin: 14px 0; }
.answer-builder-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 8px; 
    align-items: center;
}
.answer-builder-row input[type="text"] { flex: 1; }

.empty-state { 
    color: var(--color-text-muted); 
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* --- Stop Test Section --- */
.stop-test {
    border: 2px solid var(--color-action);
    background: #FEF2F2;
}
.stop-test h3 {
    color: var(--color-action);
    margin-bottom: 8px;
}

/* --- Responsive --- */
@media (max-width: 700px) {
    .site-header .container { flex-direction: column; gap: 10px; }
    .test-header .container { flex-direction: column; align-items: stretch; }
    .test-info { justify-content: center; }
    .test-progress { min-width: auto; }
    .score-display { flex-direction: column; align-items: center; }
    .levels-grid { grid-template-columns: repeat(2, 1fr); }
    .level-indicators { justify-content: center; }
}
/* ==========================================================
   CALIOPE BRANDING
   ========================================================== */

.brand-logo,
.admin-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo:hover,
.admin-brand-link:hover {
    text-decoration: none;
    opacity: 0.94;
}

.site-logo {
    display: block;
    width: auto;
    max-width: 260px;
    height: 58px;
    object-fit: contain;
    object-position: left center;
    background: #ffffff;
    border-radius: 7px;
    padding: 2px 4px;
}

.admin-brand-link {
    gap: 12px;
}

.admin-logo {
    display: block;
    width: auto;
    max-width: 190px;
    height: 42px;
    object-fit: contain;
    object-position: left center;
    background: #ffffff;
    border-radius: 6px;
    padding: 2px 3px;
}

.admin-label {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 10px;
    border-radius: 7px;
    background: #eff6ff;
    color: var(--color-structure);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.login-logo-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 18px;
}

.login-logo {
    display: block;
    width: auto;
    max-width: 300px;
    height: 72px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 8px;
    padding: 3px 5px;
}

.test-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.test-header-logo {
    display: block;
    width: auto;
    max-width: 150px;
    height: 38px;
    object-fit: contain;
    object-position: left center;
    background: #ffffff;
    border-radius: 5px;
    padding: 1px 3px;
}

.test-info-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

@media (max-width: 700px) {
    .site-logo {
        max-width: 220px;
        height: 48px;
    }

    .admin-logo {
        max-width: 155px;
        height: 35px;
    }

    .admin-label {
        display: none;
    }

    .test-header-logo {
        max-width: 112px;
        height: 31px;
    }

    .test-info {
        justify-content: center;
    }

    .login-logo {
        max-width: 250px;
        height: 60px;
    }
}

/* ==========================================================
   PRIVACY AND COOKIE CONSENT
   ========================================================== */

.cookie-consent-banner {
    position: fixed;
    z-index: 9999;
    right: 20px;
    bottom: 20px;
    left: 20px;
    max-width: 940px;
    margin: 0 auto;
    padding: 18px 20px;
    border: 2px solid var(--color-structure);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.cookie-consent-title {
    margin: 0 0 6px;
    color: var(--color-structure);
    font-size: 1.05rem;
    font-weight: 800;
}

.cookie-consent-text {
    max-width: 690px;
    margin: 0;
    color: var(--color-text);
    font-size: 0.92rem;
}

.cookie-consent-links {
    display: inline-flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-required-message {
    max-width: 720px;
    margin: 16px auto;
}

.privacy-page {
    padding: 35px 0 55px;
}

.privacy-page .privacy-content {
    max-width: 900px;
    margin: 0 auto;
}

.privacy-page h2 {
    margin-top: 30px;
    margin-bottom: 10px;
    color: var(--color-structure);
}

.privacy-page h3 {
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--color-text);
}

.privacy-page p,
.privacy-page li {
    color: var(--color-text);
}

.privacy-page ul {
    padding-left: 20px;
}

.privacy-contact-box {
    border-left: 5px solid var(--color-success);
    background: #f0fdf4;
}

@media (max-width: 700px) {
    .cookie-consent-banner {
        right: 10px;
        bottom: 10px;
        left: 10px;
        padding: 16px;
    }

    .cookie-consent-actions {
        width: 100%;
    }

    .cookie-consent-actions .btn {
        width: 100%;
        text-align: center;
    }
}
/* Red Delete button for in-progress sessions */
.btn-delete-in-progress {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.btn-delete-in-progress:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}
.media-play-limit {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 2px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.9rem;
}

.media-play-count {
    display: block;
    margin-top: 4px;
    font-weight: 800;
    color: #b45309;
}

.limited-media {
    width: 100%;
    max-width: 720px;
}
/* Interactive wave background */
body {
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 55vw;
    height: 55vw;
    border-radius: 45%;
    pointer-events: none;
    filter: blur(18px);
    opacity: 0.22;
    transition: transform 0.25s ease-out;
}

body::before {
    top: -22vw;
    left: -18vw;
    background: radial-gradient(
        circle,
        rgba(30, 58, 138, 0.48) 0%,
        rgba(5, 150, 105, 0.22) 42%,
        transparent 72%
    );
    transform: var(--wave-before-transform, translate(0, 0));

}

body::after {
    right: -20vw;
    bottom: -24vw;
    background: radial-gradient(
        circle,
        rgba(220, 38, 38, 0.35) 0%,
        rgba(217, 119, 6, 0.20) 40%,
        transparent 72%
    );
    transform: var(--wave-after-transform, translate(0, 0));
}
/* Interactive mouse-following wave background */
body {
    overflow-x: hidden;
}

.wave-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        linear-gradient(135deg, #f8fafc 0%, #eef4ff 50%, #f8fafc 100%);
}

.wave-background::before,
.wave-background::after {
    content: "";
    position: absolute;
    width: 72vw;
    height: 72vw;
    border-radius: 42% 58% 65% 35% / 48% 42% 58% 52%;
    pointer-events: none;
    filter: blur(42px);
    opacity: 0.46;
    transition: transform 0.18s ease-out;
    will-change: transform;
}

.wave-background::before {
    top: -28vw;
    left: -22vw;
    background: linear-gradient(
        135deg,
        rgba(30, 58, 138, 0.60),
        rgba(5, 150, 105, 0.38),
        rgba(59, 130, 246, 0.18)
    );
    transform: translate(var(--wave-one-x, 0px), var(--wave-one-y, 0px)) rotate(18deg);
}

.wave-background::after {
    right: -26vw;
    bottom: -30vw;
    background: linear-gradient(
        135deg,
        rgba(220, 38, 38, 0.38),
        rgba(217, 119, 6, 0.34),
        rgba(5, 150, 105, 0.20)
    );
    transform: translate(var(--wave-two-x, 0px), var(--wave-two-y, 0px)) rotate(-22deg);
}

/* Keep website content above the animated background */
.site-header,
main,
.site-footer,
.test-header,
.test-footer,
.admin-header,
.admin-main {
    position: relative;
    z-index: 1;
}
.writing-instructions {
    margin: 16px 0;
    padding: 14px 16px;
    color: #334155;
    background: #f8fafc;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
    line-height: 1.5;
}

.writing-answer-block {
    margin: 24px 0;
}

.writing-answer-block label,
.typed-answer-block label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #1e293b;
}

.writing-answer-input {
    display: block;
    width: 100%;
    min-height: 280px;
    padding: 14px;
    resize: vertical;
    box-sizing: border-box;
    font: inherit;
    font-size: 16px;
    line-height: 1.55;
    color: #1e293b;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}

.typed-answer-input {
    display: block;
    width: 100%;
    max-width: 460px;
    padding: 12px 14px;
    box-sizing: border-box;
    font: inherit;
    font-size: 16px;
    color: #1e293b;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}

.writing-answer-input:focus,
.typed-answer-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.writing-answer-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}
.test-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.test-cards .test-card {
    flex: 0 0 calc(33.333% - 20px);
    order: unset !important; /* remove any custom order */
}
/* FILE: assets/css/style.css (append) */

.cookie-highlight-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-text strong {
    color: #1e40af;
    font-weight: 700;
}
/* FILE: assets/css/style.css (append) */

.candidate-notice-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    padding: 16px 18px;
    margin: 18px 0 22px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.candidate-notice-box h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: #1e40af;
}

.candidate-notice-box p {
    margin: 8px 0;
}

.notice-divider {
    border: none;
    border-top: 1px solid #cbd5e1;
    margin: 14px 0;
}
.candidate-notice-container h3 {
    color: #1e40af;
    margin-top: 0;
}

.candidate-notice-container .notice-divider {
    border: none;
    border-top: 1px solid #cbd5e1;
    margin: 16px 0;
}
.component-status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.component-card {
    padding: 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.component-card.in_progress {
    border-color: var(--warning);
    background: #FFFBEB;
}

.component-card.completed {
    border-color: var(--success);
    background: #F0FDF4;
}

.component-card.pending {
    border-color: var(--muted);
    background: var(--surface-2);
}

.component-card h3 {
    margin: 0 0 8px;
    color: var(--structure);
    font-size: 1.1rem;
}

.component-test {
    margin: 8px 0;
    color: var(--text);
    font-weight: 600;
}

.component-status {
    margin: 10px 0;
}

.component-score,
.component-cefr {
    margin: 6px 0;
    font-size: 0.9rem;
    color: var(--muted);
}
.export-answers-button{
    appearance:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:10px 16px;
    margin:0;
    color:inherit;
    background:inherit;
    border:inherit;
    border-radius:inherit;
    font:inherit;
    font-weight:900;
    line-height:1.2;
    cursor:pointer;
    vertical-align:middle;
}

.export-answers-button:hover,
.export-answers-button:focus-visible{
    color:inherit;
    background:inherit;
    outline:2px solid rgba(30,58,138,.28);
    outline-offset:2px;
}