﻿:root {
  --brand-violet: #302070;
  --brand-violet-deep: #241753;
  --brand-teal: #75b7af;
  --brand-teal-soft: #d8efec;
  --brand-orange: #d67b45;
  --brand-cream: #f7eed9;
  --ink: #25223a;
  --muted: #716f7e;
  --line: #dedde6;
  --paper: #ffffff;
  --surface: #f5f5f8;
}

@font-face {
  font-family: "Tilda Sans";
  src: url("fonts/TildaSans-VF.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: "Tilda Sans", "Segoe UI", Arial, sans-serif;
}

button,
input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.is-hidden { display: none !important; }

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  color: var(--brand-violet);
  background: var(--paper);
}

.loading-screen img { width: min(320px, 74vw); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(390px, 0.9fr) minmax(560px, 1.1fr);
}

.brand-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background: var(--brand-violet);
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 48% 52% 54% 46%;
  pointer-events: none;
}

.brand-panel::before {
  width: 420px;
  height: 420px;
  right: -190px;
  top: -130px;
  background: var(--brand-teal);
  transform: rotate(22deg);
}

.brand-panel::after {
  width: 250px;
  height: 250px;
  left: -110px;
  bottom: -90px;
  background: var(--brand-orange);
}

.brand-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 18px 18px, #fff 2px, transparent 2.5px),
    radial-gradient(circle at 62px 54px, var(--brand-teal) 7px, transparent 7.5px),
    linear-gradient(135deg, transparent 44%, rgba(255,255,255,.28) 45%, rgba(255,255,255,.28) 48%, transparent 49%);
  background-size: 86px 86px, 112px 112px, 142px 142px;
  mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 84%, transparent);
}

.brand-panel-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(42px, 7vw, 90px);
}

.brand-logo-card {
  width: min(410px, 100%);
  padding: 22px 26px;
  border-radius: 26px 26px 26px 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 9, 47, .25);
}

.brand-logo-card img { display: block; width: 100%; height: auto; }

.brand-kicker {
  margin: 42px 0 14px;
  color: var(--brand-teal-soft);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.brand-panel h1,
.auth-heading h2,
.knowledge-content h1 {
  font-family: "Tilda Sans", "Segoe UI", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: .025em;
}

.brand-panel h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(44px, 5vw, 76px);
  line-height: .98;
  text-transform: uppercase;
}

.brand-description {
  max-width: 480px;
  margin: 24px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 19px;
  line-height: 1.45;
}

.brand-mark {
  position: absolute;
  right: clamp(34px, 5vw, 70px);
  bottom: clamp(34px, 5vw, 64px);
  width: 84px;
  height: auto;
  opacity: .72;
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 76px);
  background:
    linear-gradient(135deg, rgba(117,183,175,.11), transparent 42%),
    var(--surface);
}

.auth-card {
  width: min(100%, 500px);
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(48,32,112,.09);
  border-radius: 34px 34px 34px 10px;
  background: var(--paper);
  box-shadow: 0 26px 80px rgba(48,32,112,.12);
  transition: width .25s ease;
}

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

.auth-heading p,
.knowledge-content p {
  margin: 0 0 8px;
  color: var(--brand-orange);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-heading h2 {
  margin: 0;
  color: var(--brand-violet);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1;
  text-transform: uppercase;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 30px 0 26px;
  padding: 5px;
  border-radius: 14px;
  background: #efeff4;
}

.auth-tabs button,
.auth-tabs a {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.auth-tabs button.is-active,
.auth-tabs a.is-active {
  color: #fff;
  background: var(--brand-violet);
  box-shadow: 0 7px 16px rgba(48,32,112,.24);
}

.auth-form { display: grid; gap: 17px; }

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

.registration-grid .field-wide { grid-column: 1 / -1; }

.auth-form label { display: grid; gap: 8px; }

.auth-form label > span {
  color: #49465a;
  font-size: 14px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fbfbfd;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-form input:hover { border-color: #bebbcf; }

.auth-form input:focus {
  border-color: var(--brand-teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(117,183,175,.18);
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--brand-orange);
  border-radius: 8px;
  color: #7c3515;
  background: #fff2eb;
  font-size: 14px;
  line-height: 1.4;
}

.submit-button {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  padding: 0 10px 0 20px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--brand-violet);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(48,32,112,.24);
}

.submit-button b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--brand-violet);
  background: var(--brand-teal);
  font-size: 22px;
}

.submit-button:hover { background: var(--brand-violet-deep); transform: translateY(-1px); }
.submit-button:disabled { opacity: .65; cursor: wait; transform: none; }

.auth-switch-copy {
  margin: 24px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.auth-switch-copy button,
.auth-switch-copy a {
  padding: 0;
  border: 0;
  color: var(--brand-violet);
  background: transparent;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.knowledge-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 18%, rgba(117,183,175,.2), transparent 26%),
    var(--surface);
}

.knowledge-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 16px clamp(24px, 5vw, 72px);
  border-bottom: 1px solid rgba(48,32,112,.1);
  background: #fff;
}

.knowledge-header img { width: 230px; height: auto; }

.knowledge-account { display: flex; align-items: center; gap: 18px; font-weight: 800; }

