
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #050910;
    --bg-soft: #0c1018;
    --card: #111824;
    --accent: #d9b070;
    --accent-soft: #3b2c16;
    --text-main: #f5f3e9;
    --text-muted: #c3c2bb;
}

/* --- BODY --- */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #182438 0, var(--bg) 55%);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- HEADER & NAV --- */
header {
    background: rgba(5, 9, 16, 0.92);
    border-bottom: 1px solid rgba(217, 176, 112, 0.25);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
}

nav {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

nav a:hover {
    background: rgba(217, 176, 112, 0.18);
    color: var(--accent);
    transform: translateY(-1px);
}

/* --- MAIN --- */
main {
    max-width: 960px;
    margin: 22px auto 40px;
    padding: 0 16px;
}

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(135deg, var(--bg-soft), #121827);
    border-radius: 20px;
    padding: 22px 20px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.7);
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: center;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px);
    animation: heroFade 0.7s ease-out forwards;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -40%;
    background-image: linear-gradient(
            rgba(0,0,0,0),
            rgba(217,176,112,0.12)
    );
    mix-blend-mode: soft-light;
    opacity: 0.3;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(217,176,112,0.6);
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hero h1 {
    font-size: 1.9rem;
    margin-bottom: 8px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.7);
    animation: floatTitle 3s ease-in-out infinite alternate;
}

.hero p {
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.hero-card {
    background: rgba(6, 11, 20, 0.85);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(217, 176, 112, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-card h3 {
    margin-bottom: 6px;
}

.hero-card p {
    font-size: 0.92rem;
}

.tag {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(217, 176, 112, 0.12);
    color: var(--accent);
    font-size: 0.75rem;
}

.hero-img {
    width: 120px;
    height: auto;
    display: block;
    margin-left: auto;
}

.button {
    display: inline-block;
    margin-top: 4px;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #1e1b16;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.7);
}

.button:hover {
    background: #e1bf80;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.8);
}

/* --- GRID & CARDS (Services/Exercices) --- */
.grid {
    margin-top: 26px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 16px 14px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    opacity: 0;
    transform: translateY(14px);
    animation: cardFade 0.6s ease-out forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: #f9f5e6;
}

.card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.75);
    border-color: rgba(217, 176, 112, 0.7);
}

.card-btn {
    margin-top: 8px;
    font-size: 0.9rem;
}

/* --- QUIZ SECTION --- */
.quiz-section {
    margin-top: 26px;
}

.quiz-intro {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.quiz-container {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.quiz-question {
    background: var(--card);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, box-shadow 0.15s ease;
}

.quiz-question:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.75);
}

.quiz-question h3 {
    margin-bottom: 16px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
}

/* Cacher les inputs radio */
.quiz-input {
    display: none;
}

/* Style des boutons de réponse */
.quiz-btn {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    background: #0b1220;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-main);
    transition: all 0.15s ease;
    font-weight: 500;
    text-align: left;
}

.quiz-btn:hover {
    background: #111827;
    transform: translateY(-1px);
    border-color: rgba(217, 176, 112, 0.4);
}

/* Cacher tous les feedbacks par défaut */
.feedback {
    display: none;
    margin-top: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
}

.feedback-container {
    margin-top: 12px;
}

/* Quand une réponse est sélectionnée */
.quiz-input:checked + .quiz-btn {
    transform: scale(1.02);
}

/* Afficher le feedback correspondant quand checked */
.quiz-input:checked ~ .feedback-container .feedback[data-for] {
    display: none;
}

#q1a:checked ~ .feedback-container .feedback[data-for="q1a"],
#q1b:checked ~ .feedback-container .feedback[data-for="q1b"],
#q1c:checked ~ .feedback-container .feedback[data-for="q1c"],
#q2a:checked ~ .feedback-container .feedback[data-for="q2a"],
#q2b:checked ~ .feedback-container .feedback[data-for="q2b"],
#q2c:checked ~ .feedback-container .feedback[data-for="q2c"],
#q3a:checked ~ .feedback-container .feedback[data-for="q3a"],
#q3b:checked ~ .feedback-container .feedback[data-for="q3b"],
#q3c:checked ~ .feedback-container .feedback[data-for="q3c"],
#q4a:checked ~ .feedback-container .feedback[data-for="q4a"],
#q4b:checked ~ .feedback-container .feedback[data-for="q4b"],
#q4c:checked ~ .feedback-container .feedback[data-for="q4c"],
#q5a:checked ~ .feedback-container .feedback[data-for="q5a"],
#q5b:checked ~ .feedback-container .feedback[data-for="q5b"],
#q5c:checked ~ .feedback-container .feedback[data-for="q5c"],
#q6a:checked ~ .feedback-container .feedback[data-for="q6a"],
#q6b:checked ~ .feedback-container .feedback[data-for="q6b"],
#q6c:checked ~ .feedback-container .feedback[data-for="q6c"] {
    display: block;
}

/* Style pour la bonne réponse quand sélectionnée */
.quiz-input:checked + .quiz-btn.correct-answer {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

/* Style pour la mauvaise réponse quand sélectionnée */
.quiz-input:checked + .quiz-btn:not(.correct-answer) {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Montrer toutes les bonnes réponses en vert après avoir répondu */
.quiz-input:checked ~ .quiz-btn.correct-answer {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
}

/* Style des feedbacks */
.feedback-correct {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.feedback-wrong {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.16);
}

/* Section À propos */
.about-section {
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px 20px;
    margin: 30px auto;
    max-width: 960px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 8px 18px rgba(0,0,0,0.6);
}

.about-section h2 {
    color: var(--text-main);
    margin-bottom: 16px;
    text-align: center;
    font-size: 1.8rem;
}

.about-section p {
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
}

.quiz-score {
    margin-top: 8px;
    color: var(--accent);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 16px;
    font-size: 0.85rem;
    color: #9ca3af;
    border-top: 1px solid rgba(55, 65, 81, 0.8);
    background: #020409;
    margin-top: 40px;
}

/* --- ANIMATIONS --- */
@keyframes heroFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatTitle {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

/* --- RESPONSIVE --- */
@media (max-width: 720px) {
    .hero {
        grid-template-columns: 1fr;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .quiz-container {
        grid-template-columns: 1fr;
    }
}