/* =========================================================
   CLEAN, MODERN, CENTERED DASHBOARD AUTH STYLES
   Transparent Official TECHNICLAB Logo | Bottom-Right Attribution
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --auth-bg: #f8fafc;
  --auth-card-bg: #ffffff;
  --auth-text-dark: #0f172a;
  --auth-text-muted: #64748b;
  --auth-text-light: #94a3b8;
  
  --auth-primary: #1e3a8a; /* To'q ko'k / Dark Blue */
  --auth-primary-hover: #0f2756;
  --auth-primary-light: #eff6ff;
  --auth-primary-glow: rgba(30, 58, 138, 0.15);

  --auth-accent: #2563eb;
  --auth-techniclab: #0a1931; /* TECHNICLAB to'q ko'k rangi */

  --auth-input-bg: #f8fafc;
  --auth-input-border: #e2e8f0;
  --auth-input-border-focus: #2563eb;

  --auth-shadow-card: 0 25px 60px -15px rgba(15, 23, 42, 0.1), 0 0 1px 1px rgba(15, 23, 42, 0.04);
  --auth-shadow-btn: 0 12px 25px -6px rgba(30, 58, 138, 0.35);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

/* Fullscreen Center Overlay */
#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #f1f5f9 0%, #e2e8f0 100%);
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  font-family: var(--font-family);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#authOverlay.active {
  opacity: 1;
  visibility: visible;
}

/* Ambient background glow */
#authOverlay::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Centered Container */
.em-scene-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
}

/* Top Dashboard Header Branding with Logo */
.em-top-branding {
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.em-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: transparent;
  transition: transform 0.25s ease;
}

.em-logo-wrap:hover {
  transform: scale(1.03);
}

.em-main-logo-img {
  width: 140px;
  height: auto;
  display: block;
}

.em-dashboard-subtitle {
  font-size: 13.5px;
  color: var(--auth-text-muted);
  margin: 0;
  font-weight: 500;
}

/* Main Login Card */
.em-form-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  padding: 34px 30px;
  box-shadow: var(--auth-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

/* Input Fields */
.em-input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.em-input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-dark);
}

.em-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.em-input-icon {
  position: absolute;
  left: 16px;
  color: var(--auth-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

.em-input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: var(--auth-input-bg);
  border: 1.5px solid var(--auth-input-border);
  padding: 0 44px 0 46px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--auth-text-dark);
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.em-input::placeholder {
  color: var(--auth-text-light);
  font-weight: 400;
}

.em-input:focus {
  background: #ffffff;
  border-color: var(--auth-input-border-focus);
  box-shadow: 0 0 0 4px var(--auth-primary-glow), 0 4px 14px rgba(37, 99, 235, 0.08);
}

.em-input-wrap:focus-within .em-input-icon {
  color: var(--auth-accent);
}

.em-input-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--auth-text-light);
  font-size: 16px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color 0.2s, transform 0.15s;
}

.em-input-eye:hover {
  color: var(--auth-text-dark);
  transform: scale(1.1);
}

