:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #f59e0b; /* Amber/Orange for electricity/security */
    --primary-hover: #d97706;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: #f1f5f9;
    font-size: 1.05rem;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background gradient animation */
.background-animation {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.15), transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.1), transparent 30%);
    z-index: -1;
    animation: drift 20s infinite linear alternate;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, 5%); }
}

.glass-header {
    width: 100%;
    padding: 2rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.glass-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* FAQ / Questions Types */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.05);
}

.faq-question {
    width: 100%;
    text-align: left;
    background: transparent;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    border-radius: 0;
}

.faq-question:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
    color: var(--primary);
}

.faq-question .icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question .icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 1.5rem;
    color: #cbd5e1;
    line-height: 1.8;
}

.faq-item.active .faq-answer {
    max-height: 2000px; /* Augmenté pour éviter de couper le texte long */
    padding: 0 1.5rem 1.5rem 1.5rem;
}

/* Tooltips / Mémo Technique */
.memo-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-dark);
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 8px;
    cursor: help;
    flex-shrink: 0;
}

.memo-tooltip::after {
    content: attr(data-memo);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--primary);
    width: max-content;
    max-width: 280px;
    font-size: 0.9rem;
    font-weight: normal;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    pointer-events: none;
    text-align: left;
    white-space: pre-wrap;
}

.memo-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.memo-tooltip:hover::after,
.memo-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Progress Tracker */
.progress-container {
    display: flex;
    justify-content: space-between;
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.progress-step {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

@media (max-width: 600px) {
    .progress-step {
        font-size: 0.75rem;
    }
    .glass-header h1 {
        font-size: 1.8rem;
    }
}

.progress-step.active {
    color: var(--primary);
}

/* Step Cards */
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}

.step-card.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.step-card h2 {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

/* Checklist */
.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.checklist li label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.checklist li label:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--border);
    transform: translateX(5px);
}

/* Custom Checkbox */
.task-checkbox {
    display: none;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.task-checkbox:checked + .custom-checkbox {
    background-color: var(--success);
    border-color: var(--success);
}

.task-checkbox:checked + .custom-checkbox::after {
    content: "✓";
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.checklist li label:has(input:checked) {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

button {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-next, .btn-finish, .btn-restart {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
}

.btn-next:hover:not(:disabled), .btn-finish:hover:not(:disabled), .btn-restart:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.btn-next:disabled, .btn-finish:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-prev {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-light);
}

.btn-prev:hover {
    background: rgba(255,255,255,0.1);
}

.success-card {
    text-align: center;
    padding: 4rem 2rem;
}
.success-card h2 {
    font-size: 2.5rem;
    color: var(--success);
    border: none;
}
.success-card p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

/* QCM Styles */
.qcm-question {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.qcm-question h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    border: none;
    padding-bottom: 0;
}

.qcm-option {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.6rem;
    cursor: pointer;
    font-size: 1.05rem;
    transition: all 0.2s ease;
}

.qcm-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.qcm-option input[type="radio"],
.qcm-option input[type="checkbox"] {
    margin-right: 15px;
    accent-color: var(--primary);
    transform: scale(1.2);
    cursor: pointer;
}

.qcm-feedback {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
}

.qcm-option.correct-option {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.qcm-option.incorrect-option {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    text-decoration: line-through;
}

.btn-check {
    background: var(--primary);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-check:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}
