:root {
  --brand-red: #f95d51;
  --brand-green: #62c584;
  --brand-blue: #259bca;
  --brand-deep: #0676a4;
  --ink: #222;
  --muted: #6f7780;
  --line: #e6edf1;
  --panel: #fff;
  --wash: #f5f8fa;
  --shadow: 0 18px 45px rgba(17, 38, 54, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans Georgian", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(98, 197, 132, .12), transparent 38%),
    linear-gradient(315deg, rgba(37, 155, 202, .16), transparent 42%),
    var(--wash);
  user-select: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

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

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

.brand-home {
  padding: 4px;
  margin: -4px;
  color: inherit;
  text-align: left;
  background: transparent;
  border-radius: 8px;
  transition: background .2s ease, box-shadow .2s ease;
}

.brand-home:hover {
  background: rgba(6, 118, 164, .08);
}

.brand-home:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 155, 202, .22);
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 52px;
  border-radius: 8px;
  background: #fff;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 7px;
  background: var(--brand-deep);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(6, 118, 164, .22);
}

.btn.secondary {
  color: var(--brand-deep);
  background: #eaf6fb;
  box-shadow: none;
}

.btn.ghost {
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 460px);
}

.login-hero {
  padding: clamp(28px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
  background:
    linear-gradient(90deg, rgba(6, 35, 48, .96), rgba(6, 35, 48, .9)),
    url("assets/slides/part-1/slide-01.png") center / cover no-repeat;
  color: #fff;
}

.login-hero .brand h1 {
  color: #fff;
  font-size: 28px;
}

.login-hero .brand p {
  color: rgba(255, 255, 255, .82);
}

.login-hero > h1 {
  margin: 78px 0 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.login-hero > p {
  max-width: 560px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.6;
}

.login-panel {
  display: flex;
  align-items: center;
  padding: clamp(20px, 4vw, 44px);
  background: #fff;
}

.login-card {
  width: 100%;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  font-size: 13px;
  color: #3e4b54;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 46px;
  border: 1px solid #d7e2e8;
  border-radius: 7px;
  padding: 0 12px;
  outline: none;
}

.field textarea,
.admin-card textarea,
.admin-row input,
.admin-row select {
  width: 100%;
  border: 1px solid #d7e2e8;
  border-radius: 7px;
  padding: 11px 12px;
  outline: none;
  background: #fff;
}

.field textarea:focus,
.admin-card textarea:focus,
.admin-row input:focus,
.admin-row select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(37, 155, 202, .13);
}

.field input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(37, 155, 202, .13);
}

.hint {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #dcecef;
  border-radius: 7px;
  color: #42616d;
  background: #f3fbfc;
  font-size: 13px;
  line-height: 1.45;
}

.error {
  margin: 10px 0 0;
  color: #b9271f;
  font-weight: 700;
  min-height: 20px;
}

.main {
  padding: 26px clamp(16px, 4vw, 42px) 42px;
}

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

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: clamp(20px, 4vw, 34px);
  color: #fff;
  background: linear-gradient(135deg, #06384f, var(--brand-deep) 58%, var(--brand-green));
}

.intro-band h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  letter-spacing: 0;
}

.intro-band p {
  max-width: 780px;
  margin: 10px 0 0;
  line-height: 1.55;
}

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

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat strong {
  display: block;
  font-size: 24px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

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

.module-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(17, 38, 54, .06);
}

.wide-card {
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  align-items: center;
}

.module-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef4f7;
}