/* Submit Button */
.em-btn-next {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  box-shadow: var(--auth-shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  margin-top: 6px;
}

.em-btn-next:hover:not(:disabled) {
  background: linear-gradient(135deg, #0f2756 0%, #0a1931 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -6px rgba(15, 23, 42, 0.45);
}

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

.em-btn-next:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Forgot Password Link */
.em-footer-links {
  text-align: center;
  margin-top: 4px;
}

.em-btn-forgot {
  background: none;
  border: none;
  color: var(--auth-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, text-decoration 0.2s;
  font-family: inherit;
}

.em-btn-forgot:hover {
  color: var(--auth-primary-hover);
  text-decoration: underline;
}

/* =========================================================
   BOTTOM-RIGHT CORNER TECHNICLAB ATTRIBUTION (Fixed/Responsive)
   ========================================================= */
.techniclab-attribution {
  position: fixed;
  bottom: 22px;
  right: 24px;
  z-index: 1000000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  transition: all 0.25s ease;
}

.techniclab-attribution:hover {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.techniclab-text {
  color: #64748b;
}

.techniclab-brand {
  color: var(--auth-techniclab);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: color 0.2s ease;
}

.techniclab-brand::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--auth-techniclab);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.techniclab-brand:hover {
  color: #1e3a8a;
}

.techniclab-brand:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.techniclab-external-icon {
  opacity: 0.65;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.techniclab-brand:hover .techniclab-external-icon {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* IP & Location Pill */
.em-ip-pill-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.em-ip-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.em-ip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.em-ip-dot.warning {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.em-ip-dot.danger {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* VPN ALERT */
.em-vpn-alert {
  display: none;
  width: 100%;
  background: #ffffff;
  border-left: 5px solid #ef4444;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.12);
  margin-bottom: 14px;
}

.em-vpn-alert.active {
  display: block;
}

.em-vpn-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #991b1b;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.em-vpn-desc {
  font-size: 12.5px;
  color: #374151;
  line-height: 1.45;
  margin: 0;
}

/* WHITELIST ALERT & REQUEST ACCESS */
.em-whitelist-alert {
  display: none;
  width: 100%;
  background: #ffffff;
  border-left: 5px solid #f59e0b;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.12);
  margin-bottom: 14px;
}

.em-whitelist-alert.active {
  display: block;
}

.em-whitelist-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #92400e;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.em-whitelist-desc {
  font-size: 12.5px;
  color: #374151;
  line-height: 1.45;
  margin: 0 0 10px;
}

.em-btn-request-access {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.em-btn-request-access:hover:not(:disabled) {
  background: #1e40af;
  transform: translateY(-1px);
}

.em-status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  line-height: 1.35;
}

.em-status-pill.pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.em-status-pill.approved {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.em-status-pill.rejected {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* IP BAN ALERT WITH LIVE COUNTDOWN */
.em-ban-alert {
  display: none;
  width: 100%;
  background: #ffffff;
  border-left: 5px solid #dc2626;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.12);
  margin-bottom: 14px;
}

.em-ban-alert.active {
  display: block;
}

.em-ban-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #991b1b;
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.em-ban-desc {
  font-size: 12.5px;
  color: #374151;
  line-height: 1.4;
  margin: 0 0 10px;
}

.em-ban-timer-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fef2f2;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed #f87171;
}

.em-ban-timer-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #991b1b;
  text-transform: uppercase;
}

.em-ban-timer-digit {
  font-size: 17px;
  font-weight: 800;
  color: #dc2626;
  font-family: monospace;
}

/* Status Alert */
.em-alert-box {
  display: none;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.em-alert-box.error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
}

.em-alert-box.success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #d1fae5;
}

/* RECOVERY MODAL */
.em-recovery-modal {
  display: none;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--auth-shadow-card);
}

.em-recovery-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.em-rec-tab-btn {
  border: none;
  background: transparent;
  padding: 9px 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.em-rec-tab-btn.active {
  background: #ffffff;
  color: var(--auth-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.em-rec-result {
  background: #ecfdf5;
  border: 1.5px dashed #10b981;
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
  text-align: center;
}

/* Spinner */
.em-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: emSpin 0.7s linear infinite;
  display: none;
}

.btn-loading .em-spinner {
  display: inline-block;
}

.btn-loading .em-btn-text {
  display: none;
}

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

/* User Badge in Sidebar / Mount Point */
.auth-user-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--sidebar-soft, rgba(30, 58, 138, 0.06));
  border: 1px solid var(--line, rgba(30, 58, 138, 0.15));
  border-radius: var(--radius, 8px);
  color: var(--text, #151a44);
  box-sizing: border-box;
  width: 100%;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-user-meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.auth-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary, #1e3a8a);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.auth-user-text-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.auth-user-name {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text, #151a44);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-user-role {
  font-size: 11px;
  opacity: 0.75;
  color: var(--muted, #8c93b1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.auth-btn-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

body[data-mode="dark"] .auth-btn-logout {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

body[data-mode="dark"] .auth-btn-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* Responsive */
@media (max-width: 600px) {
  .techniclab-attribution {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: 24px;
  }
  .em-scene-container {
    max-width: 100%;
  }
  .em-form-card {
    padding: 26px 20px;
  }
  .em-main-logo-img {
    width: 115px;
  }
}
