/* ===== STYLES GÉNÉRAUX ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* ===== UTILITAIRES ===== */
.text-center { text-align: center; }
.text-primary { color: #2d2d3a; }
.text-muted { color: #888; }

/* ===== BOUTONS ===== */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2d2d3a, #1a1a2e);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(26, 26, 46, 0.3);
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d3a 50%, #3d3d4a 100%);
    color: white;
    padding: 16px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #888;
    flex-shrink: 0;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

header .logo .logo-img {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1);
}

header .logo .logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ffffff;
}

header .logo .logo-text span {
    color: #aaa;
}

/* ===== PAGE D'ACCUEIL ===== */
.home-container {
    flex: 1;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 100px);
}

.home-container .main-title {
    font-size: 46px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.home-container .main-title .highlight {
    color: #2d2d3a;
    position: relative;
}

.home-container .main-title .highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2d2d3a, #888);
    border-radius: 2px;
}

.home-container .subtitle {
    font-size: 20px;
    color: #666;
    margin-bottom: 45px;
    font-weight: 300;
}

.choice-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.choice-card {
    background: white;
    border-radius: 24px;
    padding: 30px 25px 25px;
    width: 300px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e8ecf1;
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: linear-gradient(90deg, #b0b0b0, #d0d0d0);
}

.choice-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    border-color: #b0b0b0;
}

.choice-card:hover::before {
    opacity: 1;
}

