:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg-gray: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-light: #f3f4f6;
    --border-color: #e5e7eb;
    --radius: 24px;
    --success: #10b981;
    --danger: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.25s ease;
}

body {
    background-color: var(--bg-gray);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}


.fa-body { direction: rtl; }
.en-body, .fr-body { direction: ltr; }


.main-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.header-brand-name { font-weight: 800; font-size: 1.25rem; color: var(--text-main); }
.lang-toggle { background: var(--bg-gray); padding: 4px; border-radius: 8px; display: flex; gap: 4px; }
.lang-btn { background: transparent; border: none; padding: 6px 12px; border-radius: 6px; font-weight: 700; color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 0.9rem; }
.lang-btn.active { background: white; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }


.progress-container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 0.5rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.progress-line-bg { position: absolute; top: 16px; inset-inline-start: 0; width: 100%; height: 4px; background: #e2e8f0; z-index: 1; }
.progress-line-fill { position: absolute; top: 16px; inset-inline-start: 0; height: 4px; background: var(--primary); z-index: 2; transition: width 0.5s ease; }
.step-indicator { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; width: 60px; }
.step-circle {
    width: 32px; height: 32px; border-radius: 50%; background: #e2e8f0; color: #9ca3af;
    display: flex; justify-content: center; align-items: center; font-weight: 800; font-size: 0.85rem;
    transition: 0.3s; border: 4px solid var(--bg-gray); box-sizing: content-box;
}
.step-circle.active, .step-circle.completed { background: var(--primary); color: white; }
.step-label { margin-top: 6px; font-size: 0.65rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; text-align: center; white-space: nowrap; }
.step-circle.active ~ .step-label, .step-circle.completed ~ .step-label { color: var(--primary); }


.app-main { max-width: 1000px; margin: 0 auto; padding: 1rem 1rem 4rem 1rem; min-height: 60vh; }
.step-section { display: none; animation: fadeIn 0.4s ease forwards; }
.step-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }


.hc-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}
.hc-card-title { font-size: 1.8rem; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 12px; margin-top: 0; margin-bottom: 1.5rem; }


.nav-buttons { display: flex; justify-content: space-between; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); }
.btn-back { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-weight: 700; background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 10px; transition: 0.2s; }
.btn-back:hover { color: var(--text-main); }
.btn-next { display: flex; align-items: center; gap: 8px; background: var(--primary); color: white; padding: 1rem 2.5rem; border-radius: 14px; font-weight: 800; border: none; cursor: pointer; font-size: 1.1rem; box-shadow: 0 4px 14px rgba(37,99,235,0.3); transition: 0.2s; }
.btn-next:hover { background: var(--primary-hover); transform: translateY(-2px); }


#step-home.active { display: flex; align-items: center; justify-content: center; min-height: 70vh; text-align: center; background: #ffffff; border-radius: 32px; padding: 2rem 1rem; }
.home-container { max-width: 800px; margin: 0 auto; text-align: center; }
.home-header h1 { font-size: 2rem; font-weight: 700; color: #0f172a; margin-bottom: 0.5rem; }
.home-header .subtitle { font-size: 1rem; color: #475569; margin-bottom: 1.5rem; }
.intro-paragraph-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.25rem; margin-bottom: 1.5rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.intro-paragraph-box p { margin: 0; color: #334155; font-size: 0.95rem; line-height: 1.6; }
.info-cards-wrapper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2.5rem; }
.info-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem; display: flex; align-items: center; gap: 1rem; text-align: start; box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: var(--transition); }
.icon-box { background: var(--primary-light); color: var(--primary); width: 45px; height: 45px; min-width: 45px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.info-text h4 { margin: 0 0 0.2rem 0; font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.info-text p { margin: 0; font-size: 0.8rem; color: #64748b; }
.hero-btn { width: 100%; max-width: 350px; background: var(--primary); color: white; border: none; border-radius: 24px; padding: 1rem 1.5rem; font-size: 1.1rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem; transition: var(--transition); box-shadow: 0 4px 6px -1px rgba(37,99,235,0.2); }
.hero-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }


.guide-content p { font-size: 0.95rem; line-height: 1.8; margin-bottom: 1rem; text-align: start; }
.guide-content ul { margin-bottom: 1.5rem; padding-inline-start: 1.5rem; text-align: start; }
.guide-content li { margin-bottom: 0.5rem; font-size: 0.9rem; color: #374151; }
.info-box { padding: 1.25rem; border-radius: 12px; margin: 1.5rem 0; background: #f8fafc; border-inline-start: 4px solid var(--border-color); text-align: start; }
.info-box.danger { border-inline-start-color: var(--danger); background: #fef2f2; }
.info-box.primary { border-inline-start-color: var(--primary); background: var(--primary-light); }
.guide-title-tag { color: var(--primary); margin-top: 30px; text-align: start; }


.quiz-wrapper { min-height: 350px; }
.quiz-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border-light); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.quiz-counter { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.quiz-question { font-size: 1.25rem; font-weight: 800; color: var(--text-main); margin-bottom: 1.5rem; line-height: 1.6; text-align: start; }
.option-grid { display: grid; gap: 1rem; }
.option-btn { background: white; border: 2px solid var(--border-color); padding: 1rem 1.25rem; border-radius: 12px; font-size: 1rem; font-family: inherit; color: var(--text-main); cursor: pointer; text-align: start; transition: all 0.2s ease; font-weight: 500; }
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); }
.option-btn.correct { border-color: var(--success); background: #dcfce7; color: #166534; }
.option-btn.wrong { border-color: var(--danger); background: #fee2e2; color: #991b1b; }
.option-btn:disabled { cursor: not-allowed; }
.explanation-box { margin-top: 1.5rem; padding: 1.25rem; background: #f1f5f9; border-radius: 12px; border-inline-start: 4px solid #94a3b8; display: none; animation: fadeIn 0.3s ease; text-align: start; }
.explanation-box.show { display: block; }
.result-circle-wrapper { display: flex; justify-content: center; margin: 2rem 0; }
.result-circle { width: 150px; height: 150px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 800; color: white; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.result-circle.pass { background: var(--success); }
.result-circle.fail { background: var(--danger); }


.fa-body .rtl-arrow { transform: scaleX(-1); display: inline-block; }
.en-body .rtl-arrow, .fr-body .rtl-arrow { transform: scaleX(1); display: inline-block; }
.fa-body .fas, .en-body .fas, .fr-body .fas { font-family: 'Font Awesome 6 Free' !important; font-weight: 900 !important; display: inline-block; line-height: 1.5 !important; }

@media (max-width: 768px) {
    .step-label { display: none; }
    .hc-card { padding: 1.5rem; }
    .info-cards-wrapper { grid-template-columns: 1fr; }
}
html[dir="rtl"] .global-fab {
    left: 20px !important;
    right: auto !important;
}
html[dir="ltr"] .global-fab {
    right: 20px !important;
    left: auto !important;
}
html[dir="rtl"] .fab-menu {
    align-items: flex-start !important;
    left: 0 !important;
    right: auto !important;
}
html[dir="ltr"] .fab-menu {
    align-items: flex-end !important;
    right: 0 !important;
    left: auto !important;
}
html[dir="rtl"] .fab-item:hover {
    transform: translateX(4px) !important;
}
html[dir="ltr"] .fab-item:hover {
    transform: translateX(-4px) !important;
}