.module-card h3 {
  margin: 0;
  font-size: 20px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.progress-track {
  height: 9px;
  border-radius: 99px;
  background: #edf3f6;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: var(--progress);
  background: linear-gradient(90deg, var(--brand-red), var(--brand-green));
}

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

.side {
  align-self: start;
  position: sticky;
  top: 92px;
  display: grid;
  gap: 10px;
}

.side button {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.side button.active {
  border-color: rgba(37, 155, 202, .55);
  background: #eef9fd;
}

.slide-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.slide-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.slide-head h2 {
  margin: 0;
  font-size: 20px;
}

.slide-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.slide-stage {
  background: #eef4f7;
  padding: clamp(8px, 2vw, 18px);
}

.slide-stage img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  background: #fff;
  border-radius: 7px;
  pointer-events: none;
}

.single-training {
  max-width: 1180px;
  margin: 0 auto;
}

.slide-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.quiz {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.quiz-focus {
  max-width: 860px;
}

.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quiz-head span {
  display: block;
  color: var(--brand-deep);
  font-weight: 800;
  margin-bottom: 4px;
}

.quiz-head h2 {
  margin: 0;
  font-size: 24px;
}

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

.question h3 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.45;
}

.question-media {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f7fafb;
}

.question-media img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  pointer-events: none;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 11px;
  border: 1px solid #dce7ed;
  border-radius: 7px;
  margin-top: 9px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.option:hover:not(:disabled) {
  border-color: var(--brand-blue);
  background: #f3fbff;
}

.option:disabled {
  cursor: default;
}

.option-letter {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  color: var(--brand-deep);
  background: #eaf6fb;
  border-radius: 99px;
  font-weight: 800;
}

.option.correct {
  border-color: #2fa862;
  background: #e7f8ed;
}

.option.correct .option-letter {
  color: #fff;
  background: #2fa862;
}

.option.wrong {
  border-color: #d9483f;
  background: #fdecea;
}

.option.wrong .option-letter {
  color: #fff;
  background: #d9483f;
}

.option.locked {
  opacity: .62;
}

.answer-feedback {
  margin-top: 14px;
  min-height: 26px;
  color: var(--muted);
  font-weight: 800;
}

.answer-feedback.ok {
  color: #237b48;
}

.answer-feedback.bad {
  color: #b9271f;
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mini-stats {
  color: var(--muted);
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 28, 40, .62);
}

.modal {
  width: min(640px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
}

.modal h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

.terms-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.terms-list p {
  margin: 0;
  padding: 11px 12px;
  border-left: 4px solid var(--brand-blue);
  border-radius: 6px;
  color: #40515b;
  background: #f4f9fb;
  line-height: 1.45;
}

.terms-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 7px;
  border: 1px solid #dce7ed;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.terms-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand-green);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

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

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #06384f, var(--brand-deep));
}

.admin-hero h2 {
  margin: 0;
  font-size: 34px;
}

.admin-hero p {
  margin: 8px 0 0;
  max-width: 760px;
  line-height: 1.5;
}

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

.admin-tabs {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-tabs button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 7px;
  color: #40515b;
  background: transparent;
  font-weight: 800;
}

.admin-tabs button.active {
  color: #fff;
  background: var(--brand-deep);
}

.admin-page-hidden {
  display: none !important;
}

.admin-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 38, 54, .06);
}

.admin-card h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.admin-json-hidden {
  display: none;
}

.question-editor {
  display: grid;
  gap: 12px;
}

.options-editor {
  display: grid;
  gap: 10px;
}

.question-option-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.correct-radio {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #40515b;
  font-weight: 800;
  font-size: 13px;
}

.correct-radio input {
  accent-color: var(--brand-green);
}

.admin-note {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 150px auto;
  gap: 10px;
  align-items: end;
}

.admin-row.users-row {
  grid-template-columns: repeat(6, minmax(130px, 1fr)) 140px auto;
}

.admin-row.compact {
  grid-template-columns: auto auto;
  justify-content: start;
  margin-top: 12px;
}

.user-bulk-actions {
  margin-top: 10px;
}

.bulk-upload-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.bulk-actions {
  margin-top: 0;
}

.bulk-status {
  min-height: 20px;
  margin-top: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.bulk-status.success {
  color: #277b4b;
}

.bulk-status.error {
  color: #b9271f;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #40515b;
  background: #f5f9fb;
}

.admin-table .select-col {
  width: 46px;
  text-align: center;
}

.admin-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-deep);
}

.admin-table small {
  color: var(--muted);
}

