.auth-gate {
  position: relative;
  min-height: 100vh;
}

.auth-gate__app {
  min-height: 100vh;
  transition: filter 0.35s ease, opacity 0.35s ease;
}

.auth-gate__app--dimmed {
  filter: blur(5px) brightness(0.72);
  pointer-events: none;
  user-select: none;
}

.auth-gate__overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(31, 78, 121, 0.42);
  backdrop-filter: blur(2px);
  animation: auth-gate-fade-in 0.3s ease;
}

.auth-gate__overlay--fade-out {
  animation: auth-gate-fade-out 0.45s ease forwards;
}

.auth-gate__panel {
  width: min(100%, 22rem);
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--auth-border, #d1d5db);
  background: var(--auth-panel-bg, #ffffff);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.auth-gate--dark .auth-gate__panel {
  --auth-panel-bg: #2d3436;
  --auth-border: #4f5b66;
  --auth-text: #e6e8eb;
  --auth-muted: #9ca3af;
}

.auth-gate--light .auth-gate__panel {
  --auth-text: #2d3436;
  --auth-muted: #4f5b66;
}

.auth-gate__logo {
  display: block;
  width: min(100%, 240px);
  height: auto;
  margin: 0 auto 0.85rem;
}

.auth-gate__subtitle {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--auth-muted);
}

.auth-gate__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  margin-bottom: 0.65rem;
}

.auth-gate__field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--auth-muted);
}

.auth-gate__password-row {
  display: flex;
  gap: 0.35rem;
}

.auth-gate__input {
  flex: 1;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  background: var(--auth-input-bg, #e6e8eb);
  color: var(--auth-text);
  font-size: 0.88rem;
}

.auth-gate--dark .auth-gate__input {
  --auth-input-bg: #1a1f23;
}

.auth-gate__toggle {
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  background: transparent;
  color: var(--auth-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-gate__toggle:hover {
  border-color: #1f4e79;
  color: #1f4e79;
}

.auth-gate__remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.15rem 0 0.75rem;
  font-size: 0.78rem;
  color: var(--auth-muted);
  text-align: left;
  cursor: pointer;
}

.auth-gate__remember input {
  accent-color: #1f4e79;
}

.auth-gate__submit {
  width: 100%;
  padding: 0.48rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: #1f4e79;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-gate__submit:hover:not(:disabled) {
  background: #163a5c;
}

.auth-gate__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-gate__error {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b91c1c;
}

.auth-gate__lockout {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--auth-muted);
  line-height: 1.35;
}

.auth-gate__loading {
  margin: 0;
  font-size: 0.85rem;
  color: var(--auth-muted);
}

@keyframes auth-gate-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes auth-gate-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
