:root {
  --tenant-primary-color: #2563EB;
  --tenant-secondary-color: #F9FAFB;
  --tenant-primary-color-rgb: 37, 99, 235;
}

body.login-page {
  font-family: var(--font-primary, 'Inter', 'Noto Sans', sans-serif);
  margin: 0;
  color: #2D3748;
  padding: 0;
  min-height: 100vh;
}

body.login-page.no-tenant {
  background: linear-gradient(135deg, var(--tenant-primary-color) 0%, var(--tenant-primary-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

body.login-page.no-tenant::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.footer-text {
  text-align: center;
}

.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 255, 0.3);
  /* Blue tint overlay */
  z-index: 0;
}

.login-container {
  min-height: 100vh;
  display: flex;
  background-color: var(--tenant-secondary-color);
}

body.login-page.no-tenant .login-container {
  min-height: auto;
  background: none;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

body.login-page.no-tenant .login-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.login-page.no-tenant .login-title {
  color: #1E40AF;
}

body.login-page.no-tenant .login-subtitle {
  color: #4B5563;
}

body.login-page.no-tenant .form-control {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
}

body.login-page.no-tenant .form-control:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.login-page.no-tenant .btn-primary {
  background: #2563EB;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

body.login-page.no-tenant .btn-primary:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

body.login-page.no-tenant .forgot-password {
  color: #2563EB;
}

body.login-page.no-tenant .login-footer {
  border-top: 1px solid #E5E7EB;
}

body.login-page.no-tenant .version-info,
body.login-page.no-tenant .copyright {
  color: #6B7280;
}

body.login-page.no-tenant .website-link {
  color: #2563EB;
}

.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 480px;
  padding: 2.5rem;
}

.logo-container {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-container img.logo {
  max-width: 240px;
  height: auto;
  margin-bottom: 1.5rem;
}

.login-title {
  color: var(--tenant-primary-color);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: center;
}

.login-subtitle {
  color: #666;
  text-align: center;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  color: var(--tenant-primary-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: #666;
}

.form-control {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--tenant-primary-color);
  outline: none;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid #CBD5E0;
  appearance: none;
  cursor: pointer;
  position: relative;
}

.remember-me input[type="checkbox"]:checked {
  background-color: #4299E1;
  border-color: #4299E1;
}

.remember-me input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 10px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.forgot-password {
  color: #4299E1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
}

.btn-primary {
  background-color: var(--tenant-primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  width: 100%;
  margin-top: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: white;
  color: var(--tenant-primary-color);
  border: 1px solid var(--tenant-primary-color);
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  width: 100%;
  margin-top: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: var(--tenant-primary-color);
  color: white;
}

.btn-icon {
  font-size: 16px;
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background-color: #ddd;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.divider span {
  background-color: white;
  padding: 0 1rem;
  color: #666;
}

.office-login-btn {
  background: #2F2F2F;
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.office-login-btn:hover {
  background: #1A73E8;
  transform: translateY(-1px);
}

.office-login-btn .icon {
  height: 18px;
  width: auto;
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
}

.version-info {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.certification {
  margin: 12px 0;
}

.cyber {
  width: 50px;
  height: auto;
}

.copyright {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.website-link {
  color: var(--tenant-primary-color);
  text-decoration: none;
}

.website-link:hover {
  text-decoration: underline;
}

.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}

.alert-danger {
  background-color: #FED7D7;
  color: #C53030;
  border: 1px solid #FEB2B2;
}

.error-message {
  color: #E53E3E;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .login-container {
    max-width: 100%;
  }
  
  .login-card {
    padding: 20px;
  }
  
  .logo {
    width: 140px;
  }
  
  .login-title {
    font-size: 20px;
  }
  
  .login-subtitle {
    font-size: 13px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .btn {
    padding: 9px 18px;
    font-size: 13px;
  }
  
  .office-login-btn {
    padding: 9px 18px;
  }
  
  .office-login-btn .icon {
    height: 16px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .login-card {
    background: rgba(26, 32, 44, 0.95);
  }
  
  .login-title {
    color: #F7FAFC;
  }
  
  .login-subtitle {
    color: #A0AEC0;
  }
  
  .form-group label {
    color: #E2E8F0;
  }
  
  .form-control {
    background: rgba(45, 55, 72, 0.5);
    border-color: #4A5568;
    color: #F7FAFC;
  }
  
  .form-control:focus {
    background: rgba(45, 55, 72, 0.8);
  }
  
  .divider span {
    background: rgba(26, 32, 44, 0.95);
  }
  
  .copyright,
  .version-info {
    color: #A0AEC0;
  }
  
  .website-link {
    color: #63B3ED;
  }
  
  .website-link:hover {
    color: #90CDF4;
  }
}

.brand-side {
  flex: 1.2;
  background: var(--tenant-primary-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.brand-side::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  max-width: 480px;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.brand-logo {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}

.brand-logo img {
  max-width: 220px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
}

.login-side {
  flex: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--tenant-secondary-color);
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 1.75rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tracesense-logo {
  margin-bottom: 1.5rem;
}

.tracesense-logo img {
  max-width: 160px;
  height: auto;
}

.login-title {
  color: #1e293b;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: #64748b;
  font-size: 0.95rem;
}

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

.form-group label {
  color: #334155;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.9rem;
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1.1rem;
}

.form-control {
  width: 100%;
  padding: 12px 12px 12px 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: #f8fafc;
}

.form-control:focus {
  border-color: var(--tenant-primary-color);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(var(--tenant-primary-color-rgb), 0.1);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
  font-size: 0.9rem;
}

.forgot-password {
  color: var(--tenant-primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-primary {
  background: var(--tenant-primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--tenant-primary-color-rgb), 0.2);
}

.login-footer {
  margin-top: 1.75rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.version-info {
  color: #64748b;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.certification {
  margin: 0.75rem 0;
}

.certification img {
  max-width: 100px;
  height: auto;
}

.copyright {
  color: #64748b;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.website-link {
  color: var(--tenant-primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}

@media (max-width: 1024px) {
  .login-container {
    flex-direction: column;
  }

  .brand-side {
    padding: 2rem;
    min-height: 280px;
  }

  .brand-logo img {
    max-width: 180px;
  }

  .brand-title {
    font-size: 1.75rem;
  }

  .login-side {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .brand-side {
    min-height: 220px;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .brand-subtitle {
    font-size: 1rem;
  }

  .login-card {
    padding: 1.5rem;
  }
}