* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #1e293b;
    background: #eef2f7;
}

a {
    color: inherit;
}

.class-header {
    position: relative;
    overflow: visible;
    background:
        linear-gradient(rgba(18, 32, 54, 0.76), rgba(18, 32, 54, 0.82)),
        url("photo/enfants ecodim.jpg") center/cover no-repeat;
    color: #fff;
    padding: 24px clamp(18px, 4vw, 56px) 56px;
}

.brand-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 80px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0;
}

.brand-line img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.menu-toggle {
    position: absolute;
    top: 22px;
    left: clamp(16px, 3vw, 34px);
    z-index: 20;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    display: grid;
    place-content: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.menu-toggle .bar {
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: #1e293b;
}

.menu-list {
    display: none;
    position: absolute;
    top: 76px;
    left: clamp(16px, 3vw, 34px);
    z-index: 30;
    width: min(280px, calc(100vw - 44px));
    background: #fff;
    color: #1e293b;
    border-radius: 8px;
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.menu-list.show {
    display: block;
}

.menu-list a {
    display: block;
    padding: 14px 18px;
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
}

.menu-list a:hover {
    background: #f8fafc;
}

.hero-classroom {
    width: min(1120px, 100%);
    margin: 34px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: end;
}

.eyebrow {
    margin: 0 0 10px;
    color: #facc15;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-classroom h1 {
    margin: 0;
    max-width: 720px;
    font-size: clamp(2.3rem, 5vw, 4.8rem);
    line-height: 1;
}

.hero-text {
    max-width: 640px;
    margin: 18px 0 0;
    color: #e2e8f0;
    font-size: 1.08rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.primary-action,
.secondary-action,
.admin-note a,
.lesson-actions a,
.lesson-actions button,
.quiz-actions button {
    min-height: 44px;
    border-radius: 8px;
    padding: 12px 18px;
    border: 0;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-action,
.lesson-actions a,
.quiz-actions button,
.admin-note a {
    background: #facc15;
    color: #1e293b;
}

.secondary-action,
.lesson-actions button {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.36);
}

.teacher-panel {
    background: rgba(255, 255, 255, 0.96);
    color: #1e293b;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.22);
}

.teacher-label {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.teacher-panel strong {
    display: block;
    margin-top: 8px;
    font-size: 1.35rem;
}

.teacher-panel small {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #475569;
}

.teacher-panel p {
    margin: 16px 0 0;
    line-height: 1.55;
}

main {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

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

.class-tools article,
.lesson-card,
.quiz-box,
.admin-note {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.class-tools article {
    padding: 20px;
}

.class-tools span {
    color: #2563eb;
    font-weight: 900;
}

.class-tools h2 {
    margin: 10px 0 8px;
    font-size: 1.05rem;
}

.class-tools p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.lesson-section,
.tp-section,
.cotation-section,
.admin-note {
    margin-top: 42px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h2,
.admin-note h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}

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

.lesson-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lesson-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #cbd5e1;
}

.lesson-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.lesson-meta span {
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}

.lesson-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.16rem;
    line-height: 1.3;
}

.lesson-card p {
    margin: 12px 0 0;
    color: #64748b;
    line-height: 1.6;
}

.lesson-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 18px;
}

.lesson-actions span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #64748b;
    font-weight: 800;
}

.lesson-actions button.is-done {
    background: #16a34a;
    border-color: #16a34a;
}

.quiz-box {
    padding: 22px;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.student-grid label {
    display: grid;
    gap: 8px;
    color: #0f172a;
    font-weight: 900;
}

.student-grid input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 13px;
    font: inherit;
    color: #0f172a;
    background: #fff;
}

.wide-field {
    grid-column: 1 / -1;
}

.quiz-box fieldset {
    min-width: 0;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.quiz-box legend {
    padding: 0 8px;
    font-weight: 900;
    color: #0f172a;
}

.quiz-box label {
    display: block;
    margin-top: 12px;
    line-height: 1.5;
}

.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.quiz-actions output {
    font-weight: 900;
    color: #0f172a;
}

.quiz-actions span {
    color: #475569;
    font-weight: 700;
    line-height: 1.45;
}

.class-alert {
    margin: 0 0 14px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 13px 15px;
    font-weight: 800;
}

.class-alert-error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.class-alert-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.grade-box,
.grade-summary,
.grade-list article {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.grade-box {
    padding: 22px;
}

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

.account-panel {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.account-panel-copy {
    min-height: 100%;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
    padding: 22px;
}

.account-panel-copy span {
    display: block;
    color: #facc15;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.account-panel-copy strong {
    display: block;
    margin-top: 12px;
    font-size: 1.45rem;
    line-height: 1.2;
}

.account-panel-copy p {
    margin: 14px 0 0;
    color: #cbd5e1;
    line-height: 1.6;
}

.account-grid-login {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
}

.login-box {
    width: min(760px, 100%);
    box-shadow: none;
}

.grade-box h3 {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 1.25rem;
}

.register-details {
    width: min(760px, 100%);
    padding: 0;
    overflow: hidden;
    box-shadow: none;
}

.register-details summary {
    list-style: none;
    min-height: 44px;
    padding: 13px 18px;
    background: #f8fafc;
    border-bottom: 1px solid transparent;
    color: #111827;
    font-weight: 900;
    cursor: pointer;
}

.register-details summary::-webkit-details-marker {
    display: none;
}

.register-details summary::after {
    content: "+";
    float: right;
    font-weight: 900;
}

.register-details[open] summary::after {
    content: "-";
}

.register-details[open] summary {
    border-bottom-color: #e2e8f0;
}

.register-details form {
    padding: 20px;
}

.student-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.student-profile span {
    display: block;
    color: #64748b;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.student-profile strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 1.35rem;
}

.student-profile small {
    display: block;
    margin-top: 4px;
    color: #475569;
}

.student-profile form {
    margin: 0;
}

.student-profile button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 800;
    cursor: pointer;
}

.grade-summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 18px;
}

.grade-summary strong {
    color: #166534;
    font-size: 1.35rem;
}

.grade-summary span {
    color: #475569;
    font-weight: 800;
}

.grade-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.grade-list article {
    padding: 16px;
}

.grade-list h3 {
    margin: 0 0 8px;
    color: #0f172a;
}

.grade-list p {
    margin: 0 0 6px;
    color: #334155;
    font-weight: 800;
}

.grade-list small {
    color: #64748b;
}

.admin-note {
    padding: 24px;
}

.admin-note p {
    max-width: 820px;
    color: #475569;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .hero-classroom {
        grid-template-columns: 1fr;
    }

    .teacher-panel {
        max-width: 520px;
    }

    .class-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lesson-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-panel {
        grid-template-columns: 1fr;
    }

    .account-panel-copy {
        min-height: auto;
    }
}

@media (max-width: 620px) {
    .class-header {
        padding: 18px 14px 38px;
    }

    .brand-line {
        flex-direction: column;
        gap: 6px;
        padding-left: 54px;
        min-height: 72px;
        font-size: 0.95rem;
    }

    .brand-line img {
        width: 54px;
        height: 54px;
    }

    .menu-toggle {
        top: 16px;
        left: 14px;
    }

    .menu-list {
        top: 68px;
        left: 14px;
        width: calc(100vw - 28px);
    }

    .hero-classroom {
        margin-top: 22px;
        gap: 20px;
    }

    .hero-classroom h1 {
        font-size: 2.35rem;
    }

    .hero-text {
        font-size: 1rem;
    }

    .primary-action,
    .secondary-action,
    .hero-actions,
    .lesson-actions,
    .lesson-actions a,
    .lesson-actions button,
    .admin-note a,
    .quiz-actions button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    main {
        width: min(100% - 24px, 1120px);
        padding-top: 24px;
    }

    .class-tools,
    .lesson-grid,
    .account-grid {
        grid-template-columns: 1fr;
    }

    .account-panel {
        padding: 12px;
    }

    .account-panel-copy {
        padding: 18px;
    }

    .lesson-body,
    .quiz-box,
    .grade-box,
    .admin-note {
        padding: 16px;
    }

    .student-grid {
        grid-template-columns: 1fr;
    }

    .wide-field {
        grid-column: auto;
    }

    .student-profile {
        align-items: stretch;
        flex-direction: column;
    }

    .student-profile button {
        width: 100%;
    }
}