.choice-card .card-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.choice-card .card-icon.blue { color: #2d2d3a; }
.choice-card .card-icon.green { color: #3d3d4a; }
.choice-card .card-icon.orange { color: #2d2d3a; }

.choice-card h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.choice-card .badge-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.choice-card .badge {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.choice-card .badge.canada {
    background: #e8ecf1;
    color: #2d2d3a;
    border: 1px solid #888;
}

.choice-card .badge.gt {
    background: #e8ecf1;
    color: #2d2d3a;
    border: 1px solid #888;
}

.choice-card .card-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 18px;
}

.choice-card ul {
    text-align: left;
    list-style: none;
    padding: 0;
    margin-bottom: 22px;
}

.choice-card ul li {
    padding: 6px 0;
    color: #444;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.choice-card ul li:last-child {
    border-bottom: none;
}

.choice-card ul li::before {
    content: "▸";
    color: #2d2d3a;
    font-weight: bold;
    font-size: 16px;
}

.choice-card .btn-start {
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #2d2d3a, #1a1a2e);
}

.choice-card .btn-start:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(26, 26, 46, 0.35);
}

.info-bar {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    background: white;
    padding: 20px 45px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8ecf1;
}

.info-bar span {
    color: #444;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== PAGE DE RÉSULTATS ===== */
.result-container {
    flex: 1;
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px 20px;
    width: 100%;
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8ecf1;
}

.result-header .logo-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-header .logo-center .logo-img {
    height: 160px;
    width: auto;
}

.result-subtitle {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.result-subtitle .test-name {
    font-weight: 700;
    color: #333;
    background: #e8ecf1;
    padding: 2px 16px;
    border-radius: 12px;
}

.result-subtitle .test-name .badge-canada {
    display: inline-block;
    background: #ffebee;
    color: #d32f2f;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 10px;
    border-radius: 10px;
    margin-left: 6px;
    border: 1px solid #d32f2f;
}

.result-subtitle .test-name .badge-gt {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 10px;
    border-radius: 10px;
    margin-left: 6px;
    border: 1px solid #1565c0;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-top: 4px solid #555;
}

.result-card h2 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-card .score-display {
    font-size: 48px;
    font-weight: 700;
    color: #2d2d3a;
    text-align: center;
    margin: 10px 0;
}

.score-display .score-max {
    font-size: 24px;
    font-weight: 400;
    color: #999;
}

.level-badge {
    display: inline-block;
    padding: 6px 24px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 18px;
    margin: 10px auto;
    text-align: center;
    width: fit-content;
}

.level-badge[data-level="A1"] { background: #ffcdd2; color: #c62828; }
.level-badge[data-level="A2"] { background: #ffccbc; color: #d84315; }
.level-badge[data-level="B1"] { background: #fff3e0; color: #e65100; }
.level-badge[data-level="B2"] { background: #c8e6c9; color: #2e7d32; }
.level-badge[data-level="C1"] { background: #b3e5fc; color: #01579b; }
.level-badge[data-level="C2"] { background: #d1c4e9; color: #4a148c; }

.detail-answers {
    margin-top: 15px;
    border-top: 1px solid #e8ecf1;
    padding-top: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.detail-answers::-webkit-scrollbar {
    width: 4px;
}
.detail-answers::-webkit-scrollbar-thumb {
    background: #b0bec5;
    border-radius: 2px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row .correct { color: #2e7d32; font-weight: 600; }
.detail-row .incorrect { color: #c62828; font-weight: 600; }
.detail-row .detail-user { font-weight: 500; }

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-restart {
    padding: 14px 40px;
    background: linear-gradient(135deg, #2d2d3a, #1a1a2e);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-restart:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 25px rgba(26, 26, 46, 0.3);
}

.btn-print {
    padding: 14px 40px;
    background: #e8ecf1;
    color: #1a1a2e;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-print:hover {
    background: #d5dbe3;
}

/* ===== IMPRESSION ===== */
@media print {
    .result-actions { display: none !important; }
    .result-card { box-shadow: none !important; border: 1px solid #ddd !important; page-break-inside: avoid !important; break-inside: avoid !important; }
    body { background: white !important; }
    header { background: #2d2d3a !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; border-bottom: 2px solid #888 !important; padding: 8px 20px !important; display: flex !important; position: static !important; }
    header .logo .logo-img { filter: brightness(0) invert(1) !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    header .logo .logo-text { color: #ffffff !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    header .logo .logo-text span { color: #aaa !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    .result-header .logo-center .logo-img { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; filter: none !important; height: 120px !important; }
    .level-badge { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    .result-container { margin: 10px auto !important; padding: 0 15px !important; max-width: 100% !important; }
    .result-grid { gap: 15px !important; }
    .result-card { padding: 12px 16px !important; }
    .detail-answers { max-height: none !important; overflow-y: visible !important; }
    .detail-answers::-webkit-scrollbar { display: none !important; }
    @page { margin: 10mm 10mm 10mm 10mm !important; }
    .result-subtitle { font-size: 15px !important; margin-bottom: 15px !important; }
    .result-card .score-display { font-size: 32px !important; }
    .score-display .score-max { font-size: 18px !important; }
    .result-subtitle .test-name .badge-canada { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    .result-subtitle .test-name .badge-gt { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    header {
        padding: 12px 20px;
        flex-direction: column;
        gap: 8px;
    }
    header .logo .logo-img { height: 40px; }
    header .logo .logo-text { font-size: 18px; }
    .home-container .main-title { font-size: 32px; }
    .home-container .subtitle { font-size: 17px; margin-bottom: 30px; }
    .choice-container { gap: 20px; }
    .choice-card { width: 100%; max-width: 360px; padding: 20px; }
    .choice-card h2 { font-size: 24px; }
    .info-bar { padding: 15px 20px; gap: 15px; flex-direction: column; align-items: center; }
    .result-grid { grid-template-columns: 1fr; }
    .result-card .score-display { font-size: 36px; }
    .detail-row { font-size: 12px; flex-wrap: wrap; gap: 4px; }
    .result-header .logo-center .logo-img { height: 110px; }
}

@media (max-width: 480px) {
    header .logo .logo-img { height: 32px; }
    header .logo .logo-text { font-size: 15px; }
    .home-container .main-title { font-size: 24px; }
    .home-container .subtitle { font-size: 15px; }
    .choice-card { padding: 16px; }
    .choice-card h2 { font-size: 20px; }
    .choice-card .btn-start { padding: 10px 30px; font-size: 15px; }
    .choice-card .badge { font-size: 9px; padding: 1px 10px; }
    .choice-card .card-icon { font-size: 36px; }
    .result-header .logo-center .logo-img { height: 80px; }
}