/**
 * Dundee Movers CRM — Authentication & Security Stylesheet
 * Scottish Emerald Dark Glassmorphism, Luxury Dispatch Aesthetic
 */

.crm-auth-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #064e3b 0%, #022c22 45%, #051410 100%);
  padding: 1.5rem;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Ambient glow orbs in background */
.crm-auth-screen::before {
  content: '';
  position: absolute;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  pointer-events: none;
}

.crm-auth-screen::after {
  content: '';
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.12) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

.crm-auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(16, 185, 129, 0.1);
  padding: 2.5rem 2.25rem;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  animation: authFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.crm-auth-card.shake {
  animation: authShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes authShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

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

.crm-auth-insignia {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.crm-auth-insignia svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
}

.crm-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.crm-auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.45rem 0;
  letter-spacing: -0.02em;
}

.crm-auth-subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

.crm-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.crm-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.crm-auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
}

.crm-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.crm-auth-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(71, 85, 105, 0.5);
  border-radius: 12px;
  color: #f8fafc;
  font-size: 0.95rem;
  padding: 0.85rem 3rem 0.85rem 1rem;
  outline: none;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.crm-auth-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  background: rgba(15, 23, 42, 0.95);
}

.crm-auth-input::placeholder {
  color: #64748b;
  letter-spacing: normal;
}

.crm-auth-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.crm-auth-toggle-pwd:hover {
  color: #34d399;
}

.crm-auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: #94a3b8;
}

.crm-auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.crm-auth-remember input[type="checkbox"] {
  accent-color: #10b981;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.crm-auth-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.crm-auth-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
  transform: translateY(-1px);
}

.crm-auth-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.crm-auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.crm-auth-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.825rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: authFadeIn 0.2s ease;
}

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

.crm-auth-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(71, 85, 105, 0.3);
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.crm-auth-footer-shield {
  color: #10b981;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* Sidebar active badge & logout action */
.crm-sidebar-operator {
  padding: 0.75rem 1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  margin: 0.5rem 1rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-sidebar-operator-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.crm-sidebar-operator-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-sidebar-operator-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8fafc;
}

.crm-sidebar-lock-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.crm-sidebar-lock-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.5);
}
