:root {
  --page: #faf7f2;
  --card: #ffffff;
  --ink: #251f21;
  --ink-2: #6b5f55;
  --hairline: #e6ded4;
  --teal: #4f8f7f;
  --teal-dark: #3a6f62;
  --teal-soft: rgba(79, 143, 127, 0.12);
  --sand: #f3ece1;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(37, 31, 33, 0.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Noto Sans Arabic", Arial, sans-serif;
  line-height: 1.7;
}
.page { max-width: 960px; margin: 0 auto; padding: 0 20px 48px; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--teal-dark); }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: 18px; }
.nav-links a { color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.nav-links a.active, .nav-links a:hover { color: var(--ink); box-shadow: inset 0 -2px 0 var(--teal); }
@media (max-width: 600px) { .nav-links a { min-height: 40px; display: inline-flex; align-items: center; } }

main { flex: 1; padding: 28px 0; }
.foot { border-top: 1px solid var(--hairline); padding: 16px 0; color: var(--ink-2); font-size: 13px; text-align: center; }

.hero { text-align: center; margin: 8px 0 28px; }
.hero img { width: 100%; max-width: 640px; border-radius: 20px; box-shadow: var(--shadow); }
.hero h1 { font-size: 30px; margin: 20px 0 6px; }
.hero .tag { color: var(--teal-dark); font-weight: 600; }
.hero p.lead { max-width: 640px; margin: 10px auto 0; color: var(--ink-2); }

h2.section { font-size: 22px; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.muted { color: var(--ink-2); }

.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: block; background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s ease, border-color .15s ease;
}
a.card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.card .cta { display: inline-block; margin-top: 10px; color: var(--teal-dark); font-weight: 600; font-size: 14px; }

.grade-card { display: flex; gap: 16px; align-items: flex-start; }
.badge {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: var(--teal-soft); color: var(--teal-dark); font-size: 22px; font-weight: 700;
}

.banner { display: flex; align-items: center; gap: 16px; background: var(--sand); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.banner img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.banner .t { font-weight: 600; }
.banner .s { color: var(--ink-2); font-size: 13px; }

.notice { background: var(--teal-soft); border: 1px solid var(--teal); border-radius: 12px; padding: 12px 16px; margin: 12px 0; font-size: 14px; }
.notice.warn { background: #fdf3e3; border-color: #d9a648; }
.notice.error { background: #fdecec; border-color: #d96a6a; color: #7a2c2c; }

form.panel { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 22px; max-width: 460px; margin: 0 auto; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 4px; }
input[type=email], input[type=password], input[type=text], input[type=url], input[type=file], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
textarea { min-height: 90px; resize: vertical; }

button, .btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--teal); color: #fff; border: none; border-radius: 10px; padding: 10px 22px;
  text-decoration: none; text-align: center;
}
button:hover, .btn:hover { background: var(--teal-dark); }
button.ghost, .btn.ghost { background: transparent; color: var(--teal-dark); border: 1px solid var(--teal); }
button.ghost:hover, .btn.ghost:hover { background: var(--teal-soft); }
button.danger { background: #c05b4d; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.video-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; margin: 12px 0; }
.video-wrap iframe, .video-wrap video { width: 100%; height: 100%; border: 0; }

.lecture { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--card); padding: 16px 18px; margin-bottom: 12px; }
.lecture h3 { margin: 0 0 4px; font-size: 16px; }
.lecture .meta { color: var(--ink-2); font-size: 13px; margin-bottom: 8px; }
.unit-title { font-size: 18px; font-weight: 700; margin: 26px 0 10px; }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.list-row .grow { flex: 1; }
.list-row small { color: var(--ink-2); display: block; }

.center { text-align: center; }
.spin { color: var(--ink-2); padding: 24px; text-align: center; }
