/* ============================================
   ClariDI Agility — Login Screen
   Glass-morphism dark theme
   ============================================ */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  animation: loginFadeIn 0.6s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
}

.login-screen.login-exit {
  animation: loginFadeOut 0.6s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1)) forwards;
}

@keyframes loginFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes loginFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.02); }
}

/* Background effects */
.login-bg-effects {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 8s ease-in-out infinite;
}

.login-orb-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, rgba(56,189,248,0.15) 0%, transparent 70%);
  animation-delay: 0s;
}

.login-orb-2 {
  width: 300px;
  height: 300px;
  bottom: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  animation-delay: -3s;
}

.login-orb-3 {
  width: 200px;
  height: 200px;
  top: 40%;
  left: 60%;
  background: radial-gradient(circle, rgba(56,189,248,0.08) 0%, transparent 70%);
  animation-delay: -5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -20px) scale(1.05); }
  66%      { transform: translate(-20px, 15px) scale(0.95); }
}

/* Login card */
.login-card {
  position: relative;
  width: 400px;
  max-width: 90vw;
  padding: 48px 40px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.5),
    0 0 60px rgba(56,189,248,0.05),
    inset 0 1px 0 rgba(255,255,255,0.05);
  animation: cardSlideUp 0.8s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1)) 0.1s both;
}

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo */
.login-logo {
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #39ff14;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: -6px;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.4), 0 0 30px rgba(57, 255, 20, 0.15);
}

.login-tagline {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin: 0 0 32px;
}

/* Error message */
.login-error {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f43f5e;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: center;
}

/* Form fields */
.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.login-field input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: 'Inter', system-ui, sans-serif;
  color: #f1f5f9;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-field input:focus {
  border-color: rgba(56,189,248,0.4);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.1);
}

.login-field input::placeholder {
  color: #475569;
}

.login-password-wrapper {
  position: relative;
}

.login-password-wrapper input {
  padding-right: 44px;
}

.login-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.login-toggle-pw:hover {
  color: #94a3b8;
}

.login-toggle-pw svg {
  width: 18px;
  height: 18px;
}

/* Options row */
.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 13px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  cursor: pointer;
}

.login-remember input[type="checkbox"] {
  accent-color: #60a5fa;
  width: 14px;
  height: 14px;
}

.login-forgot {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.login-forgot:hover {
  color: #93c5fd;
}

/* Sign in button */
.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(59,130,246,0.3);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.8;
  cursor: wait;
}

.login-btn-loader {
  display: inline-flex;
  align-items: center;
}

.login-spinner {
  width: 20px;
  height: 20px;
  animation: loginSpin 1s linear infinite;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.06);
}

/* SSO button */
.login-sso-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', system-ui, sans-serif;
  color: #94a3b8;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.login-sso-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #f1f5f9;
}

.login-sso-btn svg {
  width: 18px;
  height: 18px;
}

/* Footer */
.login-footer {
  text-align: center;
  font-size: 11px;
  color: #334155;
  margin: 24px 0 0;
  letter-spacing: 0.5px;
}

/* Version tag */
.login-version {
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-size: 11px;
  color: #1e293b;
  letter-spacing: 0.5px;
}

/* Logout button in shell */
.logout-btn {
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  margin-left: 8px;
}

.logout-btn:hover {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
}

.logout-btn svg {
  width: 18px;
  height: 18px;
}
