/* ============================================
   Login + Session Notices
   ============================================ */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(135deg, var(--bg-page) 0%, var(--blue-50) 50%, var(--bg-page) 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  pointer-events: none;
  animation: loginPulse 8s ease-in-out infinite;
}

.login-container::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
  bottom: -120px;
  left: -80px;
  pointer-events: none;
  animation: loginPulse 10s ease-in-out infinite reverse;
}

@keyframes loginPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

.login-card {
  background: var(--card-bg);
  padding: var(--space-8);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 10px 30px -5px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  animation: loginCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.25));
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.login-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-title {
  color: var(--text-primary);
  margin: 0 0 var(--space-1) 0;
  font-size: 1.25rem;
  text-align: center;
  font-weight: 600;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  margin: 0 0 var(--space-5) 0;
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
  font-weight: 500;
  font-size: 13px;
}

.form-group input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  height: 40px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input:focus:not(:focus-visible) {
  box-shadow: none;
}

.login-button {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 42px;
  margin-top: var(--space-2);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.login-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.login-button:hover {
  background: linear-gradient(135deg, var(--blue-700), #1e3a8a);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.login-button:hover::after {
  opacity: 1;
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-error {
  color: var(--danger);
  text-align: center;
  margin-top: var(--space-3);
  font-size: 13px;
  min-height: 20px;
}

.session-warning-overlay,
.connection-lost-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.session-warning-overlay {
  background: rgba(17, 24, 39, 0.45);
  z-index: 3000;
  backdrop-filter: blur(4px);
}

.connection-lost-overlay {
  background: rgba(17, 24, 39, 0.55);
  z-index: 4000;
  backdrop-filter: blur(4px);
}

.session-warning-modal,
.connection-lost-modal {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
}

.session-warning-modal { max-width: 430px; }
.connection-lost-modal { max-width: 460px; }

.session-warning-modal h3 {
  margin: 0 0 var(--space-3) 0;
  font-size: 1.15rem;
}

.connection-lost-modal h3 {
  margin: 0 0 var(--space-2) 0;
  color: var(--danger);
}

.session-warning-modal p,
.connection-lost-modal p {
  margin: 0;
  color: var(--text-secondary);
}

.session-warning-actions {
  margin-top: var(--space-5);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.session-warning-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.session-warning-logout:hover {
  background: var(--gray-100);
}

.session-warning-continue {
  background: var(--primary);
}

.connection-lost-sub {
  margin-top: var(--space-3) !important;
  font-size: 0.92rem;
}

.connection-lost-login-btn {
  margin-top: var(--space-5);
  width: 100%;
}

@media (max-width: 640px) {
  .login-card {
    margin: var(--space-4);
    padding: var(--space-6);
  }

  .session-warning-actions {
    flex-direction: column;
  }

  .session-warning-actions button {
    width: 100%;
  }
}

@media (min-width: 1600px) {
  .login-card {
    max-width: 440px;
    padding: var(--space-10);
    border-radius: 20px;
  }

  .login-title {
    font-size: 1.4rem;
  }

  .login-subtitle {
    font-size: 15px;
  }

  .login-logo-icon {
    width: 64px;
    height: 64px;
  }

  .form-group label {
    font-size: 14px;
  }

  .form-group input {
    height: 46px;
    font-size: 15px;
    padding: var(--space-3) var(--space-4);
  }

  .login-button {
    height: 48px;
    font-size: 16px;
  }
}

:root[data-theme='dark'] .login-container {
  background: linear-gradient(135deg, var(--bg-page) 0%, rgba(30, 58, 110, 0.15) 50%, var(--bg-page) 100%);
}

:root[data-theme='dark'] .login-container::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
}

:root[data-theme='dark'] .login-container::after {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
}

:root[data-theme='dark'] .login-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 10px 30px -5px rgba(0, 0, 0, 0.2);
  border-color: var(--border-color);
}

:root[data-theme='dark'] .login-logo-icon {
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.2));
}