:root {
  --green: #519619;
  --green-dark: #3d7312;
  --green-soft: #eef6e6;
  --red: #F12D3B;
  --red-soft: #fdecee;
  --blue: #3A8DC2;
  --blue-soft: #e8f2f9;
  --pink-soft: #fdf1f4;
  --text: #3E3E47;
  --muted: #7a7a85;
  --line: #e6e6ea;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", "Rubik", Arial, sans-serif;
  color: var(--text);
  background: var(--pink-soft);
  font-size: 19px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
.loading { font-size: 60px; text-align: center; padding-top: 30vh; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--white); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 20px;
}
.brand { font-weight: 800; color: var(--green); font-size: 22px; letter-spacing: .5px; cursor: pointer; }
.brand span { color: var(--red); }
.topbar .who { margin-inline-start: auto; color: var(--muted); font-size: 16px; }
.topbar .who b { color: var(--text); }

.wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 30px; margin: 4px 0 16px; }
h2 { font-size: 24px; margin: 24px 0 12px; }
.muted { color: var(--muted); }

/* buttons */
.btn {
  border: 0; border-radius: 12px; padding: 12px 22px; cursor: pointer;
  background: var(--green); color: var(--white); font-weight: 700; font-size: 19px;
}
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 2px solid var(--line); }
.btn.ghost:hover { background: var(--white); }
.btn.small { padding: 6px 14px; font-size: 16px; }
.btn.red { background: var(--red); }
.linkbtn { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: 16px; text-decoration: underline; padding: 4px; }
.lang-switch { display: inline-flex; gap: 4px; }
.lang-switch button { border: 2px solid var(--line); background: var(--white); border-radius: 10px; padding: 4px 10px; cursor: pointer; font-size: 15px; }
.lang-switch button.on { border-color: var(--green); background: var(--green-soft); font-weight: 700; }

/* cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.login { max-width: 420px; margin: 8vh auto; text-align: center; }
.login .logo { font-size: 34px; font-weight: 800; color: var(--green); }
.login .logo span { color: var(--red); }
.field { text-align: start; margin: 14px 0; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 17px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--white);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--green); }
.error { color: var(--red); font-weight: 700; margin: 10px 0; min-height: 1.5em; }
.ok { color: var(--green-dark); font-weight: 700; }

/* progress bar */
.bar { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .3s; }

/* search */
.search { display: flex; gap: 8px; margin: 18px 0; }
.search input { flex: 1; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; }
.results { display: grid; gap: 8px; margin-bottom: 18px; }
.result { background: var(--white); border-radius: 12px; padding: 12px 16px; cursor: pointer; border: 2px solid transparent; }
.result:hover { border-color: var(--green); }
.result small { color: var(--muted); display: block; }
mark { background: #fff2a8; border-radius: 4px; padding: 0 2px; }

/* module grid */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.module {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; cursor: pointer; border: 3px solid transparent; text-align: start;
  display: flex; flex-direction: column; gap: 6px;
}
.module:hover { border-color: var(--green); }
.module .ico { font-size: 40px; }
.module .t { font-weight: 800; font-size: 21px; }
.status { font-size: 16px; font-weight: 700; border-radius: 99px; padding: 2px 10px; align-self: flex-start; }
.st-done { background: var(--green-soft); color: var(--green-dark); }
.st-quiz { background: var(--blue-soft); color: var(--blue); }
.st-new { background: #f1f1f3; color: var(--muted); }
.st-retry { background: var(--red-soft); color: var(--red); }

/* lesson step */
.step {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px 30px; margin: 18px 0; min-height: 320px;
  border-inline-start: 8px solid var(--green);
}
.step.warn { border-color: var(--red); background: var(--red-soft); }
.step.tip { border-color: var(--blue); background: var(--blue-soft); }
.step .big { font-size: 72px; line-height: 1; margin-bottom: 14px; }
.step .txt { font-size: 26px; font-weight: 600; }
.step.warn .txt { color: var(--red); font-size: 30px; }
.step ul { margin: 18px 0 0; padding-inline-start: 26px; font-size: 22px; }
.step li { margin: 8px 0; }
.step img { max-width: 100%; border-radius: 12px; margin-top: 16px; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.counter { color: var(--muted); font-weight: 700; }

/* quiz */
.q { font-size: 25px; font-weight: 700; margin: 8px 0 18px; }
.options { display: grid; gap: 10px; }
.opt {
  text-align: start; background: var(--white); border: 3px solid var(--line); border-radius: 14px;
  padding: 16px 18px; font-size: 21px; cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--green); }
.opt.right { border-color: var(--green); background: var(--green-soft); font-weight: 700; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt:disabled { cursor: default; }
.feedback { font-size: 20px; font-weight: 700; margin: 14px 0; min-height: 1.5em; }
.result-big { text-align: center; padding: 30px 10px; }
.result-big .e { font-size: 80px; }
.result-big .s { font-size: 30px; font-weight: 800; margin: 10px 0; }

/* admin table */
.tablewrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
th:first-child, td:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: var(--white); }
th { background: #fafafa; font-size: 15px; }
td.c-done { color: var(--green-dark); font-weight: 700; }
td.c-retry { color: var(--red); font-weight: 700; }
td.c-quiz { color: var(--blue); font-weight: 700; }
.inactive { opacity: .5; }
.rowform { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) {
  body { font-size: 17px; }
  .rowform { grid-template-columns: 1fr; }
  .step { padding: 24px 18px; }
  .step .txt { font-size: 22px; }
  .step ul { font-size: 19px; }
}
.ltr { direction: ltr; unicode-bidi: isolate; }