.result {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result > *:not(.result-fireworks) {
  position: relative;
  z-index: 1;
}

.result-wide {
  max-width: 980px;
}

.result-passed {
  border-color: rgba(47, 168, 98, .38);
  background:
    linear-gradient(135deg, rgba(47, 168, 98, .14), rgba(255, 255, 255, .92) 42%),
    #f7fff9;
}

.result-failed {
  border-color: rgba(217, 72, 63, .38);
  background:
    linear-gradient(135deg, rgba(217, 72, 63, .13), rgba(255, 255, 255, .95) 42%),
    #fff7f6;
}

.result-fireworks {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .95;
  background:
    radial-gradient(circle at 18% 18%, rgba(47, 168, 98, .85) 0 2px, transparent 3px),
    radial-gradient(circle at 22% 22%, rgba(243, 186, 69, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 18%, rgba(47, 168, 98, .75) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 78%, rgba(37, 155, 202, .7) 0 2px, transparent 3px);
}

.result-fireworks::before,
.result-fireworks::after {
  content: "";
  position: absolute;
  inset: -80px;
  background:
    repeating-conic-gradient(from 4deg at 18% 20%, rgba(47, 168, 98, .26) 0 5deg, transparent 5deg 17deg),
    repeating-conic-gradient(from 12deg at 82% 18%, rgba(243, 186, 69, .28) 0 4deg, transparent 4deg 16deg),
    repeating-conic-gradient(from 28deg at 74% 82%, rgba(37, 155, 202, .2) 0 4deg, transparent 4deg 18deg);
  mask-image:
    radial-gradient(circle at 18% 20%, #000 0 72px, transparent 74px),
    radial-gradient(circle at 82% 18%, #000 0 64px, transparent 66px),
    radial-gradient(circle at 74% 82%, #000 0 58px, transparent 60px);
}

.result-fireworks::after {
  transform: rotate(18deg) scale(.82);
  opacity: .7;
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.result h2 {
  margin: 0;
  font-size: 32px;
}

.result p {
  color: var(--muted);
  line-height: 1.45;
}

.result .score {
  color: var(--brand-deep);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.result-passed .score {
  color: #237b48;
}

.result-failed .score {
  color: #b9271f;
}

.result-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
}

.result-badge {
  margin-bottom: 10px;
}

.result-badge.passed,
.status-pill.passed {
  color: #17663a;
  background: #dff7e7;
}

.result-badge.failed,
.status-pill.failed {
  color: #9f221b;
  background: #ffe3e0;
}

.score-scale {
  height: 18px;
  margin: 22px 0;
  border-radius: 99px;
  overflow: hidden;
  background: #eef3f6;
  box-shadow: inset 0 0 0 1px rgba(6, 118, 164, .08);
}

.score-scale-fill {
  width: var(--score);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-red), #f3ba45 45%, var(--brand-green));
}

.result-passed .score-scale-fill {
  background: linear-gradient(90deg, #237b48, var(--brand-green));
}

.result-failed .score-scale-fill {
  background: linear-gradient(90deg, #b9271f, var(--brand-red));
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat.good strong {
  color: #237b48;
}

.stat.bad strong {
  color: #b9271f;
}

.stat.required strong {
  color: var(--brand-deep);
}

.certificate-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid rgba(47, 168, 98, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
}

.certificate-panel h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.certificate-panel p {
  margin: 0;
}

.answer-review {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.answer-review h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.review-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.review-item.correct {
  border-left: 5px solid #2fa862;
}

.review-item.wrong {
  border-left: 5px solid #d9483f;
}

.review-status {
  align-self: start;
  padding: 7px 9px;
  border-radius: 99px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #2fa862;
}

.review-item.wrong .review-status {
  background: #d9483f;
}

.review-item span {
  display: block;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}

.review-item h4 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.4;
}

.review-item p {
  margin: 4px 0 0;
  color: #475761;
}

.empty-review {
  padding: 16px;
  border: 1px dashed #cbdce3;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbfc;
}

@media (max-width: 900px) {
  .login-wrap,
  .trainer,
  .intro-band,
  .wide-card,
  .admin-grid,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 430px;
  }

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

  .stat-grid,
  .module-grid,
  .result-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .topbar,
  .userbar,
  .slide-head,
  .slide-actions,
  .quiz-head,
  .quiz-footer,
  .result-summary,
  .certificate-panel,
  .modal-actions,
  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-grid,
  .module-grid,
  .side,
  .result-stats {
    grid-template-columns: 1fr;
  }

  .review-item {
    grid-template-columns: 1fr;
  }

  .question-option-row {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    flex-direction: column;
  }

  .bulk-upload-grid {
    grid-template-columns: 1fr;
  }
}
