/*
 * LabConnect LIS Authentication Styles
 * Split-panel modern SaaS sign-in: branded panel + form, built on the
 * shared design tokens in common.css (--color-primary, Inter, zinc scale).
 */

.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  background-color: #03040a;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ---------------------------------------------------------------- */
/* Full-page background video                                        */
/* ---------------------------------------------------------------- */

.auth-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  /* Forces its own compositor layer — position:fixed video combined with
     backdrop-filter elsewhere on the page was leaving most of the video
     layer unpainted in Chromium/Edge, showing only a sliver. */
  transform: translateZ(0);
  will-change: transform;
}

.auth-bg-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    /* Corner vignette — hides the source clip's watermark, bottom-right */
    radial-gradient(220px 130px at 100% 100%, rgba(3, 4, 10, 0.97) 0%, rgba(3, 4, 10, 0.75) 45%, transparent 75%),
    linear-gradient(
      180deg,
      rgba(3, 4, 10, 0.7) 0%,
      rgba(3, 4, 10, 0.45) 45%,
      rgba(3, 4, 10, 0.75) 100%
    );
  pointer-events: none;
}

@media (max-width: 767px) {
  .auth-bg-scrim {
    background:
      radial-gradient(160px 100px at 100% 100%, rgba(3, 4, 10, 0.97) 0%, rgba(3, 4, 10, 0.75) 45%, transparent 75%),
      rgba(3, 4, 10, 0.6);
  }
}

/* ---------------------------------------------------------------- */
/* Brand panel (left)                                                */
/* ---------------------------------------------------------------- */

.auth-brand-panel {
  position: relative;
  z-index: 2;
  flex: 0 0 44%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: #ffffff;
}

.auth-brand-top,
.auth-brand-main,
.auth-brand-footer {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.auth-brand-logo-icon {
  width: 34px;
  height: 34px;
  background-color: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-brand-logo-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.auth-brand-heading {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  max-width: 22ch;
  color: #ffffff;
}

.auth-brand-subtext {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  max-width: 34ch;
  margin-bottom: 2.25rem;
}

.auth-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
  animation: auth-fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-feature-item:nth-child(1) { animation-delay: 0.05s; }
.auth-feature-item:nth-child(2) { animation-delay: 0.12s; }
.auth-feature-item:nth-child(3) { animation-delay: 0.19s; }

@keyframes auth-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-feature-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-feature-text strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.125rem;
  color: #ffffff;
}

.auth-feature-text span {
  color: rgba(255, 255, 255, 0.7);
}

.auth-brand-footer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ---------------------------------------------------------------- */
/* Form panel (right)                                                */
/* ---------------------------------------------------------------- */

.auth-form-panel {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color-scheme: dark;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 380px;
  animation: auth-fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-form-card {
  /* Solid (not blurred) — backdrop-filter combined with the fixed/absolute
     background video caused a Chromium/Edge compositing bug where the video
     layer mostly failed to paint. Opaque-ish background stays legible
     without depending on backdrop-filter. */
  background: rgba(6, 9, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2.25rem;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}

@media (max-width: 480px) {
  .auth-form-card {
    padding: 1.75rem 1.25rem;
  }
}

.auth-header {
  margin-bottom: 2rem;
}

.auth-logo-placeholder {
  width: 36px;
  height: 36px;
  background-color: var(--color-primary);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.auth-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.auth-form-panel .form-group {
  margin-bottom: 1.25rem;
}

.auth-form-panel .form-label {
  color: rgba(255, 255, 255, 0.85);
}

.auth-form-panel .form-control {
  height: 42px;
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(96, 165, 250, 0.25);
  color: #ffffff;
}

.auth-form-panel .form-control::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.auth-form-panel .form-control:focus {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.auth-form-panel .form-control:-webkit-autofill {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0px 1000px #0a0e1a inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-form-panel .password-toggle-btn {
  color: rgba(255, 255, 255, 0.45);
  z-index: 2;
}

.auth-form-panel .password-toggle-btn:hover {
  color: #ffffff;
}

.auth-form-panel .form-checkbox {
  accent-color: var(--color-primary);
}

.auth-form-panel .form-checkbox-label {
  color: rgba(255, 255, 255, 0.7);
}

.auth-form-panel .alert-error {
  background-color: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-form-panel .text-danger {
  color: #fca5a5;
  font-size: 0.75rem;
  margin-top: 0.375rem;
  display: block;
}

.auth-footer-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.auth-link {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.auth-link:hover,
.auth-link:focus-visible {
  color: #ffffff;
  outline: none;
}

.auth-form-panel #submit-btn {
  height: 42px;
  font-size: 0.875rem;
  gap: 0.5rem;
}

.auth-form-panel #submit-btn .spinner {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
}

.auth-app-version {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */

@media (max-width: 1024px) {
  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    padding: 2rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-form-wrapper,
  .auth-feature-item {
    animation: none !important;
    transition: none !important;
  }
}