.knowledge-account > div { display: grid; gap: 2px; text-align: right; }

.knowledge-account small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.knowledge-account form { margin: 0; }

.knowledge-account button {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid var(--brand-violet);
  border-radius: 10px;
  color: var(--brand-violet);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.knowledge-content { padding: clamp(54px, 9vw, 120px) clamp(24px, 8vw, 120px); }

.knowledge-dashboard { padding-bottom: 80px; }

.knowledge-content h1 {
  margin: 0;
  color: var(--brand-violet);
  font-size: clamp(52px, 9vw, 120px);
  line-height: .95;
  text-transform: uppercase;
}

.training-entry {
  width: min(100%, 380px);
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding: 10px 11px 10px 22px;
  border-radius: 16px;
  color: #fff;
  background: var(--brand-violet);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(48,32,112,.22);
}

.training-entry b {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--brand-violet);
  background: var(--brand-teal);
  font-size: 22px;
}

.training-entry:hover { background: var(--brand-violet-deep); transform: translateY(-1px); }

.admin-users {
  margin-top: clamp(54px, 8vw, 96px);
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(48,32,112,.1);
  border-radius: 28px 28px 28px 10px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(48,32,112,.09);
}

.admin-users-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-users-heading p { margin-bottom: 5px; }

.admin-users-heading h2 {
  margin: 0;
  color: var(--brand-violet);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  text-transform: uppercase;
}

.users-count {
  min-width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--brand-violet);
  background: var(--brand-teal-soft);
  font-size: 20px;
  font-weight: 900;
}

.admin-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--brand-teal);
  border-radius: 8px;
  color: #23645d;
  background: #edf9f7;
  font-size: 14px;
}

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

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

.users-table th {
  padding: 12px 14px;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.users-table td {
  min-width: 145px;
  padding: 16px 14px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.users-table td:first-child { min-width: 180px; }
.users-table td:last-child { min-width: 250px; }

.users-table td > strong,
.users-table td > span,
.users-table td > a { display: block; }

.users-table td > span,
.users-table td > a {
  margin-top: 3px;
  color: var(--muted);
}

.users-table a { color: var(--brand-violet); text-underline-offset: 2px; }

.role-badge {
  width: fit-content;
  margin: 0 !important;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.role-admin { color: #fff !important; background: var(--brand-violet); }
.role-teacher { color: #235f59 !important; background: var(--brand-teal-soft); }
.role-trainee { color: #8a4b20 !important; background: #fff0e4; }

.role-change-form {
  display: grid;
  grid-template-columns: minmax(125px, 1fr) auto;
  gap: 8px;
}

.role-change-form select {
  min-width: 0;
  height: 40px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.role-change-form select:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(117,183,175,.18);
}

.reset-password-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
}

.reset-password-form input {
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

.reset-password-form input:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(117,183,175,.18);
}

.role-change-form button,
.reset-password-form button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--brand-violet);
  font-weight: 900;
  cursor: pointer;
}

.self-account-note { color: var(--muted); font-size: 13px; }

@media (max-width: 1200px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-panel, .brand-panel-content { min-height: auto; }
  .brand-panel::before {
    width: 180px;
    height: 180px;
    right: -70px;
    top: -80px;
  }
  .brand-panel::after { display: none; }
  .brand-panel-content {
    min-height: 82px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    padding: 10px 24px;
  }
  .brand-logo-card {
    flex: 0 0 auto;
    width: 140px;
    padding: 7px 9px;
    border-radius: 10px 10px 10px 4px;
  }
  .brand-kicker {
    max-width: 145px;
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
  }
  .brand-description {
    max-width: 280px;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
  }
  .brand-mark { display: none; }
  .auth-panel { min-height: auto; padding: 28px 18px 48px; }
}

@media (max-width: 600px) {
  .brand-panel-content { min-height: 70px; gap: 12px; padding: 8px 16px; }
  .brand-logo-card { width: 112px; padding: 6px 7px; border-radius: 9px 9px 9px 3px; }
  .brand-kicker { max-width: 118px; font-size: 10px; letter-spacing: .08em; }
  .brand-description { display: none; }
  .auth-card { padding: 26px 20px; border-radius: 24px 24px 24px 8px; }
  .auth-heading h2 { font-size: 34px; }
  .registration-grid { grid-template-columns: 1fr; }
  .registration-grid .field-wide { grid-column: auto; }
  .knowledge-header { align-items: flex-start; padding: 14px 18px; }
  .knowledge-header img { width: 170px; }
  .knowledge-account { align-items: flex-end; flex-direction: column; gap: 8px; font-size: 13px; }
  .knowledge-account > div { text-align: right; }
  .knowledge-content { padding: 64px 22px; }
  .admin-users { margin-top: 48px; padding: 22px 16px; }
  .users-table thead { display: none; }
  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td { display: block; width: 100%; }
  .users-table tr {
    padding: 16px 0;
    border-top: 1px solid var(--line);
  }
  .users-table td {
    min-width: 0 !important;
    padding: 7px 0 7px 112px;
    border: 0;
    position: relative;
  }
  .users-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 102px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .role-change-form,
  .reset-password-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

