:root {
  --mt-bg: #f7f8fb;
  --mt-primary: #6B4AA0;
  --mt-dark: #583b88;
  --mt-accent: #8f73bd;
  --mt-text: #18202a;
  --mt-muted: #64707d;
  --mt-border: #dce2e8;
  --mt-card: #ffffff;
  --mt-shadow: 0 14px 36px rgba(24, 32, 42, 0.10);
  --mt-focus: 0 0 0 3px rgba(107, 74, 160, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--mt-bg);
  color: var(--mt-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}

h1,
h2,
h3,
label,
button,
.btn,
.link,
.auth-links,
.topnav a,
th {
  font-weight: 700;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-wrap {
  width: min(430px, 100%);
  background: var(--mt-card);
  border: 1px solid var(--mt-border);
  border-radius: 12px;
  box-shadow: var(--mt-shadow);
  overflow: hidden;
}

.auth-header {
  padding: 0;
  background: var(--mt-card);
  color: var(--mt-text);
  text-align: center;
}

.auth-header h1,
.auth-header p {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-body {
  width: 100%;
  padding: 34px 34px 30px;
  text-align: center;
}

.auth-logo {
  display: block;
  width: 210px;
  height: 98px;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto 18px;
}

.brand-name {
  margin: 0;
  color: var(--mt-text);
  font-size: 24px;
  line-height: 1.18;
  font-weight: 700;
}

.module-name {
  margin: 7px 0 24px;
  color: var(--mt-muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin: 0;
}

.field {
  margin: 0;
  text-align: left;
}

.field label {
  display: block;
  margin: 0 0 6px;
  color: var(--mt-text);
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
select,
input,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--mt-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--mt-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 400;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--mt-primary);
  box-shadow: var(--mt-focus);
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 43px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--mt-primary);
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover,
button:hover {
  background: var(--mt-dark);
}

.btn-danger,
.btn[style*="8b0000"] {
  background: var(--mt-primary) !important;
}

.btn-muted {
  background: var(--mt-accent);
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 17px 0 0;
  font-size: 13px;
}

.auth-links .muted {
  margin: 0;
}

.link {
  color: var(--mt-primary);
  text-decoration: none;
}

.link:hover {
  color: var(--mt-dark);
  text-decoration: underline;
}

.muted {
  color: var(--mt-muted);
  margin: 11px 0;
  line-height: 1.45;
}

.flash {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 0 14px;
  background: #f3eff9;
  border: 1px solid var(--mt-border);
  color: var(--mt-text);
  text-align: left;
}

.flash.danger {
  background: #fff4f4;
}

.flash.success {
  background: #f4fbf7;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: #ffffff;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--mt-border);
  padding: 7px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3eff9;
  color: var(--mt-text);
  font-size: 11px;
}

.admin-wrap {
  max-width: 1180px;
  margin: 24px auto;
  background: #ffffff;
  border: 1px solid var(--mt-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--mt-shadow);
}

.topnav {
  margin-bottom: 14px;
}

.small {
  font-size: 11px;
  color: var(--mt-muted);
}

.inline-form {
  display: inline-block;
  margin: 0 4px 4px 0;
}

@media (max-width: 520px) {
  .auth-page {
    align-items: start;
    padding: 18px 14px;
  }

  .auth-body {
    padding: 28px 22px 24px;
  }

  .auth-logo {
    width: 178px;
    height: 84px;
  }

  .brand-name {
    font-size: 21px;
  }

  .auth-links {
    display: grid;
    justify-content: center;
    text-align: center;
  }
}
