:root {
  --ink: #16213a;
  --muted: #617084;
  --line: #d7dee8;
  --paper: #fbfcfe;
  --panel: #ffffff;
  --primary: #16b800;
  --primary-dark: #118a05;
  --accent: #a83a24;
  --good: #15803d;
  --bad: #b91c1c;
  --warn: #b45309;
  --shadow: 0 20px 50px rgba(31, 41, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(22, 184, 0, 0.13), transparent 38%),
    linear-gradient(225deg, rgba(168, 58, 36, 0.1), transparent 42%),
    #f3f7f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(215, 222, 232, 0.75);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12);
  flex: 0 0 auto;
}

.hero-logo {
  width: 118px;
  height: 118px;
  margin-bottom: 22px;
}

.brand strong {
  display: block;
  line-height: 1.1;
}

.brand-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.brand span,
.subtle {
  color: var(--muted);
}

.brand span.brand-kicker {
  color: var(--primary-dark);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.screen {
  width: min(1160px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--panel);
  border: 1px solid rgba(215, 222, 232, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-intro {
  padding: clamp(28px, 6vw, 56px);
  background:
    linear-gradient(135deg, rgba(22, 184, 0, 0.91), rgba(58, 55, 55, 0.82)),
    url("Logo Homepage Weiser Rand.png") center / cover;
  color: #fff;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.login-intro h1,
.page-title h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-intro p {
  margin: 18px 0 0;
  max-width: 56ch;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
}

.login-form {
  padding: clamp(24px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.section-label {
  color: #344256;
  font-weight: 700;
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
}

.field input:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 800;
  color: var(--ink);
  background: #e8eef5;
  white-space: nowrap;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.ghost {
  background: transparent;
  color: var(--primary-dark);
}

.btn.danger {
  background: #fee2e2;
  color: var(--bad);
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.9rem;
}

.message {
  min-height: 24px;
  color: var(--bad);
  font-weight: 700;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

.module-section {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.module-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.module-section-head h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.module-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-weight: 800;
  text-transform: lowercase;
}

.module-divider {
  height: 1px;
  margin: 30px 0 8px;
  background: linear-gradient(90deg, transparent, rgba(52, 66, 86, 0.28), transparent);
}

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

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 222, 232, 0.92);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(31, 41, 55, 0.08);
}

.module-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  min-height: 230px;
}

.module-card.instruction-card {
  color: #fff;
  background: linear-gradient(135deg, #118a05, #16b800);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 18px 44px rgba(17, 138, 5, 0.24);
}

.module-card.instruction-card .subtle {
  color: rgba(255, 255, 255, 0.82);
}

.module-card.instruction-card h2 {
  color: #fff;
}

.module-card.instruction-card .pill {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.module-card.instruction-card .pill.good {
  background: #fff;
  color: var(--good);
}

.module-card.instruction-card .pill.warn {
  background: #fff8d8;
  color: #7c3d00;
}

.module-card.instruction-card .progressbar {
  background: rgba(255, 255, 255, 0.28);
}

.module-card.instruction-card .progressbar span {
  background: #fff;
}

.module-card.instruction-card .btn.primary {
  background: #fff;
  color: var(--primary-dark);
}

.module-card.instruction-card .btn:not(.primary) {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.module-card h2,
.panel h2,
.content-pane h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344256;
  font-size: 0.83rem;
  font-weight: 800;
}

.pill.good {
  color: #fff;
  background: var(--good);
}

.pill.warn {
  color: #fff;
  background: var(--warn);
}

.pill.admin {
  color: #fff;
  background: #2563eb;
}

.progressbar {
  height: 10px;
  background: #e7edf4;
  border-radius: 999px;
  overflow: hidden;
}

.progressbar span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--primary), #2563eb);
}

.module-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.step-list {
  position: sticky;
  top: 92px;
  padding: 12px;
}

.step-button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px;
  margin: 4px 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.step-button:hover:not(:disabled),
.step-button.active {
  background: #e9f5f4;
}

.step-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #94a3b8;
  font-size: 0.82rem;
  font-weight: 900;
}

.step-button.done .step-dot {
  background: var(--good);
}

.step-button.active .step-dot {
  background: var(--primary);
}

.content-pane {
  padding: clamp(18px, 4vw, 28px);
}

.content-pane p,
.content-pane li {
  color: #334155;
  line-height: 1.65;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
}

.audio-frame {
  width: 100%;
  padding: 18px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.audio-frame audio {
  width: 100%;
  display: block;
}

.module-image-frame {
  margin: 16px 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.module-image-frame img {
  width: 100%;
  display: block;
}

.key-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.key-list li {
  padding: 12px 14px;
  background: #f5f8fb;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin: 16px 0 22px;
}

.option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.option input {
  margin-top: 4px;
}

.quiz-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.quiz-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
}

.admin-sidebar {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.employee-list {
  display: grid;
  gap: 12px;
}

.employee-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.employee-summary::-webkit-details-marker {
  display: none;
}

.employee-summary::before {
  content: "›";
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--primary-dark);
  font-weight: 900;
  transform: rotate(0deg);
  transition: transform 0.18s ease;
  flex: 0 0 auto;
}

.employee-row[open] .employee-summary::before {
  transform: rotate(90deg);
}

.employee-details {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.employee-row.archived {
  background: #f7f7f7;
  border-style: dashed;
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.certificate-preview {
  margin-top: 18px;
  padding: 18px;
  border: 2px solid #d6a441;
  border-radius: 8px;
  background: #fffdf7;
  text-align: center;
}

.progress-detail-list {
  display: grid;
  gap: 12px;
}

.progress-detail-list.compact {
  gap: 8px;
}

.progress-detail-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.employee-edit-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.employee-edit-form .toolbar {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.module-settings-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.module-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.module-setting-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.confirmation-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(22, 184, 0, 0.35);
  border-radius: 8px;
  background: #f2fbf0;
}

.signature-preview {
  min-height: 86px;
  display: grid;
  place-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.signature-preview img {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}

.signature-pad {
  width: 100%;
  aspect-ratio: 31 / 11;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.empty {
  color: var(--muted);
  padding: 18px;
  background: #f7fafc;
  border-radius: 8px;
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  margin: 12px auto 0;
  border-top: 1px solid rgba(22, 184, 0, 0.22);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.legal-footer a {
  color: var(--muted);
  text-decoration: none;
}

.legal-footer a:focus,
.legal-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.legal-page {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 18px;
}

.legal-header {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 14px;
}

.back-link {
  width: fit-content;
  color: var(--primary-dark);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.back-link:focus,
.back-link:hover {
  text-decoration: underline;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.legal-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.legal-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.legal-section h2 {
  margin: 10px 0 0;
  color: var(--primary-dark);
  font-size: 1.05rem;
}

.legal-section h2:first-child {
  margin-top: 0;
}

.legal-section p,
.legal-section ul {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.legal-section ul {
  padding-left: 20px;
}

.legal-section a {
  color: var(--primary-dark);
  font-weight: 750;
}

.legal-updated {
  color: var(--muted) !important;
  font-size: 0.9rem;
  font-weight: 750;
}

@media (max-width: 860px) {
  .login-panel,
  .module-layout,
  .admin-layout,
  .employee-edit-form,
  .modules-grid {
    grid-template-columns: 1fr;
  }

  .step-list {
    position: static;
  }

  .page-title,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .step-list,
  .toolbar,
  .btn,
  .login-wrap,
  .legal-footer {
    display: none !important;
  }

  .screen,
  .content-pane,
  .card {
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
}
