/* =========================================
   RESTEM — Lớp học (trang riêng, tách khỏi Cộng đồng)
   Giao diện sáng xanh mint, đồng bộ toàn app, responsive.
   ========================================= */
:root {
    --c-primary: #10b981;
    --c-primary-dark: #059669;
    --c-ink: #0f2e28;
    --text-1: #1f2937;
    --text-2: #5b7c74;
    --c-bg: #f0fdf4;
    --c-line: #d1fae5;
    --grad-primary: linear-gradient(135deg, #10b981 0%, #059669 55%, #047857 100%);
    --radius: 18px;
    --shadow-sm: 0 6px 18px rgba(16, 185, 129, .10);
    --shadow-md: 0 14px 34px rgba(15, 42, 40, .10);
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Baloo 2', system-ui, -apple-system, sans-serif; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--c-bg); color: var(--c-ink); min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(circle at 12% 8%, rgba(16, 185, 129, .13), transparent 42%),
        radial-gradient(circle at 88% 6%, rgba(56, 189, 248, .10), transparent 40%),
        linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}

:focus-visible { outline: 3px solid rgba(16, 185, 129, .35); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.cr-header {
    background: #fff; border-bottom: 1px solid var(--c-line);
    box-shadow: 0 2px 12px rgba(15, 42, 40, .05);
    position: sticky; top: 0; z-index: 20;
}
.cr-header-inner {
    max-width: 900px; margin: 0 auto; padding: 12px clamp(14px, 4vw, 24px);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cr-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cr-brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 3px solid var(--c-primary); flex-shrink: 0; }
.cr-brand h1 {
    font-size: 1.25rem; font-weight: 800; line-height: 1.1;
    background: linear-gradient(120deg, #065f46, #10b981);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.cr-brand span { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.cr-user { display: flex; align-items: center; gap: 10px; }
.cr-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c-line); }
.cr-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.cr-user-meta .nm { font-weight: 700; font-size: .9rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-user-meta .rl { font-size: .72rem; color: var(--c-primary-dark); font-weight: 700; }
.cr-logout {
    background: #ecfdf5; color: #047857; border: 1.5px solid rgba(16, 185, 129, .4);
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
    font-size: 1.1rem; transition: background .18s, transform .18s;
}
.cr-logout:hover { background: #d1fae5; transform: translateY(-1px); }

/* ---------- Layout ---------- */
.cr-wrap { max-width: 900px; margin: 0 auto; padding: clamp(18px, 4vw, 30px) clamp(14px, 4vw, 24px) 100px; }
.cr-title { text-align: center; margin-bottom: 22px; }
.cr-title h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 800; color: var(--c-ink); }
.cr-title p { color: var(--text-2); font-weight: 500; margin-top: 6px; max-width: 560px; margin-inline: auto; }

/* ---------- Cards & controls (khớp markup render) ---------- */
.widget-card {
    background: #fff; border: 1.5px solid var(--c-line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow-md);
}
.widget-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--c-ink); font-size: 1.02rem; }
.widget-title i { color: var(--c-primary); }

.form-input {
    width: 100%; padding: 11px 14px; border: 2px solid var(--c-line); border-radius: 12px;
    font-size: 1rem; background: #fff; color: var(--c-ink); outline: none; font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
}
.form-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(16, 185, 129, .14); }
.form-input::placeholder { color: #9fc4bb; }

.btn-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--grad-primary); color: #fff; border: none; cursor: pointer;
    padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: .95rem; font-family: inherit;
    white-space: nowrap; transition: transform .15s var(--ease), box-shadow .15s, filter .15s;
    box-shadow: 0 6px 16px rgba(16, 185, 129, .26);
}
.btn-action:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn-action:active { transform: none; }

.settings-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid #eef4f2;
}
.settings-item:last-child { border-bottom: none; }
.settings-item-info strong { font-weight: 700; color: var(--c-ink); }
.settings-item-info p { font-size: .82rem; color: var(--text-2); margin-top: 2px; }

/* Khóa học của lớp (details) */
.class-course summary { list-style: none; }
.class-course summary::-webkit-details-marker { display: none; }
.class-course[open] > summary { color: var(--c-primary-dark); }
.class-course-body :is(h1, h2, h3, h4) { color: var(--c-ink); margin: 10px 0 4px; }
.class-course-body ul, .class-course-body ol { padding-left: 22px; }

/* ---------- Nút về trang chủ ---------- */
.cr-home {
    position: fixed; bottom: 18px; right: 18px; z-index: 50;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--grad-primary); color: #fff; text-decoration: none;
    padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: .92rem;
    box-shadow: 0 10px 24px rgba(16, 185, 129, .35); transition: transform .18s;
}
.cr-home:hover { transform: translateY(-2px); }

@media (max-width: 560px) {
    .cr-user-meta { display: none; }
    .cr-home span { display: none; }
    .cr-home { padding: 12px; }
}
