/* Shared login / logout page shell */
:root {
  --auth-primary: #2563eb;
  --auth-primary-hover: #1e40af;
  --auth-gray-700: #374151;
  --auth-gray-500: #6b7280;
  --auth-gray-300: #d1d5db;
  --auth-overlay: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.82) 0%,
    rgba(30, 41, 59, 0.72) 45%,
    rgba(15, 23, 42, 0.85) 100%
  );
}

html:has(body.auth-page),
html.auth-html {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body.auth-page {
  margin: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background-color: #0f172a;
  background-image: var(--auth-overlay);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.auth-page.has-auth-bg {
  background-image: var(--auth-overlay), var(--auth-bg-image);
}

.auth-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  max-width: 380px;
  width: calc(100% - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  padding: 2rem;
  color: #1f2937;
  text-align: center;
  backdrop-filter: blur(2px);
  animation: authFadeIn 0.35s ease-in-out;
}

.auth-card h1,
.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--auth-primary);
  margin-bottom: 1rem;
}

.auth-card p {
  font-size: 0.95rem;
  color: var(--auth-gray-500);
  margin-bottom: 1.25rem;
}

.auth-card .form-control {
  border-radius: 8px;
  border: 1px solid var(--auth-gray-300);
  height: 48px;
  padding-left: 3rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-card .form-control:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.auth-card .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-primary);
  z-index: 2;
  pointer-events: none;
}

.auth-card .password-field-wrap .password-toggle-btn {
  color: var(--auth-primary);
}

.auth-card .password-field-wrap .password-toggle-btn:hover {
  color: var(--auth-primary-hover);
  background: rgba(37, 99, 235, 0.08);
}

.auth-card .password-field-wrap .password-toggle-btn:focus-visible {
  outline-color: var(--auth-primary);
}

.auth-card .btn-primary,
.auth-card .btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--auth-primary);
  border: none;
  border-radius: 8px;
  height: 48px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
}

.auth-card .btn-primary:hover,
.auth-card .btn-modern:hover {
  background-color: var(--auth-primary-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.auth-card .btn-modern:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.auth-footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.auth-version-text {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #9aa0a6;
  font-size: 14px;
  text-align: center;
  margin: 0;
  padding: 10px 0;
}

.auth-card .errorlist {
  color: #dc2626;
  margin-bottom: 1rem;
  list-style: none;
  padding: 0;
  text-align: left;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 576px) {
  .auth-card {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
}
