:root {
  --auth-bg: #f3f3f3;
  --auth-surface: #ffffff;
  --auth-panel: #f6f7f8;
  --auth-border: #d8dde3;
  --auth-text: #18212f;
  --auth-muted: #666f7f;
  --auth-primary: #004b93;
  --auth-primary-strong: #003e7a;
  --auth-pill-bg: #d8f0e2;
  --auth-pill-text: #0b7358;
  --auth-danger-bg: #fff1f2;
  --auth-danger-border: #fecdd3;
  --auth-danger-text: #be123c;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--auth-text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.85), transparent 36%),
    linear-gradient(180deg, #f7f7f7 0%, #efefef 100%);
}

.auth {
  position: relative;
  min-height: 100vh;
  padding: 56px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.auth-form {
  width: min(500px, 100%);
  padding: 34px 30px 32px;
  border-radius: 18px;
  background: var(--auth-surface);
  box-shadow: 0 18px 42px rgba(31, 41, 55, 0.12);
}

.auth-strip {
  margin-bottom: 18px;
  padding: 20px 18px;
  border-radius: 0;
  background: #f2f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-strip-logo {
  width: min(100%, 330px);
  height: auto;
  display: block;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.4rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--auth-primary);
}

.brand-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--auth-muted);
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.alert-error {
  background: var(--auth-danger-bg);
  color: var(--auth-danger-text);
  border: 1px solid var(--auth-danger-border);
}

.auth-form label {
  display: block;
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.auth-form label + input[type="text"],
.password-field {
  margin-bottom: 16px;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.password-field input[type="text"] {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: #f7f7f8;
  font-size: 0.95rem;
  color: var(--auth-text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-form input::placeholder {
  color: #8b93a2;
}

.auth-form input:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(0, 75, 147, 0.36);
  box-shadow: 0 0 0 4px rgba(0, 75, 147, 0.12);
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 48px;
}

.toggle-pass {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #7a8290;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.toggle-pass:hover {
  background: rgba(24, 33, 47, 0.05);
  color: #4b5563;
}

.toggle-pass:focus-visible {
  outline: 2px solid rgba(0, 75, 147, 0.45);
  outline-offset: 1px;
}

.toggle-pass-icon,
.toggle-pass-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.login-button {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--auth-primary);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.login-button:hover {
  transform: translateY(-1px);
  background: var(--auth-primary-strong);
  box-shadow: 0 10px 18px rgba(0, 75, 147, 0.16);
}

.login-button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.auth-divider {
  width: 100%;
  margin: 18px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d9dee5;
}

.auth-divider span {
  text-transform: lowercase;
}

.br-sign-in {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--auth-panel);
  color: #1351b4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.br-sign-in:hover {
  transform: translateY(-1px);
  background: #eef1f5;
}

.br-sign-in img {
  height: 22px;
  width: auto;
  display: block;
}

.security-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  color: #777f8d;
}

.auth-footer {
  width: min(500px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.env-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.env-prod {
  color: var(--auth-pill-text);
  background: var(--auth-pill-bg);
  border: 1px solid rgba(11, 115, 88, 0.18);
}

.env-homolog {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid rgba(154, 52, 18, 0.14);
}

.env-dev {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid rgba(146, 64, 14, 0.14);
}

.auth-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.last-commit {
  font-size: 0.92rem;
  color: var(--auth-muted);
}

.system-version {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(24, 33, 47, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.system-version-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7b8391;
}

.system-version-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--auth-primary);
}

.auth.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.76);
  z-index: 5;
}

.auth.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border: 4px solid #d9dee5;
  border-top-color: var(--auth-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 6;
}

@media (max-width: 540px) {
  .auth {
    padding: 32px 16px 24px;
  }

  .auth-form {
    padding: 24px 18px 24px;
    border-radius: 16px;
  }

  .auth-strip {
    padding: 16px 12px;
    margin-bottom: 16px;
  }

  .auth-title {
    font-size: 2rem;
  }

  .auth-divider {
    margin: 16px 0 14px;
  }

  .system-version {
    flex-direction: column;
    gap: 4px;
    border-radius: 18px;
  }
}
