:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body.auth-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    linear-gradient(135deg, rgba(49, 91, 125, 0.08), transparent 55%),
    #f3f6f8;
  color: #22313d;
  font-family: Arial, sans-serif;
}

.auth-shell {
  width: min(100%, 520px);
}

.auth-brand {
  margin-bottom: 14px;
  text-align: center;
}

.auth-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 9px;
  border-radius: 10px;
  background: #315b7d;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.auth-brand h1 {
  margin: 0;
  color: #173d5b;
  font-size: 24px;
}

.auth-card {
  padding: 24px;
  border: 1px solid #d6dfe5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(31, 41, 51, 0.1);
}

.auth-card h2 {
  margin: 0 0 6px;
  color: #173d5b;
  font-size: 18px;
}

.auth-card .auth-description {
  margin: 0 0 18px;
  color: #657682;
  font-size: 12px;
  line-height: 1.5;
}

.auth-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-heading-row h2 {
  margin-bottom: 0;
}

.auth-info {
  position: relative;
  flex: 0 0 auto;
}

.auth-info-button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #9fb0bc;
  border-radius: 50%;
  background: #fff;
  color: #315b7d;
  cursor: help;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.auth-info-button:hover,
.auth-info-button:focus-visible {
  border-color: #315b7d;
  background: #eef4f8;
  outline: none;
}

.auth-info-tooltip {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  max-width: calc(100vw - 72px);
  padding: 9px 10px;
  border: 1px solid #c7d2da;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.15);
  color: #405565;
  font-size: 11px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
}

.auth-info:hover .auth-info-tooltip,
.auth-info:focus-within .auth-info-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form label {
  display: block;
  margin-bottom: 5px;
  color: #405565;
  font-size: 11px;
  font-weight: 700;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #b9c7d1;
  border-radius: 4px;
  background: #fff;
  color: #22313d;
  font: inherit;
  font-size: 13px;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #315b7d;
  outline: 2px solid rgba(49, 91, 125, 0.14);
}

.auth-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
}

.auth-button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid #315b7d;
  border-radius: 4px;
  background: #315b7d;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.auth-button:hover:not(:disabled),
.auth-button:focus-visible:not(:disabled) {
  background: #244b69;
}

.auth-button.secondary {
  background: #fff;
  color: #315b7d;
}

.auth-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-status {
  min-height: 18px;
  margin: 13px 0 0;
  color: #405565;
  font-size: 12px;
  line-height: 1.45;
}

.auth-status.error {
  color: #9a2f2f;
}

.auth-status.success {
  color: #23633e;
}

.auth-note {
  margin: 13px 0 0;
  color: #657682;
  font-size: 11px;
  line-height: 1.5;
}

.auth-stage[hidden] {
  display: none;
}

.auth-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 14px 0;
}

.auth-qr {
  width: 230px;
  height: 230px;
  padding: 8px;
  border: 1px solid #d6dfe5;
  background: #fff;
  image-rendering: pixelated;
}

.auth-manual-key {
  width: 100%;
  padding: 9px;
  border: 1px dashed #9fb0bc;
  border-radius: 4px;
  background: #f7fafc;
  color: #173d5b;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: center;
}

.auth-divider {
  height: 1px;
  margin: 18px 0;
  background: #e4e9ed;
}

@media (max-width: 520px) {
  .auth-card {
    padding: 19px;
  }
}

@media print {
  body.auth-page {
    display: block;
    background: #fff;
  }

  .auth-brand,
  .auth-button-row,
  .auth-status,
  .auth-note,
  .auth-info {
    display: none;
  }

  .auth-card {
    border: 0;
    box-shadow: none;
  }
}

.auth-help-row {
  margin-top: -2px;
  text-align: right;
}

.auth-link {
  color: #315b7d;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
  text-decoration: underline;
}

.auth-button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-alert {
  margin: 0 0 16px;
  padding: 10px 11px;
  border: 1px solid #d4b36b;
  border-radius: 4px;
  background: #fffaf0;
  color: #684f1c;
  font-size: 12px;
  line-height: 1.5;
}