:root {
  --green: #4F7E00;
  --green-dark: #3d6200;
  --green-tint: #f2f6ea;
  --ink: #22281c;
  --muted: #7a8371;
  --line: #e3e7dc;
  --locked-bg: #f4f4f2;
  --locked-ink: #9aa093;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fbfcf9;
  line-height: 1.55;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 38px; height: 38px; object-fit: contain; }
.brand-name { font-weight: 700; letter-spacing: 0.2px; }

.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.linklike:hover { color: var(--green); }

.container { max-width: 760px; margin: 0 auto; padding: 22px 18px 60px; }

h1 { font-size: 26px; margin: 6px 0 18px; }
h2 { font-size: 18px; margin: 22px 0 10px; }

.breadcrumbs { margin-bottom: 4px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--green); }

.notice { background: var(--green-tint); border: 1px solid var(--line); padding: 12px 14px; border-radius: 10px; }

/* карта курса */
.module-list { display: grid; gap: 12px; }
.module-card {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--green);
  border-radius: 12px; padding: 16px 18px;
  text-decoration: none; color: var(--ink);
  transition: box-shadow .15s ease;
}
.module-card:hover { box-shadow: 0 3px 14px rgba(79, 126, 0, 0.13); }
.module-card.locked { border-left-color: var(--locked-ink); background: var(--locked-bg); color: var(--locked-ink); }
.module-title { font-weight: 700; font-size: 17px; }
.module-progress { font-size: 14px; color: var(--muted); }
.module-card.locked .module-progress { color: var(--locked-ink); }

/* список уроков */
.week-title { color: var(--green-dark); }
.lesson-list { display: grid; gap: 8px; margin-bottom: 8px; }
.lesson-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 10px; padding: 13px 15px; font-size: 15.5px;
}
.lesson-row.open {
  background: #fff; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.lesson-row.open:hover { border-color: var(--green); }
.lesson-row.open .lesson-cta { color: var(--green); font-weight: 600; white-space: nowrap; }
.lesson-row.locked { background: var(--locked-bg); color: var(--locked-ink); }
.lesson-date { font-size: 13.5px; white-space: nowrap; }

/* урок */
.video-wrap { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 18px; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-placeholder { background: var(--green-tint); display: block; }
.video-placeholder span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.lesson-text { margin-bottom: 18px; }
.homework {
  background: var(--green-tint); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.homework h2 { margin-top: 0; color: var(--green-dark); }
.extra-links ul { padding-left: 20px; }
.extra-links { margin-bottom: 18px; overflow-wrap: anywhere; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: #fff; border: 1px solid var(--green); color: var(--green);
  border-radius: 999px; padding: 3px 12px; font-size: 14px; text-decoration: none;
}
.tag:hover { background: var(--green); color: #fff; }

.locked-card { background: var(--locked-bg); border-radius: 12px; padding: 24px; text-align: center; }
.locked-card h1 { margin-bottom: 8px; }

/* вход и служебные формы */
.auth-card { max-width: 380px; margin: 8vh auto 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.auth-card h1 { font-size: 22px; }
.auth-card label { display: block; margin: 14px 0 4px; font-size: 14px; color: var(--muted); }
.auth-card input {
  width: 100%; padding: 11px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 9px;
}
.auth-card input:focus { outline: 2px solid var(--green); border-color: transparent; }
.btn-primary {
  width: 100%; margin-top: 18px; padding: 12px;
  background: var(--green); color: #fff; font-size: 16px; font-weight: 600;
  border: none; border-radius: 9px; cursor: pointer;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-link { display: block; text-align: center; text-decoration: none; }
.auth-hint { margin-top: 14px; font-size: 14px; text-align: center; }
.auth-hint a { color: var(--green); }
.form-error { margin-top: 10px; color: #a33; font-size: 14px; }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; }

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .container { padding: 16px 14px 50px; }
  .lesson-row { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* панель управления */
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-link { color: var(--green); text-decoration: none; font-weight: 600; }
.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; font-size: 15px; }
.flash-success { background: var(--green-tint); border: 1px solid var(--green); color: var(--green-dark); }
.flash-error { background: #fdeeee; border: 1px solid #d9a0a0; color: #a33; }
.panel-nav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-nav a {
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  color: var(--ink); border: 1px solid var(--line); background: #fff; font-size: 15px;
}
.panel-nav a.active { background: var(--green); border-color: var(--green); color: #fff; }
.panel-form-inline {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 18px;
}
.panel-form { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 13.5px; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 9px 10px; font-size: 15px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; min-width: 180px;
}
.field textarea { width: 100%; }
.panel-form .field input { width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--green); border-color: transparent; }
.btn-compact { width: auto; margin-top: 0; padding: 10px 18px; }
.panel-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.panel-table th { text-align: left; font-size: 13px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: middle; }
.panel-table tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { display: inline; }
.btn-small {
  display: inline-block; padding: 6px 12px; font-size: 13.5px; border-radius: 8px;
  border: 1px solid var(--green); color: var(--green); background: #fff;
  text-decoration: none; cursor: pointer;
}
.btn-small:hover { background: var(--green); color: #fff; }
.btn-cancel { border-color: var(--line); color: var(--muted); margin-left: 8px; }
.day-cell { white-space: nowrap; color: var(--muted); font-size: 13.5px; }
.warn { color: #b8860b; }
.hint { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
@media (max-width: 640px) {
  .panel-table thead { display: none; }
  .panel-table td { display: block; border-bottom: none; }
  .panel-table tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
}
