
/* ==========================================================
   EduMission - style public
   ========================================================== */

.em-hero {
    margin: 20px auto 30px;
    max-width: 1180px;
    border-radius: 28px;
    padding: 48px 28px;
    background: linear-gradient(135deg, #151c3b, #1e6bff);
    color: #fff;
    box-shadow: 0 18px 45px rgba(21, 28, 59, .22);
}

.em-hero-content {
    max-width: 760px;
}

.em-kicker {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .82rem;
    font-weight: 800;
    opacity: .82;
    margin: 0 0 8px;
}

.em-hero h1,
.em-container h1 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    margin: 0 0 12px;
    line-height: 1;
}

.em-hero p {
    font-size: 1.16rem;
    line-height: 1.65;
    margin: 0 0 24px;
}

.em-container {
    max-width: 1180px;
    margin: 26px auto;
    padding: 0 16px;
}

.em-container h2 {
    margin: 0 0 16px;
}

.em-hero-actions,
.em-card-footer,
.em-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.em-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.em-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.em-btn-primary {
    background: #ffca3a;
    color: #141414;
    box-shadow: 0 10px 24px rgba(255, 202, 58, .35);
}

.em-btn-secondary {
    background: rgba(255,255,255,.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
}

.em-btn-small {
    padding: 8px 14px;
    background: #151c3b;
    color: #fff;
}

.em-tabs a {
    padding: 10px 16px;
    border-radius: 999px;
    background: #f0f3f8;
    color: #202538;
    text-decoration: none;
    font-weight: 800;
}

.em-tabs a.active,
.em-tabs a:hover {
    background: #151c3b;
    color: #fff;
}

.em-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.em-card,
.em-mission-intro,
.em-play,
.em-complete,
.em-admin-box {
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 10px 26px rgba(21, 28, 59, .08);
}

.em-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    position: relative;
    overflow: hidden;
}

.em-card::before,
.em-mission-intro::before,
.em-play::before,
.em-complete::before {
    content: "";
    display: block;
    height: 5px;
    border-radius: 999px;
    margin: -4px 0 18px;
    background: #1e6bff;
}

.em-level-primaire::before { background: #00b894; }
.em-level-college::before { background: #6c5ce7; }
.em-level-lycee::before { background: #0984e3; }
.em-level-melec::before { background: #e17055; }

.em-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.em-badge,
.em-difficulty {
    font-size: .78rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 6px 10px;
}

.em-badge {
    background: #edf3ff;
    color: #1e4fbf;
}

.em-difficulty {
    background: #f7f7f7;
    color: #5f6675;
}

.em-card h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.em-card p {
    line-height: 1.55;
}

.em-card-meta {
    color: #667085;
    font-weight: 700;
    font-size: .92rem;
}

.em-card-footer {
    margin-top: auto;
    justify-content: space-between;
    font-weight: 900;
}

.em-empty {
    background: #fff8e8;
    border: 1px solid #ffe1a6;
    border-radius: 18px;
    padding: 20px;
}

.em-back {
    display: inline-block;
    margin-bottom: 16px;
    color: #202538;
    font-weight: 800;
    text-decoration: none;
}

.em-mission-intro,
.em-play,
.em-complete {
    max-width: 860px;
    margin: 0 auto;
}

.em-story {
    margin-top: 24px;
    line-height: 1.7;
}

.em-story h2 {
    font-size: 1.15rem;
    margin: 22px 0 8px;
}

.em-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 26px 0;
}

.em-summary div {
    background: #f6f8fb;
    border-radius: 18px;
    padding: 16px;
    text-align: center;
}

.em-summary strong,
.em-summary span {
    display: block;
}

.em-summary strong {
    font-size: 1.3rem;
}

.em-summary span {
    color: #667085;
    font-weight: 700;
    margin-top: 4px;
}

.em-progress {
    height: 10px;
    background: #edf0f5;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}

.em-progress div {
    height: 100%;
    background: #1e6bff;
    border-radius: inherit;
}

.em-step-content {
    background: #f6f8fb;
    border-radius: 18px;
    padding: 20px;
    line-height: 1.75;
    font-size: 1.08rem;
    margin: 18px 0;
}

.em-options {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.em-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f6f8fb;
    border: 1px solid #e4e8f0;
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    font-weight: 700;
}

.em-options label:hover {
    background: #edf3ff;
}

.em-text-answer {
    display: grid;
    gap: 8px;
    font-weight: 800;
    margin: 18px 0;
}

.em-text-answer input,
.em-admin-form input,
.em-admin-form textarea,
.em-admin-form select {
    border: 1px solid #d6dce8;
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    width: 100%;
}

.em-feedback {
    border-radius: 18px;
    padding: 16px;
    margin: 18px 0;
    line-height: 1.55;
}

.em-feedback.ok {
    background: #e9fff5;
    border: 1px solid #b6f2d7;
}

.em-feedback.ko {
    background: #fff0f0;
    border: 1px solid #ffc6c6;
}

.em-complete {
    text-align: center;
}

.em-score {
    font-size: 1.3rem;
}

.em-admin-form {
    display: grid;
    gap: 14px;
}

.em-admin-form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.em-table {
    width: 100%;
    border-collapse: collapse;
}

.em-table th,
.em-table td {
    padding: 10px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
}

@media (max-width: 980px) {
    .em-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .em-hero {
        border-radius: 0 0 24px 24px;
        margin-top: 0;
    }

    .em-grid,
    .em-summary {
        grid-template-columns: 1fr;
    }

    .em-card-top {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* Correctif bouton POST EduMission */
.em-inline-form {
    margin: 0;
    padding: 0;
    display: inline-flex;
}

.em-inline-form button {
    font-family: inherit;
}

.em-card-footer .em-inline-form {
    margin-left: auto;
}

@media (max-width: 640px) {
    .em-card-footer {
        align-items: stretch;
    }

    .em-inline-form,
    .em-inline-form button {
        width: 100%;
    }
}

/* =========================================================
   EduMission V9 - accès libre + sauvegarde progression
   ========================================================= */
.em-free-note {
    margin-top: 18px;
    color: rgba(255,255,255,.86);
    font-size: .98rem;
    line-height: 1.6;
}

.em-save-box {
    margin: 18px 0;
    padding: 18px 20px;
    border-radius: 20px;
    background: #fff8df;
    border: 1px solid #ffe29a;
    color: #5b4400;
    line-height: 1.65;
    box-shadow: 0 12px 28px rgba(90, 60, 0, .08);
}

.em-save-box.em-save-ok {
    background: #eafaf0;
    border-color: #bcebc9;
    color: #145c2c;
}

.em-complete .em-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.em-complete .em-btn {
    margin-top: 8px;
}
