/* Classwork pages: assessments, submissions, grading, gradebook, course page sections.
   Builds on static/css/reader.css (md-* hero, cards, buttons). Flat brand colours only. */
.cw-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.cw-badge.is-todo { background: #f2f3f5; color: #545a63; }
.cw-badge.is-submitted { background: #e8f0fe; color: #1d4ed8; }
.cw-badge.is-graded { background: #e6f4ec; color: #008A48; }
.cw-badge.is-failed { background: #fdecea; color: #b42318; }
.cw-badge.is-late { background: #fff4e5; color: #b45309; }

.cw-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; color: var(--md-muted); font-size: .9rem; }
.cw-facts li { display: inline-flex; align-items: center; gap: 8px; }
.cw-facts i { color: var(--md-red); }

.cw-section { background: #fff; border-radius: var(--md-radius); box-shadow: var(--md-shadow); padding: 24px; margin-bottom: 20px; }
.cw-section h2 { font-size: 1.15rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.cw-section h2 i { color: var(--md-red); }
.cw-instructions { line-height: 1.75; color: #333; }
.cw-instructions img { max-width: 100%; height: auto; }

.cw-field { margin-bottom: 16px; }
.cw-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.cw-field textarea, .cw-field input[type=text], .cw-field input[type=number], .cw-field input[type=date], .cw-field input[type=time] {
  width: 100% !important; max-width: 100% !important; border: 1px solid #dcdce2 !important; border-radius: 10px !important; padding: 10px 12px !important; font: inherit; background: #fff !important; height: auto !important; box-shadow: none;
}
.cw-field textarea { min-height: 140px; resize: vertical; }
.cw-field input:focus, .cw-field textarea:focus { outline: 2px solid var(--md-red); outline-offset: 1px; }
.cw-drop { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px dashed #dcdce2; border-radius: 12px; cursor: pointer; }
.cw-drop:hover { border-color: var(--md-red); }
.cw-drop input { display: none !important; }
.cw-drop i { font-size: 1.4rem; color: var(--md-red); }
.cw-hint { color: var(--md-muted); font-size: .82rem; margin-top: 6px; }

.cw-question { border: 1px solid var(--md-line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.cw-question p { font-weight: 700; margin: 0 0 10px; }
.cw-choice { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; margin: 0; font-weight: 500; }
.cw-choice:hover { background: var(--md-bg); }
.cw-choice input { width: 18px !important; height: 18px; accent-color: var(--md-red); margin: 0; flex: none; }
.cw-choice.is-correct { background: #e6f4ec; color: #008A48; }

.cw-score { display: flex; align-items: center; gap: 18px; }
.cw-score-num { font-size: 2.2rem; font-weight: 800; color: var(--md-ink); line-height: 1; }
.cw-score-num small { font-size: 1rem; color: var(--md-muted); font-weight: 600; }
.cw-feedback { margin-top: 14px; padding: 14px 16px; background: var(--md-bg); border-radius: 12px; line-height: 1.6; white-space: pre-line; }

.cw-table-wrap { overflow-x: auto; }
.cw-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cw-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--md-muted); padding: 10px 12px; border-bottom: 1px solid var(--md-line); white-space: nowrap; }
.cw-table td { padding: 12px; border-bottom: 1px solid var(--md-line); vertical-align: top; }
.cw-table tr:last-child td { border-bottom: 0; }
.cw-table .cw-num { text-align: center; white-space: nowrap; }
.cw-grade-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.cw-grade-form input[type=number] { width: 90px !important; height: 38px !important; padding: 0 10px; border: 1px solid #dcdce2; border-radius: 8px; }
.cw-grade-form textarea { flex: 1; min-width: 180px; min-height: 38px; height: 38px; padding: 8px 10px; border: 1px solid #dcdce2; border-radius: 8px; font: inherit; resize: vertical; }
.cw-grade-form .md-btn { padding: 9px 16px; }
.cw-answer { margin-top: 6px; padding: 10px 12px; background: var(--md-bg); border-radius: 8px; white-space: pre-line; max-height: 160px; overflow: auto; font-size: .88rem; }

.cw-list { list-style: none; margin: 0; padding: 0; }
.cw-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--md-line); }
.cw-list > li:last-child { border-bottom: 0; }
.cw-list .cw-grow { flex: 1; min-width: 0; }
.cw-list a.cw-title { color: var(--md-ink); font-weight: 700; text-decoration: none; }
.cw-list a.cw-title:hover { color: var(--md-red); }
.cw-sub { color: var(--md-muted); font-size: .82rem; }

.cw-announce { padding: 14px 0; border-bottom: 1px solid var(--md-line); }
.cw-announce:last-child { border-bottom: 0; }
.cw-announce h3 { font-size: 1rem; margin: 0 0 4px; }
.cw-announce p { margin: 6px 0 0; white-space: pre-line; line-height: 1.6; color: #333; }

@media (max-width: 760px) {
  .cw-section { padding: 18px 16px; }
  .cw-grade-form textarea { min-width: 100%; }
}

/* Assessment document + exams */
.cw-doc h2 { flex-wrap: wrap; }
.cw-doc .md-reader { margin: 0 -6px; box-shadow: none; }
.cw-doc-body { max-height: none; line-height: 1.75; }
.cw-rules { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.cw-rules li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; }
.cw-rules li > i { color: var(--md-red); margin-top: 4px; width: 18px; text-align: center; }
.cw-rules li.is-secure { padding: 12px 14px; background: #fff4e5; border-radius: 12px; color: #6b3e0a; }
.cw-rules li.is-secure > i { color: #b45309; }
.cw-review h3 { font-size: 1rem; margin: 22px 0 12px; }
.cw-choice.is-wrong { background: #fdecea; color: #8a1c13; }
/* the theme hides native checkboxes/radios (opacity 0, absolute); show them in classwork pages */
.cw-section input[type=checkbox], .cw-section input[type=radio] { opacity: 1 !important; position: static !important; -webkit-appearance: auto; appearance: auto; flex: none; }
.ex-toggle > span > b { display: block; }
.ex-toggle .cw-sub b { display: inline; }
/* "Who are you?" for students without accounts */
.cw-who { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: 16px; background: #fbf7f2; border: 1px solid #efe3d3; }
.cw-who-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--md-red); font-size: 1.2rem; }
.cw-who-body { flex: 1; min-width: 0; }
.cw-who h3 { margin: 0 0 4px; font-size: 1.05rem; }
.cw-who-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }
.cw-who-form label { display: flex; flex-direction: column; gap: 5px; margin: 0; font-weight: 700; font-size: .82rem; }
.cw-who-form input { height: 46px !important; border: 1px solid #dcdce2 !important; border-radius: 12px !important; padding: 0 14px !important; background: #fff !important; font: inherit; font-size: 16px; width: 100% !important; }
.cw-who-form .md-btn { height: 46px; white-space: nowrap; }
.cw-who-me { margin: 12px 0 0; font-size: .85rem; color: var(--md-muted); }
.cw-who-me i { color: #008A48; }
.cw-who-me button { border: 0; background: none; padding: 0; color: var(--md-red); font-weight: 700; text-decoration: underline; cursor: pointer; width: auto; }
@media (max-width: 760px) { .cw-who { flex-direction: column; } .cw-who-form { grid-template-columns: 1fr; } }
