:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --text: #17202a;
  --muted: #5f6b7a;
  --line: #dbe2ea;
  --accent: #0f766e;
  --accent-dark: #0b514c;
  --accent-soft: #dff5f2;
  --warning-soft: #fff4d6;
  --danger-soft: #ffe5e5;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.topnav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.topnav a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.hero {
  min-height: 68vh;
  display: flex;
  align-items: center;
  padding: 72px clamp(18px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.92), rgba(23, 32, 42, 0.78)),
    url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #bff3ec;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.15;
}

h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.hero-text {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: #ffffff;
  color: var(--accent-dark);
}

.button.primary.dark {
  background: var(--accent);
  color: #ffffff;
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  background: transparent;
}

.button.secondary.light {
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.section {
  padding: 48px clamp(18px, 5vw, 72px) 72px;
}

.narrow {
  max-width: 920px;
  margin: 0 auto;
}

.auth-page {
  display: grid;
  min-height: calc(100vh - 160px);
  place-items: center;
  padding: 36px 18px;
}

.auth-card,
.content-block,
.lesson-hero,
.certificate {
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 480px);
}

label {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  color: var(--muted);
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.small-text {
  color: var(--muted);
  font-size: 14px;
}

.flash {
  margin: 16px clamp(18px, 5vw, 72px) 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
}

.flash.success {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.flash.error,
.warning {
  background: var(--danger-soft);
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.progress-panel {
  min-width: 160px;
  padding: 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  text-align: center;
}

.progress-panel span {
  display: block;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}

.progress-panel p {
  margin: 6px 0 0;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.lesson-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.card-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.status,
.locked {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--warning-soft);
  font-weight: 800;
}

.status.done {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.lesson-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 48px) 72px;
}

.lesson-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sidebar-title {
  margin: 0 0 12px;
  font-weight: 800;
}

.lesson-sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.lesson-sidebar a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.lesson {
  min-width: 0;
}

.lesson-hero,
.content-block {
  margin-bottom: 18px;
}

.lesson-hero {
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.96), rgba(23, 32, 42, 0.92)),
    url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.lesson-hero .eyebrow {
  color: #bff3ec;
}

.lesson-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.88);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.meta-row span {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.highlight {
  background: var(--accent-soft);
}

.stack {
  display: grid;
  gap: 18px;
}

.subsection {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.two-columns > div,
.example-box,
.question-box,
.prompt-box,
.result-box {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.example-box,
.question-box,
.prompt-box {
  margin-top: 16px;
}

.question-box {
  border-left: 4px solid var(--accent);
}

.prompt-box,
.result-box {
  border-color: var(--accent);
  background: #f4fbfa;
}

.check-list {
  padding-left: 20px;
}

.check-list li {
  margin-bottom: 8px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.level-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.level-card span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline li {
  margin-bottom: 12px;
}

.quiz-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.quiz-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.quiz-item legend {
  font-weight: 800;
}

.option-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: var(--text);
}

.certificate {
  min-height: 560px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  border: 8px solid var(--accent);
}

.certificate h1 {
  font-size: clamp(28px, 5vw, 48px);
}

.certificate h2 {
  font-size: clamp(30px, 6vw, 58px);
  color: var(--accent-dark);
}

.certificate-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.inline-form {
  margin: 0;
}

.small-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.footer {
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer p {
  margin: 0;
}

@media print {
  .topbar,
  .footer,
  .print-hide,
  .flash {
    display: none;
  }

  body {
    background: #ffffff;
  }

  .section {
    padding: 0;
  }

  .certificate {
    box-shadow: none;
  }
}

@media (max-width: 960px) {
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    position: static;
  }

  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
  }

  .dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-grid,
  .two-columns,
  .level-grid {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    display: none;
  }
}
